1
#ifndef __FOLDERSELECTIONDIALOG_H__
2
#define __FOLDERSELECTIONDIALOG_H__
4
/******************************************************************************
6
* KMail Folder Selection Dialog
8
* Copyright (c) 1997-1998 Stefan Taferner <taferner@kde.org>
9
* Copyright (c) 2004-2005 Carsten Burghardt <burghardt@kde.org>
10
* Copyright (c) 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
12
* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 2 of the License, or
15
* (at your option) any later version.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License along
23
* with this program; if not, write to the Free Software Foundation, Inc.,
24
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
*****************************************************************************/
27
#include <kdialog.h> // kdelibs
34
class FolderSelectionTreeWidget;
39
* @brief A dialog used to select a mail folder
41
class FolderSelectionDialog: public KDialog
47
* Constructor with KMMainWidget
48
* @p parent @em must be a KMMainWin, because we
49
* need its foldertree.
50
* @param mustBeReadWrite if true, readonly folders are disabled
51
* @param useGlobalSettings if true, the current folder is read and
52
* written to GlobalSettings
54
FolderSelectionDialog(
56
const QString& caption,
58
bool useGlobalSettings = true
62
* Constructor with separate KMFolderTree
63
* @param mustBeReadWrite if true, readonly folders are disabled
64
* @param useGlobalSettings if true, the current folder is read and
65
* written to GlobalSettings
67
FolderSelectionDialog(
69
MainFolderView * tree,
70
const QString& caption,
72
bool useGlobalSettings = true
75
virtual ~FolderSelectionDialog();
79
* Returns the currently selected folder, or 0 if no folder is selected (yet)
81
KMFolder * folder() const;
84
* Set the selected folder. Forwarded to FolderSelectionTreeWidget.
86
void setFolder( KMFolder *folder );
89
* Set some flags what folders to show and what not.
90
* Triggers a reload of the folders.
92
void setFlags( bool mustBeReadWrite, bool showOutbox, bool showImapFolders );
96
* Called to select a folder and close the dialog
101
* Called when selection in the tree view changes in order
102
* to update the enabled/disabled state of the dialog buttons.
104
void slotUpdateBtnStatus( bool allowOk, bool allowCreate );
108
* Read the global dialog configuration.
113
* Save the global dialog configuration.
117
* Common initialization for all the constructors.
119
void init( MainFolderView *tree, bool mustBeReadWrite );
122
FolderSelectionTreeWidget * mTreeView;
123
bool mUseGlobalSettings;
129
#endif /*!__FOLDERSELECTIONDIALOG_H__*/