kmail

networkaccount.h
1/*
2 * networkaccount.h
3 *
4 * Copyright (c) 2000-2002 Michael Haeckel <haeckel@kde.org>
5 * Copyright (c) 2002 Marc Mutz <mutz@kde.org>
6 *
7 * This file is based on work on pop3 and imap account implementations
8 * by Don Sanders <sanders@kde.org> and Michael Haeckel <haeckel@kde.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23
24
25#ifndef __KMAIL_NETWORKACCOUNT_H__
26#define __KMAIL_NETWORKACCOUNT_H__
27
28#include <tqguardedptr.h>
29
30#include "kmaccount.h"
31
32#include "sieveconfig.h"
33
34#include <tqstring.h>
35
36namespace KMail {
37 class AccountManager;
38}
39class TDEConfig/*Base*/;
40class KURL;
41namespace TDEIO {
42 class Slave;
43 class MetaData;
44}
45
46namespace KMail {
47
48 class NetworkAccount : public KMAccount {
49 TQ_OBJECT
50
51 protected:
52 NetworkAccount( AccountManager * parent, const TQString & name, uint id );
53 public:
54 virtual ~NetworkAccount();
55
57 virtual void init();
58
60 virtual void pseudoAssign( const KMAccount * a );
61
63 TQString login() const { return mLogin; }
64 virtual void setLogin( const TQString & login );
65
67 TQString passwd() const;
68 virtual void setPasswd( const TQString & passwd, bool storeInConfig=false );
69
73 virtual void clearPasswd();
74
76 TQString auth() const { return mAuth; }
77 virtual void setAuth( const TQString & auth );
78
80 bool storePasswd() const { return mStorePasswd; }
81 virtual void setStorePasswd( bool store );
82
84 TQString host() const { return mHost; }
85 virtual void setHost( const TQString & host );
86
88 unsigned short int port() const { return mPort; }
89 virtual void setPort( unsigned short int port );
90
92 bool useSSL() const { return mUseSSL; }
93 virtual void setUseSSL( bool use );
94
96 bool useTLS() const { return mUseTLS; }
97 virtual void setUseTLS( bool use );
98
100 KMail::SieveConfig sieveConfig() const { return mSieveConfig; }
101 virtual void setSieveConfig( const KMail::SieveConfig & config );
102
104 virtual TDEIO::MetaData slaveConfig() const;
105
106 virtual void readConfig( /*const*/ TDEConfig/*Base*/ & config );
107 virtual void writeConfig( TDEConfig/*Base*/ & config ) /*const*/;
108
110 virtual KURL getUrl() const;
111
113 TDEIO::Slave * slave() const { return mSlave; }
114
116 virtual void killAllJobs( bool disconnectSlave = false ) = 0;
117
119 void readPassword();
120
121 virtual bool mailCheckCanProceed() const;
122
123 virtual void setCheckingMail( bool checking );
124
126 static void resetConnectionList( NetworkAccount* acct );
127 protected:
128 virtual TQString protocol() const = 0;
129 virtual unsigned short int defaultPort() const = 0;
130
131 protected:
132 KMail::SieveConfig mSieveConfig;
133 TQGuardedPtr<TDEIO::Slave> mSlave;
134 TQString mLogin, mPasswd, mAuth, mHost;
135 unsigned short int mPort;
136 bool mStorePasswd : 1;
137 bool mUseSSL : 1;
138 bool mUseTLS : 1;
139 bool mAskAgain : 1;
140 bool mPasswdDirty, mStorePasswdInConfig;
141 };
142
143} // namespace KMail
144
145#endif // __KMAIL_NETWORKACCOUNT_H__
The account manager is responsible for creating accounts of various types via the factory method crea...
folderdiaquotatab.h
Definition: aboutdata.cpp:40