kmail

accountmanager.h
1/*
2 * kmail: KDE mail client
3 * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef accountmanager_h
21#define accountmanager_h
22
23#include <tqobject.h>
24#include "kmaccount.h"
25#include <tdemacros.h>
26
27class TQString;
28class TQStringList;
29
30namespace KMail {
35class TDE_EXPORT AccountManager: public TQObject
36{
37 TQ_OBJECT
38
39 friend class ::KMAccount;
40
41public:
46
48 void readConfig(void);
49
51 void writeConfig( bool withSync=true );
52
55 KMAccount* create( const TQString& type,
56 const TQString& name = TQString(),
57 uint id = 0);
58
60 void add( KMAccount *account );
61
64 KMAccount* findByName( const TQString& name ) const;
65
68 KMAccount* find( const uint id ) const;
69
72 bool remove( KMAccount* );
73
75 const KMAccount* first() const { return first(); }
76 KMAccount* first();
77
79 const KMAccount* next() const { return next(); }
80 KMAccount* next();
81
83 void checkMail( bool interactive = true );
84
86 void invalidateIMAPFolders();
87
88 TQStringList getAccounts() const;
89
91 void cancelMailCheck();
92
94 void readPasswords();
95
96public slots:
97 void singleCheckMail( KMAccount *, bool interactive = true );
98 void singleInvalidateIMAPFolders( KMAccount * );
99
100 void intCheckMail( int, bool interactive = true );
101 void processNextCheck( bool newMail );
102
105 void addToTotalNewMailCount( const TQMap<TQString, int> & newInFolder );
106
107
108signals:
115 void checkedMail( bool newMail, bool interactive,
116 const TQMap<TQString, int> & newInFolder );
118 void accountRemoved( KMAccount* account );
120 void accountAdded( KMAccount* account );
121
122private:
124 uint createId();
125
126 AccountList mAcctList;
127 AccountList::Iterator mPtrListInterfaceProxyIterator;
128 AccountList mAcctChecking;
129 AccountList mAcctTodo;
130 bool mNewMailArrived;
131 bool mInteractive;
132 int mTotalNewMailsArrived;
133
134 // for detailed (per folder) new mail notification
135 TQMap<TQString, int> mTotalNewInFolder;
136
137 // if a summary should be displayed
138 bool mDisplaySummary;
139};
140
141} // namespace KMail
142#endif /*accountmanager_h*/
The account manager is responsible for creating accounts of various types via the factory method crea...
void accountRemoved(KMAccount *account)
emitted when an account is removed
const KMAccount * next() const
Next account of the list.
const KMAccount * first() const
First account of the list.
void accountAdded(KMAccount *account)
emitted when an account is added
void checkedMail(bool newMail, bool interactive, const TQMap< TQString, int > &newInFolder)
Emitted if new mail has been collected.
folderdiaquotatab.h
Definition: aboutdata.cpp:40