kmail
kmmsgdict.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __KMMSGDICT
00021 #define __KMMSGDICT
00022
00023 class KMFolder;
00024 class KMMsgBase;
00025 class KMMessage;
00026 class KMMsgDictEntry;
00027 class KMMsgDictREntry;
00028 class KMDict;
00029 class QString;
00030 class FolderStorage;
00031
00049 class KMMsgDict
00050 {
00051 template<class> friend class KStaticDeleter;
00052 public:
00054 static const KMMsgDict* instance();
00055
00058 void getLocation( unsigned long key, KMFolder **retFolder, int *retIndex ) const;
00061 void getLocation( const KMMsgBase *msg, KMFolder **retFolder, int *retIndex ) const;
00064 void getLocation( const KMMessage *msg, KMFolder **retFolder, int *retIndex ) const;
00065
00069 unsigned long getMsgSerNum( KMFolder *folder, int index ) const;
00070
00071 private:
00072
00073
00074
00075
00076 friend class FolderStorage;
00077 friend class KMMsgList;
00078 friend class KMFolderIndex;
00079
00080
00081 static KMMsgDict* mutableInstance();
00082
00086 unsigned long insert(unsigned long msgSerNum, const KMMsgBase *msg, int index = -1);
00087
00091 unsigned long insert(const KMMsgBase *msg, int index = -1);
00092
00094 void replace(unsigned long msgSerNum,
00095 const KMMsgBase *msg, int index = -1);
00096
00098 void remove(unsigned long msgSerNum);
00099
00101 unsigned long remove(const KMMsgBase *msg);
00102
00104 void update(const KMMsgBase *msg, int index, int newIndex);
00105
00106
00107
00108
00110 static QString getFolderIdsLocation( const FolderStorage &folder );
00111
00113 bool isFolderIdsOutdated( const FolderStorage &folder );
00114
00116 int readFolderIds( FolderStorage & );
00117
00119 int writeFolderIds( const FolderStorage & );
00120
00122 int touchFolderIds( const FolderStorage & );
00123
00126 int appendToFolderIds( FolderStorage&, int index );
00127
00129 bool hasFolderIds( const FolderStorage & );
00130
00132 bool removeFolderIds( FolderStorage & );
00133
00136 KMMsgDictREntry *openFolderIds( const FolderStorage &, bool truncate);
00137
00138
00139
00140
00143 static void deleteRentry(KMMsgDictREntry *entry);
00144
00146 unsigned long getNextMsgSerNum();
00147
00148
00149 KMMsgDict();
00150 ~KMMsgDict();
00151
00153 unsigned long nextMsgSerNum;
00154
00156 KMDict *dict;
00157
00159 static KMMsgDict *m_self;
00160 };
00161
00162 #endif
|