summaryrefslogtreecommitdiffstats
path: root/kmail/kmfolderseldlg.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmail/kmfolderseldlg.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmfolderseldlg.h')
-rw-r--r--kmail/kmfolderseldlg.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/kmail/kmfolderseldlg.h b/kmail/kmfolderseldlg.h
new file mode 100644
index 000000000..3adef4159
--- /dev/null
+++ b/kmail/kmfolderseldlg.h
@@ -0,0 +1,119 @@
+/* KMail Folder Selection Dialog
+ * Pops up a small window with a list of folders and Ok/Cancel buttons.
+ * Author: Stefan Taferner <taferner@kde.org>
+ * Carsten Burghardt <burghardt@kde.org>
+ */
+#ifndef kmfolderseldlg_h
+#define kmfolderseldlg_h
+
+#include <kdialogbase.h>
+#include <kfoldertree.h>
+
+class KMFolder;
+class KMFolderTree;
+class KMMainWidget;
+
+namespace KMail {
+
+ class SimpleFolderTree : public KFolderTree
+ {
+ Q_OBJECT
+
+ public:
+ SimpleFolderTree( QWidget * parent, KMFolderTree * folderTree,
+ const QString & preSelection, bool mustBeReadWrite );
+
+ /** Reload the tree and select what folders to show and what not */
+ void reload( bool mustBeReadWrite, bool showOutbox, bool showImapFolders,
+ const QString& preSelection = QString::null );
+
+ /** Return the current folder */
+ const KMFolder * folder() const;
+
+ /** Set the current folder */
+ void setFolder( KMFolder* );
+ void setFolder( const QString& idString );
+
+ /** Apply the given filter. */
+ void applyFilter( const QString& filter );
+
+ public slots:
+ void addChildFolder();
+
+ protected slots:
+ void slotContextMenuRequested( QListViewItem *, const QPoint & );
+ virtual void recolorRows();
+
+ protected:
+ /** Read color options and set palette. */
+ virtual void readColorConfig(void);
+ virtual void keyPressEvent( QKeyEvent *e );
+
+ /** Folder and path column IDs. */
+ friend class KMFolderSelDlg;
+ int mFolderColumn;
+ int mPathColumn;
+
+ private:
+ KMFolderTree* mFolderTree;
+ QString mFilter;
+ bool mLastMustBeReadWrite;
+ bool mLastShowOutbox;
+ bool mLastShowImapFolders;
+};
+
+ //-----------------------------------------------------------------------------
+ class KMFolderSelDlg: public KDialogBase
+ {
+ Q_OBJECT
+
+ public:
+ /**
+ * Constructor with KMMainWidget
+ * @p parent @em must be a KMMainWin, because we
+ * need its foldertree.
+ * @param mustBeReadWrite if true, readonly folders are disabled
+ * @param useGlobalSettings if true, the current folder is read and
+ * written to GlobalSettings
+ */
+ KMFolderSelDlg( KMMainWidget * parent, const QString& caption,
+ bool mustBeReadWrite, bool useGlobalSettings = true );
+ /**
+ * Constructor with separate KMFolderTree
+ * @param mustBeReadWrite if true, readonly folders are disabled
+ * @param useGlobalSettings if true, the current folder is read and
+ * written to GlobalSettings
+ */
+ KMFolderSelDlg( QWidget * parent, KMFolderTree * tree,
+ const QString& caption, bool mustBeReadWrite,
+ bool useGlobalSettings = true );
+
+ virtual ~KMFolderSelDlg();
+
+ /** Returns selected folder */
+ virtual KMFolder* folder( void );
+
+ /** Set selected folder */
+ void setFolder( KMFolder* folder );
+
+ /** Set some flags what folders to show and what not */
+ void setFlags( bool mustBeReadWrite, bool showOutbox, bool showImapFolders );
+
+ protected slots:
+ void slotSelect();
+ void slotUser1();
+ void slotUpdateBtnStatus();
+
+ protected:
+ void readConfig();
+ void writeConfig();
+ /** Init the dialog */
+ void init();
+
+ SimpleFolderTree * mTreeView;
+ bool mUseGlobalSettings;
+ };
+
+} // namespace KMail
+
+#endif /*kmfolderseldlg_h*/