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
27 #include "kconfigpropagator.h"
33 class CreateImapAccount
: public KConfigPropagator::Change
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
& );
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 );
77 Set custom writer. CreateImapAccount takes ownerhsip of the
80 void setCustomWriter( CustomWriter
* );
83 bool writeToWallet( const QString
&type
, int id
);
94 QString mDefaultDomain
;
96 QString mSieveVacationFileName
;
98 bool mEnableSavePassword
;
100 Encryption mEncryption
;
101 Authentication mAuthentication
;
102 Authentication mAuthenticationSend
;
106 int mExistingAccountId
;
107 int mExistingTransportId
;
109 CustomWriter
*mCustomWriter
;
112 static KWallet::Wallet
*mWallet
;
115 class CreateDisconnectedImapAccount
: public CreateImapAccount
125 CreateDisconnectedImapAccount( const QString
&accountName
);
126 virtual void apply();
128 void enableLocalSubscription( bool b
) { mLocalSubscription
= b
; }
129 void setGroupwareType( GroupwareType type
) { mGroupwareType
= type
; }
132 bool mLocalSubscription
;
133 GroupwareType mGroupwareType
;
136 class CreateOnlineImapAccount
: public CreateImapAccount
139 CreateOnlineImapAccount( const QString
&accountName
);
140 virtual void apply();