kmail
kmmsgdict.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 #ifndef __KMMSGDICT
00021 #define __KMMSGDICT
00022
00023 #include <qvaluelist.h>
00024 #include <qptrlist.h>
00025
00026 class KMFolder;
00027 class KMMsgBase;
00028 class KMMessage;
00029 class KMMsgDictEntry;
00030 class KMMsgDictREntry;
00031 class KMDict;
00032 class QString;
00033 class FolderStorage;
00034
00052 class KMMsgDict
00053 {
00054 template<class> friend class KStaticDeleter;
00055 public:
00057 static const KMMsgDict* instance();
00058
00061 void getLocation( unsigned long key, KMFolder **retFolder, int *retIndex ) const;
00064 void getLocation( const KMMsgBase *msg, KMFolder **retFolder, int *retIndex ) const;
00067 void getLocation( const KMMessage *msg, KMFolder **retFolder, int *retIndex ) const;
00068
00072 unsigned long getMsgSerNum( KMFolder *folder, int index ) const;
00073
00075 static QValueList<unsigned long> serNumList(QPtrList<KMMsgBase> msgList);
00076
00077 private:
00078
00079
00080
00081
00082 friend class FolderStorage;
00083 friend class KMMsgList;
00084 friend class KMFolderIndex;
00085
00086
00087 static KMMsgDict* mutableInstance();
00088
00092 unsigned long insert(unsigned long msgSerNum, const KMMsgBase *msg, int index = -1);
00093
00097 unsigned long insert(const KMMsgBase *msg, int index = -1);
00098
00100 void replace(unsigned long msgSerNum,
00101 const KMMsgBase *msg, int index = -1);
00102
00104 void remove(unsigned long msgSerNum);
00105
00107 unsigned long remove(const KMMsgBase *msg);
00108
00110 void update(const KMMsgBase *msg, int index, int newIndex);
00111
00112
00113
00114
00116 static QString getFolderIdsLocation( const FolderStorage &folder );
00117
00119 bool isFolderIdsOutdated( const FolderStorage &folder );
00120
00122 int readFolderIds( FolderStorage & );
00123
00125 int writeFolderIds( const FolderStorage & );
00126
00128 int touchFolderIds( const FolderStorage & );
00129
00132 int appendToFolderIds( FolderStorage&, int index );
00133
00135 bool hasFolderIds( const FolderStorage & );
00136
00138 bool removeFolderIds( FolderStorage & );
00139
00142 KMMsgDictREntry *openFolderIds( const FolderStorage &, bool truncate);
00143
00144
00145
00146
00149 static void deleteRentry(KMMsgDictREntry *entry);
00150
00152 unsigned long getNextMsgSerNum();
00153
00154
00155 KMMsgDict();
00156 ~KMMsgDict();
00157
00159 unsigned long nextMsgSerNum;
00160
00162 KMDict *dict;
00163
00165 static KMMsgDict *m_self;
00166 };
00167
00168 #endif
|