2 * kmail: KDE mail client
3 * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef kmfoldernode_h
21 #define kmfoldernode_h
29 class KMFolderNode
: public QObject
34 KMFolderNode( KMFolderDir
* parent
, const QString
& name
);
35 virtual ~KMFolderNode();
37 /** Is it a directory where mail folders are stored or is it a folder that
39 Note that there are some kinds of mail folders like the type mh uses that
40 are directories on disk but are handled as folders here. */
41 virtual bool isDir(void) const;
42 virtual void setDir(bool aDir
) { mDir
= aDir
; }
44 /** Returns ptr to owning directory object or 0 if none. This
45 is just a wrapper for convenient access. */
46 KMFolderDir
* parent(void) const ;
47 void setParent( KMFolderDir
* aParent
);
48 // { return (KMFolderDir*)KMFolderNodeInherited::parent(); }
50 /** Returns full path to the directory where this node is stored or 0
51 if the node has no parent. Example: if this object represents a folder
52 ~joe/Mail/inbox then path() returns "/home/joe/Mail" and name() returns
54 virtual QString
path() const;
56 /** Name of the node. Also used as file name. */
57 QString
name() const { return mName
; }
58 void setName(const QString
& aName
) { mName
= aName
; }
60 /** Label of the node for visualzation purposes. Default the same as
62 virtual QString
label() const;
64 /** URL of the node for visualization purposes. */
65 virtual QString
prettyUrl() const = 0;
69 void setId( uint id
) { mId
= id
; }
78 typedef QList
<KMFolderNode
*> KMFolderNodeList
;
79 typedef QListIterator
<KMFolderNode
*> KMFolderNodeListIterator
;
82 #endif /*kmfoldernode_h*/