~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to kmail/folderselectiondialog.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __FOLDERSELECTIONDIALOG_H__
2
 
#define __FOLDERSELECTIONDIALOG_H__
3
 
 
4
 
/******************************************************************************
5
 
 *
6
 
 * KMail Folder Selection Dialog
7
 
 *
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>
11
 
 *
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.
16
 
 *
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.
21
 
 *
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
 
 *****************************************************************************/
26
 
 
27
 
#include <kdialog.h>          // kdelibs
28
 
 
29
 
class KMFolder;
30
 
class KMMainWidget;
31
 
 
32
 
namespace KMail {
33
 
 
34
 
class FolderSelectionTreeWidget;
35
 
class MainFolderView;
36
 
 
37
 
 
38
 
/**
39
 
 * @brief A dialog used to select a mail folder
40
 
 */
41
 
class FolderSelectionDialog: public KDialog
42
 
{
43
 
  Q_OBJECT
44
 
 
45
 
public:
46
 
  /**
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
53
 
   */
54
 
  FolderSelectionDialog(
55
 
      KMMainWidget *parent,
56
 
      const QString& caption,
57
 
      bool mustBeReadWrite,
58
 
      bool useGlobalSettings = true
59
 
    );
60
 
 
61
 
  /**
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
66
 
   */
67
 
  FolderSelectionDialog(
68
 
      QWidget * parent,
69
 
      MainFolderView * tree,
70
 
      const QString& caption,
71
 
      bool mustBeReadWrite,
72
 
      bool useGlobalSettings = true
73
 
    );
74
 
 
75
 
  virtual ~FolderSelectionDialog();
76
 
 
77
 
public:
78
 
  /**
79
 
   * Returns the currently selected folder, or 0 if no folder is selected (yet)
80
 
   */
81
 
  KMFolder * folder() const;
82
 
 
83
 
  /**
84
 
   * Set the selected folder. Forwarded to FolderSelectionTreeWidget.
85
 
   */
86
 
  void setFolder( KMFolder *folder );
87
 
 
88
 
  /**
89
 
   * Set some flags what folders to show and what not.
90
 
   * Triggers a reload of the folders.
91
 
   */
92
 
  void setFlags( bool mustBeReadWrite, bool showOutbox, bool showImapFolders );
93
 
 
94
 
protected slots:
95
 
  /**
96
 
   * Called to select a folder and close the dialog
97
 
   */
98
 
  void slotSelect();
99
 
 
100
 
  /**
101
 
   * Called when selection in the tree view changes in order
102
 
   * to update the enabled/disabled state of the dialog buttons.
103
 
   */
104
 
  void slotUpdateBtnStatus( bool allowOk, bool allowCreate );
105
 
 
106
 
protected:
107
 
  /**
108
 
   * Read the global dialog configuration.
109
 
   */
110
 
  void readConfig();
111
 
 
112
 
  /**
113
 
   * Save the global dialog configuration.
114
 
   */
115
 
  void writeConfig();
116
 
  /**
117
 
   * Common initialization for all the constructors.
118
 
   */
119
 
  void init( MainFolderView *tree, bool mustBeReadWrite );
120
 
 
121
 
private:
122
 
  FolderSelectionTreeWidget * mTreeView;
123
 
  bool mUseGlobalSettings;
124
 
 
125
 
};
126
 
 
127
 
} // namespace KMail
128
 
 
129
 
#endif /*!__FOLDERSELECTIONDIALOG_H__*/