kmail
kmfoldermgr.hGo to the documentation of this file.00001
00002
00003
00004 #ifndef kmfoldermgr_h
00005 #define kmfoldermgr_h
00006
00007 #include <qstring.h>
00008 #include <qvaluelist.h>
00009 #include <qobject.h>
00010 #include <qguardedptr.h>
00011
00012 #include "kmfolderdir.h"
00013
00014 class KMFolder;
00015
00016 class KMFolderMgr: public QObject
00017 {
00018 Q_OBJECT
00019
00020 public:
00021 KMFolderMgr(const QString& basePath, KMFolderDirType dirType = KMStandardDir);
00022 virtual ~KMFolderMgr();
00023
00025 QString basePath() const { return mBasePath; }
00026
00028 virtual void setBasePath(const QString&);
00029
00031 KMFolderRootDir& dir();
00032
00035 virtual KMFolder* find(const QString& folderName, bool foldersOnly=TRUE);
00036
00038 virtual KMFolder* findIdString(const QString& folderId,
00039 const uint id = 0, KMFolderDir *dir = 0);
00040
00045 virtual KMFolder* findOrCreate(const QString& folderName, bool sysFldr=TRUE,
00046 const uint id = 0);
00047
00050 virtual KMFolder* findById(const uint id);
00051
00052 virtual void getFolderURLS( QStringList& flist,
00053 const QString& prefix=QString::null,
00054 KMFolderDir *adir=0 );
00055 virtual KMFolder* getFolderByURL( const QString& vpath,
00056 const QString& prefix=QString::null,
00057 KMFolderDir *adir=0 );
00058
00061 virtual KMFolder* createFolder(const QString& fName, bool sysFldr=FALSE,
00062 KMFolderType aFolderType=KMFolderTypeMbox,
00063 KMFolderDir *aFolderDir = 0);
00064
00066 virtual void remove(KMFolder* obsoleteFolder);
00067
00069 virtual void contentsChanged(void);
00070
00072 virtual void reload(void);
00073
00076 virtual void createFolderList( QStringList *str,
00077 QValueList<QGuardedPtr<KMFolder> > *folders );
00078
00081 virtual void createFolderList( QStringList *str,
00082 QValueList<QGuardedPtr<KMFolder> > *folders,
00083 KMFolderDir *adir,
00084 const QString& prefix,
00085 bool i18nized=FALSE );
00086
00089 virtual void createI18nFolderList( QStringList *str,
00090 QValueList<QGuardedPtr<KMFolder> > *folders );
00091
00093 void syncAllFolders( KMFolderDir *adir = 0 );
00094
00096 void compactAllFolders( bool immediate, KMFolderDir *adir = 0 );
00097
00099 void expireAllFolders( bool immediate, KMFolderDir *adir = 0 );
00100
00102 void quiet(bool);
00103
00105 int folderCount(KMFolderDir *dir=0);
00106
00109 void tryReleasingFolder(KMFolder* folder, KMFolderDir *Dir=0);
00110
00112 uint createId();
00113
00115 void moveFolder( KMFolder* folder, KMFolderDir* newParent );
00116
00118 void renameFolder( KMFolder* folder, const QString& newName,
00119 KMFolderDir* newParent = 0 );
00120
00122 void copyFolder( KMFolder* folder, KMFolderDir* newParent );
00123
00125 KMFolder* parentFolder( KMFolder* folder );
00126
00127 public slots:
00129 void compactAll() { compactAllFolders( true ); }
00130
00132 void expireAll();
00133
00135 void removeFolderAux(KMFolder* obsoleteFolder, bool success);
00136
00138 void slotRenameDone( QString newName, bool success );
00139
00140 signals:
00145 void changed();
00146
00148 void folderRemoved(KMFolder*);
00149
00151 void folderAdded(KMFolder*);
00152
00154 void folderInvalidated(KMFolder*);
00155
00157 void msgAdded(KMFolder*, Q_UINT32);
00158
00160 void msgRemoved(KMFolder*, Q_UINT32);
00161
00163 void msgChanged(KMFolder*, Q_UINT32, int delta);
00164
00166 void msgHeaderChanged(KMFolder*, int idx);
00167
00169 void folderMoveOrCopyOperationFinished();
00170
00171 protected:
00172
00174 void removeFolder(KMFolder* aFolder);
00175
00177 void removeDirAux(KMFolderDir* aFolderDir);
00178
00179 QString mBasePath;
00180 KMFolderRootDir mDir;
00181 int mQuiet;
00182 bool mChanged;
00183 KMFolder* mRemoveOrig;
00184 };
00185
00186 #endif
|