kmail

kmfoldermgr.h
1 /* KMail Folder Manager
2  *
3  */
4 #ifndef kmfoldermgr_h
5 #define kmfoldermgr_h
6 
7 #include <tqstring.h>
8 #include <tqvaluelist.h>
9 #include <tqobject.h>
10 #include <tqguardedptr.h>
11 
12 #include "kmfolderdir.h"
13 
14 class KMFolder;
15 
16 class KMFolderMgr: public TQObject
17 {
18  TQ_OBJECT
19 
20 
21 public:
22  KMFolderMgr(const TQString& basePath, KMFolderDirType dirType = KMStandardDir);
23  virtual ~KMFolderMgr();
24 
26  TQString basePath() const { return mBasePath; }
27 
29  virtual void setBasePath(const TQString&);
30 
32  KMFolderRootDir& dir();
33 
36  virtual KMFolder* find(const TQString& folderName, bool foldersOnly=TRUE);
37 
39  virtual KMFolder* findIdString(const TQString& folderId,
40  const uint id = 0, KMFolderDir *dir = 0);
41 
46  virtual KMFolder* findOrCreate(const TQString& folderName, bool sysFldr=TRUE,
47  const uint id = 0);
48 
51  virtual KMFolder* findById(const uint id);
52 
53  virtual void getFolderURLS( TQStringList& flist,
54  const TQString& prefix=TQString(),
55  KMFolderDir *adir=0 );
56  virtual KMFolder* getFolderByURL( const TQString& vpath,
57  const TQString& prefix=TQString(),
58  KMFolderDir *adir=0 );
59 
62  virtual KMFolder* createFolder(const TQString& fName, bool sysFldr=FALSE,
63  KMFolderType aFolderType=KMFolderTypeMbox,
64  KMFolderDir *aFolderDir = 0);
65 
67  virtual void remove(KMFolder* obsoleteFolder);
68 
70  virtual void contentsChanged(void);
71 
73  virtual void reload(void);
74 
77  virtual void createFolderList( TQStringList *str,
78  TQValueList<TQGuardedPtr<KMFolder> > *folders );
79 
82  virtual void createFolderList( TQStringList *str,
83  TQValueList<TQGuardedPtr<KMFolder> > *folders,
84  KMFolderDir *adir,
85  const TQString& prefix,
86  bool i18nized=FALSE );
87 
90  virtual void createI18nFolderList( TQStringList *str,
91  TQValueList<TQGuardedPtr<KMFolder> > *folders );
92 
94  void syncAllFolders( KMFolderDir *adir = 0 );
95 
97  void compactAllFolders( bool immediate, KMFolderDir *adir = 0 );
98 
100  void expireAllFolders( bool immediate, KMFolderDir *adir = 0 );
101 
103  void quiet(bool);
104 
106  int folderCount(KMFolderDir *dir=0);
107 
110  void tryReleasingFolder(KMFolder* folder, KMFolderDir *Dir=0);
111 
113  uint createId();
114 
116  void moveFolder( KMFolder* folder, KMFolderDir* newParent );
117 
119  void renameFolder( KMFolder* folder, const TQString& newName,
120  KMFolderDir* newParent = 0 );
121 
123  void copyFolder( KMFolder* folder, KMFolderDir* newParent );
124 
126  KMFolder* parentFolder( KMFolder* folder );
127 
128 public slots:
130  void compactAll() { compactAllFolders( true ); }
131 
133  void expireAll();
134 
136  void removeFolderAux(KMFolder* obsoleteFolder, bool success);
137 
139  void slotRenameDone( TQString newName, bool success );
140 
141 signals:
146  void changed();
147 
149  void folderRemoved(KMFolder*);
150 
152  void folderAdded(KMFolder*);
153 
155  void folderInvalidated(KMFolder*);
156 
158  void msgAdded(KMFolder*, TQ_UINT32);
159 
161  void msgRemoved(KMFolder*, TQ_UINT32);
162 
164  void msgChanged(KMFolder*, TQ_UINT32, int delta);
165 
167  void msgHeaderChanged(KMFolder*, int idx);
168 
170  void folderMoveOrCopyOperationFinished();
171 
172 protected:
173 
175  void removeFolder(KMFolder* aFolder);
176 
178  void removeDirAux(KMFolderDir* aFolderDir);
179 
180  TQString mBasePath;
181  KMFolderRootDir mDir;
182  int mQuiet;
183  bool mChanged;
184  KMFolder* mRemoveOrig;
185 };
186 
187 #endif /*kmfoldermgr_h*/
KMail list that manages the contents of one directory that may contain folders and/or other directori...
Definition: kmfolderdir.h:16
Mail folder.
Definition: kmfolder.h:69