Build with non-standard boost locations.
[kdepim.git] / wizards / kmailchanges.h
blobddee5c8e6c75a968ab1ae74cd09c1a0b0ebe2bb9
1 /*
2 This file is part of kdepim.
4 Copyright (c) 2004 Bo Thorsen <bo@sonofthor.dk>
5 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
22 #ifndef KMAILCHANGES_H
23 #define KMAILCHANGES_H
25 #include <kconfig.h>
27 #include "kconfigpropagator.h"
29 namespace KWallet {
30 class Wallet;
33 class CreateImapAccount : public KConfigPropagator::Change
35 public:
36 class CustomWriter
38 public:
39 virtual ~CustomWriter() {}
40 virtual void writeFolder( KConfig &, int folderId ) = 0;
41 virtual void writeIds( int accountId, int transportId ) = 0;
44 CreateImapAccount( const QString &accountName, const QString &title );
45 virtual ~CreateImapAccount();
47 void setServer( const QString & );
48 void setUser( const QString & );
49 void setPassword( const QString & );
50 void setRealName( const QString & );
51 void setPort( int );
52 /**
53 Set email. Default is "user@server".
55 void setEmail( const QString & );
57 void setDefaultDomain( const QString & );
59 void enableSieve( bool );
60 void setSieveVacationFileName( const QString& );
61 void enableSavePassword( bool );
63 enum Encryption { None, SSL, TLS };
64 enum Authentication { NONE, PLAIN, LOGIN, NTLM_SPA, GSSAPI, DIGEST_MD5, CRAM_MD5 };
66 void setEncryption( Encryption );
67 void setAuthentication( Authentication );
69 void setAuthenticationSend( Authentication );
71 void setSmtpPort( int );
73 void setExistingAccountId( int );
74 void setExistingTransportId( int );
76 /**
77 Set custom writer. CreateImapAccount takes ownerhsip of the
78 object.
80 void setCustomWriter( CustomWriter * );
82 protected:
83 bool writeToWallet( const QString &type, int id );
85 protected:
86 QString mAccountName;
88 QString mServer;
89 QString mUser;
90 QString mPassword;
91 QString mRealName;
92 int mPort;
93 QString mEmail;
94 QString mDefaultDomain;
96 QString mSieveVacationFileName;
97 bool mEnableSieve;
98 bool mEnableSavePassword;
100 Encryption mEncryption;
101 Authentication mAuthentication;
102 Authentication mAuthenticationSend;
104 int mSmtpPort;
106 int mExistingAccountId;
107 int mExistingTransportId;
109 CustomWriter *mCustomWriter;
111 private:
112 static KWallet::Wallet *mWallet;
115 class CreateDisconnectedImapAccount : public CreateImapAccount
117 public:
118 enum GroupwareType
120 GroupwareNone,
121 GroupwareKolab,
122 GroupwareScalix
125 CreateDisconnectedImapAccount( const QString &accountName );
126 virtual void apply();
128 void enableLocalSubscription( bool b ) { mLocalSubscription = b; }
129 void setGroupwareType( GroupwareType type ) { mGroupwareType = type; }
131 private:
132 bool mLocalSubscription;
133 GroupwareType mGroupwareType;
136 class CreateOnlineImapAccount : public CreateImapAccount
138 public:
139 CreateOnlineImapAccount( const QString &accountName );
140 virtual void apply();
143 #endif