/*
 *  Copyright (C) 2007-2008 CMM Sigma Andrzej Chmielowiec <cmmsigma@cmmsigma.eu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 3
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 */

// CaOptions.h: interface for the CaOptions class.
//
//////////////////////////////////////////////////////////////////////

#ifndef CAOPTIONS_H
#define CAOPTIONS_H

#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QStringList>
#include "MailConfig.h"

class CaOptions
{
public:
	CaOptions();
	virtual ~CaOptions();

	struct FTPConfig
	{
		struct FTPAccount
		{
			QString mName;
			QString mServer;
			QString mUser;
			QString mPass;
			bool mUseAccount;
			QStringList mPaths;

			FTPAccount()
			{
				mUseAccount = true;
			}

			void serialize(QXmlStreamWriter &xml);
			bool deserialize(QXmlStreamReader &xml);
		};

		QList<FTPAccount> mAccounts;
		int getActiveCount();

		void serialize(QXmlStreamWriter &xml);
		bool deserialize(QXmlStreamReader &xml);
	};

	MailConfig mailConfig;
	FTPConfig ftpConfig;

	void serialize(QIODevice &dev);
	bool deserialize(QIODevice &dev);
};

#endif
