kmail Library API Documentation

kmacctmgr.h

00001 /* -*- mode: C++ -*-
00002  * KMail Account Manager
00003  *
00004  * Author: Stefan Taferner <taferner@alpin.or.at>
00005  */
00006 #ifndef kmacctmgr_h
00007 #define kmacctmgr_h
00008 
00009 #include <qobject.h>
00010 #include "kmaccount.h"
00011 
00012 class QString;
00013 class QStringList;
00014 
00015 
00016 class KMAcctMgr: public QObject
00017 {
00018   Q_OBJECT
00019   friend class KMAccount;
00020 
00021 public:
00024   KMAcctMgr();
00025   virtual ~KMAcctMgr();
00026 
00028   virtual void readConfig(void);
00029 
00031   virtual void writeConfig(bool withSync=TRUE);
00032 
00035   virtual KMAccount* create(const QString& type, const QString& name, uint id = 0);
00036 
00038   virtual void add(KMAccount *account);
00039 
00042   virtual KMAccount* findByName(const QString& name);
00043 
00046   virtual KMAccount* find(const uint id);
00047 
00050   virtual bool remove(KMAccount*);
00051 
00053   virtual KMAccount* first(void);
00054 
00056   virtual KMAccount* next(void);
00057 
00059   virtual void checkMail(bool _interactive = true);
00060 
00062   void invalidateIMAPFolders();
00063 
00064   QStringList getAccounts(bool noImap = false);
00065 
00067   uint createId();
00068 
00070   void cancelMailCheck();
00071 
00072 public slots:
00073   virtual void singleCheckMail(KMAccount *, bool _interactive = true);
00074   virtual void singleInvalidateIMAPFolders(KMAccount *);
00075 
00076   virtual void intCheckMail(int, bool _interactive = true);
00077   virtual void processNextCheck(bool _newMail);
00078 
00081   virtual void addToTotalNewMailCount( const QMap<QString, int> & newInFolder );
00082 
00083 signals:
00090   void checkedMail( bool newMail, bool interactive,
00091                     const QMap<QString, int> & newInFolder );
00093   void accountRemoved( KMAccount* account );
00095   void accountAdded( KMAccount* account );
00096 
00097 private:
00098   KMAcctList   mAcctList;
00099   KMAcctList   mAcctChecking;
00100   KMAcctList   mAcctTodo;
00101   bool newMailArrived;
00102   bool interactive;
00103   int  mTotalNewMailsArrived;
00104 
00105   // for detailed (per folder) new mail notification
00106   QMap<QString, int> mTotalNewInFolder;
00107 
00108   // for restricting number of concurrent connections to the same server
00109   QMap<QString, int> mServerConnections;
00110   QString hostForAccount(const KMAccount *acct) const;
00111 
00112   // if a summary should be displayed
00113   bool mDisplaySummary;
00114 
00115 };
00116 
00117 #endif /*kmacctmgr_h*/
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:54:48 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003