2 Copyright (c) 2012-2013 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef ABSTRACTSETTINGS_H
19 #define ABSTRACTSETTINGS_H
21 #include "abstractbase.h"
22 #include <KSharedConfig>
27 namespace KIdentityManagement
30 class IdentityManager
;
33 namespace MailTransport
38 class AbstractSettings
: public AbstractBase
41 explicit AbstractSettings(ImportWizard
*parent
);
45 void addImportInfo(const QString
&log
);
46 void addImportError(const QString
&log
);
48 void syncKmailConfig();
50 QString
uniqueIdentityName(const QString
&name
);
52 QString
createResource(const QString
&resources
, const QString
&name
, const QMap
<QString
, QVariant
> &settings
);
54 KIdentityManagement::Identity
*createIdentity(QString
&name
);
56 MailTransport::Transport
*createTransport();
58 void storeTransport(MailTransport::Transport
*mt
, bool isDefault
= false);
60 void storeIdentity(KIdentityManagement::Identity
*identity
);
62 void addKmailConfig(const QString
&groupName
, const QString
&key
, const QString
&value
);
63 void addKmailConfig(const QString
&groupName
, const QString
&key
, bool value
);
64 void addKmailConfig(const QString
&groupName
, const QString
&key
, int value
);
66 void addComposerHeaderGroup(const QString
&groupName
, const QString
&name
, const QString
&value
);
68 void addKNodeConfig(const QString
&groupName
, const QString
&key
, bool value
);
69 void addAkregatorConfig(const QString
&groupName
, const QString
&key
, bool value
);
71 void addCheckMailOnStartup(const QString
&agentIdentifyName
, bool loginAtStartup
);
72 void addToManualCheck(const QString
&agentIdentifyName
, bool manualCheck
);
73 int readKmailSettings(const QString
&groupName
, const QString
&key
);
75 ImportWizard
*mImportWizard
;
76 KIdentityManagement::IdentityManager
*mManager
;
77 KSharedConfigPtr mKmailConfig
;
80 #endif // ABSTRACTSETTINGS_H