kmail
accountmanager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef accountmanager_h
00021 #define accountmanager_h
00022
00023 #include <qobject.h>
00024 #include "kmaccount.h"
00025 #include <kdepimmacros.h>
00026
00027 class QString;
00028 class QStringList;
00029
00030 namespace KMail {
00035 class KDE_EXPORT AccountManager: public QObject
00036 {
00037 Q_OBJECT
00038 friend class ::KMAccount;
00039
00040 public:
00043 AccountManager();
00044 ~AccountManager();
00045
00047 void readConfig(void);
00048
00050 void writeConfig( bool withSync=true );
00051
00054 KMAccount* create( const QString& type,
00055 const QString& name = QString::null,
00056 uint id = 0);
00057
00059 void add( KMAccount *account );
00060
00063 KMAccount* findByName( const QString& name ) const;
00064
00067 KMAccount* find( const uint id ) const;
00068
00071 bool remove( KMAccount* );
00072
00074 const KMAccount* first() const { return first(); }
00075 KMAccount* first();
00076
00078 const KMAccount* next() const { return next(); }
00079 KMAccount* next();
00080
00082 void checkMail( bool interactive = true );
00083
00085 void invalidateIMAPFolders();
00086
00087 QStringList getAccounts() const;
00088
00090 void cancelMailCheck();
00091
00093 void readPasswords();
00094
00095 public slots:
00096 void singleCheckMail( KMAccount *, bool interactive = true );
00097 void singleInvalidateIMAPFolders( KMAccount * );
00098
00099 void intCheckMail( int, bool interactive = true );
00101 void slotProcessNextCheck();
00102 void processNextCheck( bool newMail );
00103
00106 void addToTotalNewMailCount( const QMap<QString, int> & newInFolder );
00107
00108
00109 signals:
00116 void checkedMail( bool newMail, bool interactive,
00117 const QMap<QString, int> & newInFolder );
00119 void accountRemoved( KMAccount* account );
00121 void accountAdded( KMAccount* account );
00122
00123 private:
00125 uint createId();
00126
00127 AccountList mAcctList;
00128 AccountList::Iterator mPtrListInterfaceProxyIterator;
00129 AccountList mAcctChecking;
00130 AccountList mAcctTodo;
00131 bool mNewMailArrived;
00132 bool mInteractive;
00133 int mTotalNewMailsArrived;
00134
00135
00136 QMap<QString, int> mTotalNewInFolder;
00137
00138
00139 bool mDisplaySummary;
00140 };
00141
00142 }
00143 #endif
|