kmail
treebase.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KMAIL_TREEBASE_H
00021 #define KMAIL_TREEBASE_H
00022
00023 #include "kmfolder.h"
00024 #include "kmfoldertree.h"
00025
00026 #include <kdebug.h>
00027 #include <klistview.h>
00028
00029 namespace KMail {
00030
00031 class TreeItemBase;
00032
00033 class TreeBase : public KListView
00034 {
00035 Q_OBJECT
00036 public:
00037 TreeBase( QWidget * parent, KMFolderTree *folderTree,
00038 const QString &preSelection, bool mustBeReadWrite );
00039
00040 virtual ~TreeBase() {}
00041
00042 const KMFolder * folder() const;
00044 void setFolder( KMFolder *folder );
00045
00046 inline void setFolder( const QString& idString )
00047 {
00048 setFolder( kmkernel->findFolderById( idString ) );
00049 }
00050
00051 void reload( bool mustBeReadWrite, bool showOutbox, bool showImapFolders,
00052 const QString& preSelection = QString::null );
00053
00054 const int folderColumn() const { return mFolderColumn; }
00055 void setFolderColumn( const int folderCol ) { mFolderColumn = folderCol; }
00056 const int pathColumn() const { return mPathColumn; }
00057 void setPathColumn( const int pathCol ) { mPathColumn = pathCol; }
00058
00059 public slots:
00060 void addChildFolder();
00061 protected slots:
00062 void slotContextMenuRequested( QListViewItem *lvi,
00063 const QPoint &p );
00064 void recolorRows();
00065 protected:
00066 virtual QListViewItem* createItem( QListView* ) = 0;
00067 virtual QListViewItem* createItem( QListView*, QListViewItem* ) = 0;
00068 virtual QListViewItem* createItem( QListViewItem* ) = 0;
00069 virtual QListViewItem* createItem( QListViewItem*, QListViewItem* ) = 0;
00070
00071 protected:
00072 KMFolderTree* mFolderTree;
00073 QString mFilter;
00074 bool mLastMustBeReadWrite;
00075 bool mLastShowOutbox;
00076 bool mLastShowImapFolders;
00078 int mFolderColumn;
00079 int mPathColumn;
00080
00081 };
00082 }
00083 #endif
|