kmail
kmacctcachedimap.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef KMAcctCachedImap_h
00033 #define KMAcctCachedImap_h
00034
00035 #include "imapaccountbase.h"
00036
00037 #include <qguardedptr.h>
00038
00039 class KMFolderCachedImap;
00040 class KMFolderTreeItem;
00041 class KMFolder;
00042 namespace KMail {
00043 class FolderJob;
00044 class ImapJob;
00045 class CachedImapJob;
00046 }
00047 using KMail::ImapJob;
00048 using KMail::CachedImapJob;
00049
00050 namespace KIO {
00051 class Job;
00052 }
00053
00054 class KMAcctCachedImap: public KMail::ImapAccountBase
00055 {
00056 Q_OBJECT
00057 friend class ::KMail::ImapJob;
00058 friend class ::KMail::CachedImapJob;
00059
00060 public:
00061 virtual ~KMAcctCachedImap();
00062 virtual void init();
00063
00065 virtual void pseudoAssign( const KMAccount * a );
00066
00070 virtual void setAutoExpunge(bool);
00071
00075 virtual QString type() const;
00076 virtual void processNewMail( bool interactive );
00077
00081 virtual void killAllJobs( bool disconnectSlave=false );
00082
00086 virtual void cancelMailCheck();
00087
00091 virtual void setImapFolder(KMFolderCachedImap *);
00092 KMFolderCachedImap* imapFolder() const { return mFolder; }
00093
00094 virtual void readConfig( KConfig & config );
00095 virtual void writeConfig( KConfig & config ) ;
00096
00100 virtual void invalidateIMAPFolders();
00101 virtual void invalidateIMAPFolders( KMFolderCachedImap* );
00102
00106 void addDeletedFolder( KMFolder* folder );
00107
00112 void addDeletedFolder( const QString& imapPath );
00113
00117 bool isDeletedFolder( const QString& subFolderPath ) const;
00118
00122 bool isPreviouslyDeletedFolder( const QString& subFolderPath ) const;
00123
00127 QStringList deletedFolderPaths( const QString& subFolderPath ) const;
00128
00132 void removeDeletedFolder( const QString& subFolderPath );
00133
00137 void addRenamedFolder( const QString& subFolderPath,
00138 const QString& oldLabel, const QString& newName );
00139
00144 void removeRenamedFolder( const QString& subFolderPath );
00145
00146 struct RenamedFolder {
00147 RenamedFolder() {}
00148 RenamedFolder( const QString& oldLabel, const QString& newName )
00149 : mOldLabel( oldLabel ), mNewName( newName ) {}
00150 QString mOldLabel;
00151 QString mNewName;
00152 };
00153
00157 QString renamedFolder( const QString& imapPath ) const;
00161 const QMap<QString, RenamedFolder>& renamedFolders() const { return mRenamedFolders; }
00162
00166 void addUnreadMsgCount( const KMFolderCachedImap *folder, int countUnread );
00167
00171 void addLastUnreadMsgCount( const KMFolderCachedImap *folder,
00172 int countLastUnread );
00173
00177 virtual FolderStorage* rootFolder() const;
00178
00180 bool annotationCheckPassed(){ return mAnnotationCheckPassed;};
00181 void setAnnotationCheckPassed( bool a ){ mAnnotationCheckPassed = a; };
00182
00184 enum GroupwareType
00185 {
00186 GroupwareNone,
00187 GroupwareKolab,
00188 GroupwareScalix
00189 };
00190
00191 void setGroupwareType( GroupwareType type ){ mGroupwareType = type; }
00192 GroupwareType groupwareType() const { return mGroupwareType; }
00193
00194 void setSentCustomLoginCommand( bool value ){ mSentCustomLoginCommand = value; }
00195 bool sentCustomLoginCommand() const { return mSentCustomLoginCommand; }
00196
00197 protected:
00198 friend class ::AccountManager;
00199 KMAcctCachedImap(AccountManager* owner, const QString& accountName, uint id);
00200
00201 protected slots:
00203 void postProcessNewMail(KMFolderCachedImap*, bool);
00204
00205 void slotProgressItemCanceled( KPIM::ProgressItem* );
00206
00207 virtual void slotCheckQueuedFolders();
00208
00209 private:
00210 QValueList<KMFolderCachedImap*> killAllJobsInternal( bool disconnectSlave );
00211 void processNewMail( KMFolderCachedImap* folder, bool recurse );
00212
00213 private:
00214 QPtrList<CachedImapJob> mJobList;
00215 KMFolderCachedImap *mFolder;
00216 QStringList mDeletedFolders;
00217 QStringList mPreviouslyDeletedFolders;
00218 QMap<QString, RenamedFolder> mRenamedFolders;
00219 bool mAnnotationCheckPassed;
00220
00221 GroupwareType mGroupwareType;
00222 bool mSentCustomLoginCommand;
00223 };
00224
00225 #endif
|