kmail
kmacctcachedimap.hGo to the documentation of this file.00001
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 void killJobsForItem(KMFolderTreeItem * fti);
00082
00086 virtual void killAllJobs( bool disconnectSlave=false );
00087
00091 virtual void cancelMailCheck();
00092
00096 virtual void setImapFolder(KMFolderCachedImap *);
00097 KMFolderCachedImap* imapFolder() const { return mFolder; }
00098
00099 virtual void readConfig( KConfig & config );
00100 virtual void writeConfig( KConfig & config ) ;
00101
00105 virtual void invalidateIMAPFolders();
00106 virtual void invalidateIMAPFolders( KMFolderCachedImap* );
00107
00111 void addDeletedFolder( KMFolder* folder );
00112
00117 void addDeletedFolder( const QString& imapPath );
00118
00122 bool isDeletedFolder( const QString& subFolderPath ) const;
00123
00127 bool isPreviouslyDeletedFolder( const QString& subFolderPath ) const;
00128
00132 QStringList deletedFolderPaths( const QString& subFolderPath ) const;
00133
00137 void removeDeletedFolder( const QString& subFolderPath );
00138
00142 void addRenamedFolder( const QString& subFolderPath,
00143 const QString& oldLabel, const QString& newName );
00144
00149 void removeRenamedFolder( const QString& subFolderPath );
00150
00151 struct RenamedFolder {
00152 RenamedFolder() {}
00153 RenamedFolder( const QString& oldLabel, const QString& newName )
00154 : mOldLabel( oldLabel ), mNewName( newName ) {}
00155 QString mOldLabel;
00156 QString mNewName;
00157 };
00158
00162 QString renamedFolder( const QString& imapPath ) const;
00166 const QMap<QString, RenamedFolder>& renamedFolders() const { return mRenamedFolders; }
00167
00171 void addUnreadMsgCount( const KMFolderCachedImap *folder, int countUnread );
00172
00176 void addLastUnreadMsgCount( const KMFolderCachedImap *folder,
00177 int countLastUnread );
00178
00182 virtual FolderStorage* const rootFolder() const;
00183
00185 bool annotationCheckPassed(){ return mAnnotationCheckPassed;};
00186 void setAnnotationCheckPassed( bool a ){ mAnnotationCheckPassed = a; };
00187
00189 enum GroupwareType
00190 {
00191 GroupwareNone,
00192 GroupwareKolab,
00193 GroupwareScalix
00194 };
00195
00196 void setGroupwareType( GroupwareType type ){ mGroupwareType = type; }
00197 GroupwareType groupwareType() const { return mGroupwareType; }
00198
00199 void setSentCustomLoginCommand( bool value ){ mSentCustomLoginCommand = value; }
00200 bool sentCustomLoginCommand() const { return mSentCustomLoginCommand; }
00201
00202 protected:
00203 friend class ::AccountManager;
00204 KMAcctCachedImap(AccountManager* owner, const QString& accountName, uint id);
00205
00206 protected slots:
00208 void postProcessNewMail(KMFolderCachedImap*, bool);
00209
00210 void slotProgressItemCanceled( KPIM::ProgressItem* );
00211
00212 virtual void slotCheckQueuedFolders();
00213
00214 private:
00215 QValueList<KMFolderCachedImap*> killAllJobsInternal( bool disconnectSlave );
00216 void processNewMail( KMFolderCachedImap* folder, bool recurse );
00217
00218 private:
00219 QPtrList<CachedImapJob> mJobList;
00220 KMFolderCachedImap *mFolder;
00221 QStringList mDeletedFolders;
00222 QStringList mPreviouslyDeletedFolders;
00223 QMap<QString, RenamedFolder> mRenamedFolders;
00224 bool mAnnotationCheckPassed;
00225
00226 GroupwareType mGroupwareType;
00227 bool mSentCustomLoginCommand;
00228 };
00229
00230 #endif
|