kmail

kmfolderdir.h
1 #ifndef kmfolderdir_h
2 #define kmfolderdir_h
3 
4 #include <tqstring.h>
5 #include "kmfoldernode.h"
6 #include "kmfoldertype.h"
7 
8 class KMFolder;
9 class KMFolderMgr;
10 
11 
15 class KMFolderDir: public KMFolderNode, public KMFolderNodeList
16 {
17  TQ_OBJECT
18 
19 
20 public:
21  KMFolderDir( KMFolder * owner, KMFolderDir * parent = 0,
22  const TQString& path = TQString(),
23  KMFolderDirType = KMStandardDir );
24  virtual ~KMFolderDir();
25 
26  virtual bool isDir() const { return true; }
27 
31  void addDirToParent( const TQString &dirName, KMFolder *parentFolder );
32 
34  virtual bool reload();
35 
37  virtual TQString path() const;
38 
40  TQString label() const;
41 
43  virtual TQString prettyURL() const;
44 
48  virtual KMFolder* createFolder( const TQString& folderName,
49  bool sysFldr=false,
50  KMFolderType folderType=KMFolderTypeMbox );
51 
53  virtual KMFolderNode* hasNamedFolder(const TQString& name);
54 
56  virtual KMFolderMgr* manager() const;
57 
59  KMFolder* owner() const { return mOwner; }
60 
61  virtual KMFolderDirType type() const { return mDirType; }
62 
63 protected:
64  KMFolder * mOwner;
65  KMFolderDirType mDirType;
66 };
67 
68 
69 //-----------------------------------------------------------------------------
70 
71 class KMFolderRootDir: public KMFolderDir
72 {
73  TQ_OBJECT
74 
75 
76 public:
77  KMFolderRootDir( KMFolderMgr* manager,
78  const TQString& path=TQString(),
79  KMFolderDirType dirType = KMStandardDir );
80  virtual ~KMFolderRootDir();
81  virtual TQString path() const;
82 
84  virtual void setPath(const TQString&);
85 
86  virtual TQString prettyURL() const;
87 
88  void setBaseURL( const TQCString& baseURL );
89 
90  virtual KMFolderMgr* manager() const;
91 
92 protected:
93  TQString mPath;
94  KMFolderMgr *mManager;
95  TQCString mBaseURL;
96 };
97 
98 #endif /*kmfolderdir_h*/
99 
KMail list that manages the contents of one directory that may contain folders and/or other directori...
Definition: kmfolderdir.h:16
virtual KMFolder * createFolder(const TQString &folderName, bool sysFldr=false, KMFolderType folderType=KMFolderTypeMbox)
Create a mail folder in this directory with given name.
Definition: kmfolderdir.cpp:95
virtual TQString path() const
Return full pathname of this directory.
void addDirToParent(const TQString &dirName, KMFolder *parentFolder)
Adds the given subdirectory of this directory to the associated folder.
virtual bool reload()
Read contents of directory.
virtual TQString prettyURL() const
URL of the node for visualization purposes.
virtual KMFolderNode * hasNamedFolder(const TQString &name)
Returns folder with given name or zero if it does not exist.
KMFolder * owner() const
Returns the folder whose children we are holding.
Definition: kmfolderdir.h:59
TQString label() const
Returns the label of the folder for visualization.
virtual KMFolderMgr * manager() const
Returns the folder manager that manages this folder.
Mail folder.
Definition: kmfolder.h:69