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 <tqobject.h>
00024 #include "kmaccount.h"
00025 #include <kdepimmacros.h>
00026
00027 class TQString;
00028 class TQStringList;
00029
00030 namespace KMail {
00035 class KDE_EXPORT AccountManager: public TQObject
00036 {
00037 Q_OBJECT
00038 TQ_OBJECT
00039 friend class ::KMAccount;
00040
00041 public:
00044 AccountManager();
00045 ~AccountManager();
00046
00048 void readConfig(void);
00049
00051 void writeConfig( bool withSync=true );
00052
00055 KMAccount* create( const TQString& type,
00056 const TQString& name = TQString(),
00057 uint id = 0);
00058
00060 void add( KMAccount *account );
00061
00064 KMAccount* findByName( const TQString& name ) const;
00065
00068 KMAccount* find( const uint id ) const;
00069
00072 bool remove( KMAccount* );
00073
00075 const KMAccount* first() const { return first(); }
00076 KMAccount* first();
00077
00079 const KMAccount* next() const { return next(); }
00080 KMAccount* next();
00081
00083 void checkMail( bool interactive = true );
00084
00086 void invalidateIMAPFolders();
00087
00088 TQStringList getAccounts() const;
00089
00091 void cancelMailCheck();
00092
00094 void readPasswords();
00095
00096 public slots:
00097 void singleCheckMail( KMAccount *, bool interactive = true );
00098 void singleInvalidateIMAPFolders( KMAccount * );
00099
00100 void intCheckMail( int, bool interactive = true );
00101 void processNextCheck( bool newMail );
00102
00105 void addToTotalNewMailCount( const TQMap<TQString, int> & newInFolder );
00106
00107
00108 signals:
00115 void checkedMail( bool newMail, bool interactive,
00116 const TQMap<TQString, int> & newInFolder );
00118 void accountRemoved( KMAccount* account );
00120 void accountAdded( KMAccount* account );
00121
00122 private:
00124 uint createId();
00125
00126 AccountList mAcctList;
00127 AccountList::Iterator mPtrListInterfaceProxyIterator;
00128 AccountList mAcctChecking;
00129 AccountList mAcctTodo;
00130 bool mNewMailArrived;
00131 bool mInteractive;
00132 int mTotalNewMailsArrived;
00133
00134
00135 TQMap<TQString, int> mTotalNewInFolder;
00136
00137
00138 bool mDisplaySummary;
00139 };
00140
00141 }
00142 #endif
|