fix errors found while translating
[kdepim.git] / kmail / kmfoldernode.h
blob341d63ca661aecc61fb8e75875971a6813603ac4
1 /*
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
23 #include <QList>
24 #include <QObject>
25 #include <QString>
27 class KMFolderDir;
29 class KMFolderNode: public QObject
31 Q_OBJECT
33 public:
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
38 contains mail ?
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
53 "inbox". */
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
61 the name. */
62 virtual QString label() const;
64 /** URL of the node for visualization purposes. */
65 virtual QString prettyUrl() const = 0;
67 /** ID of the node */
68 uint id() const;
69 void setId( uint id ) { mId = id; }
71 protected:
72 QString mName;
73 KMFolderDir *mParent;
74 bool mDir;
75 uint mId;
78 typedef QList<KMFolderNode*> KMFolderNodeList;
79 typedef QListIterator<KMFolderNode*> KMFolderNodeListIterator;
82 #endif /*kmfoldernode_h*/