• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • configuredialog
configureappearancepage.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013-2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 #ifndef CONFIGUREAPPEARANCEPAGE_H
18 #define CONFIGUREAPPEARANCEPAGE_H
19 
20 #include "kmail_export.h"
21 #include "configuredialog_p.h"
22 #include "tag.h"
23 #include <QListWidgetItem>
24 
25 class QPushButton;
26 class QCheckBox;
27 class KComboBox;
28 class KFontChooser;
29 class ColorListBox;
30 class QButtonGroup;
31 class QGroupBox;
32 class QSpinBox;
33 class KButtonGroup;
34 class KLineEdit;
35 class QModelIndex;
36 namespace MessageViewer {
37 class ConfigureWidget;
38 class GravatarConfigWidget;
39 }
40 
41 namespace MessageList {
42 namespace Utils {
43 class AggregationComboBox;
44 class ThemeComboBox;
45 }
46 }
47 
48 namespace MailCommon {
49 class Tag;
50 typedef QSharedPointer<Tag> TagPtr;
51 }
52 
53 namespace MailCommon {
54 class TagWidget;
55 }
56 
57 class AppearancePageFontsTab : public ConfigModuleTab {
58  Q_OBJECT
59 public:
60  explicit AppearancePageFontsTab( QWidget * parent=0 );
61  QString helpAnchor() const;
62  void save();
63 
64 private slots:
65  void slotFontSelectorChanged( int );
66 
67 private:
68  //virtual void doLoadFromGlobalSettings();
69  void doLoadOther();
70  void updateFontSelector();
71  void doResetToDefaultsOther();
72 
73 private:
74  QCheckBox *mCustomFontCheck;
75  KComboBox *mFontLocationCombo;
76  KFontChooser *mFontChooser;
77 
78  int mActiveFontIndex;
79  QFont mFont[12];
80 };
81 
82 class AppearancePageColorsTab : public ConfigModuleTab {
83  Q_OBJECT
84 public:
85  explicit AppearancePageColorsTab( QWidget * parent=0 );
86  QString helpAnchor() const;
87  void save();
88 
89 private:
90  //virtual void doLoadFromGlobalSettings();
91  void doLoadOther();
92  void doResetToDefaultsOther();
93  void loadColor( bool loadFromConfig );
94 
95 private:
96  QCheckBox *mCustomColorCheck;
97  ColorListBox *mColorList;
98  QCheckBox *mRecycleColorCheck;
99  QSpinBox *mCloseToQuotaThreshold;
100 };
101 
102 class AppearancePageLayoutTab : public ConfigModuleTab {
103  Q_OBJECT
104 public:
105  explicit AppearancePageLayoutTab( QWidget * parent=0 );
106  QString helpAnchor() const;
107 
108  void save();
109 
110 private:
111  //virtual void doLoadFromGlobalSettings();
112  void doLoadOther();
113  //FIXME virtual void doResetToDefaultsOther();
114 
115 private: // data
116  QButtonGroup *mFolderListGroup;
117  QGroupBox *mFolderListGroupBox;
118  QButtonGroup *mReaderWindowModeGroup;
119  QGroupBox *mReaderWindowModeGroupBox;
120  QCheckBox *mFolderQuickSearchCB;
121  QButtonGroup *mFolderToolTipsGroup;
122  QGroupBox *mFolderToolTipsGroupBox;
123  QButtonGroup *mFavoriteFoldersViewGroup;
124  QGroupBox *mFavoriteFoldersViewGroupBox;
125 };
126 
127 class AppearancePageHeadersTab : public ConfigModuleTab {
128  Q_OBJECT
129 public:
130  explicit AppearancePageHeadersTab( QWidget * parent=0 );
131 
132  QString helpAnchor() const;
133 
134  void save();
135 
136 private: // methods
137  void doLoadFromGlobalSettings();
138  void doLoadOther();
139  // virtual void doResetToDefaultsOther();
140  void setDateDisplay( int id, const QString & format );
141 
142 private: // data
143  QCheckBox *mDisplayMessageToolTips;
144  QCheckBox *mHideTabBarWithSingleTab;
145  QCheckBox *mTabsHaveCloseButton;
146  MessageList::Utils::AggregationComboBox *mAggregationComboBox;
147  MessageList::Utils::ThemeComboBox *mThemeComboBox;
148  KButtonGroup *mDateDisplay;
149  KLineEdit *mCustomDateFormatEdit;
150  QString mCustomDateWhatsThis;
151 
152 private slots:
153  void slotLinkClicked( const QString & link );
154  void slotSelectDefaultAggregation();
155  void slotSelectDefaultTheme();
156 };
157 
158 class AppearancePageReaderTab : public ConfigModuleTab {
159  Q_OBJECT
160 public:
161  explicit AppearancePageReaderTab( QWidget * parent=0 );
162 
163  QString helpAnchor() const;
164 
165  void save();
166 
167 private:
168  void doLoadOther();
169  void doResetToDefaultsOther();
170 
171 private: // data
172  QCheckBox *mCloseAfterReplyOrForwardCheck;
173  MessageViewer::ConfigureWidget *mViewerSettings;
174  MessageViewer::GravatarConfigWidget *mGravatarConfigWidget;
175 };
176 
177 
178 class AppearancePageSystemTrayTab : public ConfigModuleTab {
179  Q_OBJECT
180 public:
181  explicit AppearancePageSystemTrayTab( QWidget * parent=0 );
182 
183  QString helpAnchor() const;
184 
185  void save();
186 
187 private:
188  void doLoadFromGlobalSettings();
189 
190 private: // data
191  QCheckBox *mSystemTrayCheck;
192  QCheckBox *mSystemTrayShowUnreadMail;
193  KButtonGroup *mSystemTrayGroup;
194 };
195 
196 
197 class TagListWidgetItem : public QListWidgetItem
198 {
199 public:
200  explicit TagListWidgetItem( QListWidget *parent = 0);
201  explicit TagListWidgetItem( const QIcon & icon, const QString & text, QListWidget * parent = 0);
202 
203  ~TagListWidgetItem();
204  void setKMailTag( const MailCommon::Tag::Ptr& tag );
205  MailCommon::Tag::Ptr kmailTag() const;
206 private:
207  MailCommon::Tag::Ptr mTag;
208 };
209 
212 class AppearancePageMessageTagTab : public ConfigModuleTab {
213  Q_OBJECT
214 public:
215  explicit AppearancePageMessageTagTab( QWidget * parent=0);
216  ~AppearancePageMessageTagTab();
217 
218  QString helpAnchor() const;
219 
220  void save();
221 
222 public slots:
227  void slotAddLineTextChanged( const QString &aText );
231  void slotAddNewTag();
233  void slotRemoveTag();
236  void slotMoveTagUp();
239  void slotMoveTagDown();
240 
241 private slots:
242  /*Handles necessary processing when the selection in the edit box changes.
243  Records the unselected tag's information, and applies visual changes
244  necessary depending on the description of the new tag. Private since doesn't
245  change the selection of the edit box itself*/
246  void slotSelectionChanged();
247  /*This slot is necessary so that apply button is not activated when we are
248  only applying visual changes after selecting a new tag in the list box*/
249  void slotEmitChangeCheck();
250  /*Transfers the tag settings from the widgets to the internal data structures.
251  Private since passing a wrong parameter modifies another tag's data*/
252  void slotRecordTagSettings( int aIndex );
253  /*Transfers the tag settings from the internal data structures to the widgets.
254  Private since passing a wrong parameter visualizes another tag's data*/
255  void slotUpdateTagSettingWidgets( int aIndex );
256  /*Transfers changes in the tag name edit box to the list box for tags. Private
257  since calling externally decouples the name in the list box from name edit box*/
258  void slotNameLineTextChanged( const QString & );
259  void slotIconNameChanged( const QString &iconName );
260  void slotRowsMoved( const QModelIndex &,
261  int sourcestart, int sourceEnd,
262  const QModelIndex &, int destinationRow );
263  void slotTagsFetched(KJob *job);
264 
265  void slotDeleteTagJob(KJob *job);
266 private:
267  void doLoadFromGlobalSettings();
268  void swapTagsInListBox( const int first, const int second );
269  void updateButtons();
270 
271 private: // data
272 
273  KLineEdit *mTagAddLineEdit;
274  QPushButton *mTagAddButton, *mTagRemoveButton,
275  *mTagUpButton, *mTagDownButton;
276 
277  QListWidget *mTagListBox;
278 
279  QGroupBox *mTagsGroupBox, *mTagSettingGroupBox;
280 
281  MailCommon::TagWidget *mTagWidget;
282 
283  // So we can compare to mMsgTagList and see if the user changed tags
284  QList<MailCommon::TagPtr> mOriginalMsgTagList;
285 
286  /*Used to safely call slotRecordTagSettings when the selection in
287  list box changes*/
288  int mPreviousTag;
289 };
290 
291 class KMAIL_EXPORT AppearancePage : public ConfigModuleWithTabs {
292  Q_OBJECT
293 public:
294  explicit AppearancePage( const KComponentData &instance, QWidget *parent=0 );
295 
296  QString helpAnchor() const;
297 
298  // hrmpf. moc doesn't like nested classes with slots/signals...:
299  typedef AppearancePageFontsTab FontsTab;
300  typedef AppearancePageColorsTab ColorsTab;
301  typedef AppearancePageLayoutTab LayoutTab;
302  typedef AppearancePageHeadersTab HeadersTab;
303  typedef AppearancePageReaderTab ReaderTab;
304  typedef AppearancePageSystemTrayTab SystemTrayTab;
305  typedef AppearancePageMessageTagTab MessageTagTab;
306 
307 private:
308  FontsTab *mFontsTab;
309  ColorsTab *mColorsTab;
310  LayoutTab *mLayoutTab;
311  HeadersTab *mHeadersTab;
312  ReaderTab *mReaderTab;
313  SystemTrayTab *mSystemTrayTab;
314  MessageTagTab *mMessageTagTab;
315 };
316 
317 
318 
319 #endif // CONFIGUREAPPEARANCEPAGE_H
AppearancePageMessageTagTab::slotRemoveTag
void slotRemoveTag()
Removes the currently selected text in the list box.
Definition: configureappearancepage.cpp:1294
QModelIndex
AppearancePageLayoutTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:518
AppearancePage::LayoutTab
AppearancePageLayoutTab LayoutTab
Definition: configureappearancepage.h:301
QWidget
ConfigModule::helpAnchor
virtual QString helpAnchor() const =0
Should return the help anchor for this page or tab.
AppearancePage::ColorsTab
AppearancePageColorsTab ColorsTab
Definition: configureappearancepage.h:300
AppearancePageMessageTagTab::~AppearancePageMessageTagTab
~AppearancePageMessageTagTab()
Definition: configureappearancepage.cpp:1158
ConfigModuleTab
Definition: configuredialog_p.h:19
kmail_export.h
AppearancePageHeadersTab::AppearancePageHeadersTab
AppearancePageHeadersTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:640
AppearancePageHeadersTab
Definition: configureappearancepage.h:127
TagListWidgetItem::setKMailTag
void setKMailTag(const MailCommon::Tag::Ptr &tag)
Definition: configureappearancepage.cpp:1029
AppearancePage::ReaderTab
AppearancePageReaderTab ReaderTab
Definition: configureappearancepage.h:303
QFont
AppearancePageMessageTagTab::slotAddLineTextChanged
void slotAddLineTextChanged(const QString &aText)
Enables/disables Add button according to whether aText is empty.
Definition: configureappearancepage.cpp:1369
AppearancePage::FontsTab
AppearancePageFontsTab FontsTab
Definition: configureappearancepage.h:299
QListWidgetItem
AppearancePage
Definition: configureappearancepage.h:291
AppearancePageReaderTab::save
void save()
Definition: configureappearancepage.cpp:941
AppearancePageReaderTab::AppearancePageReaderTab
AppearancePageReaderTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:901
TagListWidgetItem::kmailTag
MailCommon::Tag::Ptr kmailTag() const
Definition: configureappearancepage.cpp:1034
AppearancePageSystemTrayTab
Definition: configureappearancepage.h:178
QListWidget
TagListWidgetItem::~TagListWidgetItem
~TagListWidgetItem()
Definition: configureappearancepage.cpp:1025
AppearancePageHeadersTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:623
QButtonGroup
AppearancePageMessageTagTab
Configuration tab in the appearance page for modifying the available set of +message tags...
Definition: configureappearancepage.h:212
TagListWidgetItem::TagListWidgetItem
TagListWidgetItem(QListWidget *parent=0)
Definition: configureappearancepage.cpp:1015
MailCommon::TagPtr
QSharedPointer< Tag > TagPtr
Definition: configureappearancepage.h:49
QGroupBox
QSharedPointer
Definition: collectionmailinglistpage.h:34
AppearancePageHeadersTab::save
void save()
Definition: configureappearancepage.cpp:869
QCheckBox
AppearancePageLayoutTab
Definition: configureappearancepage.h:102
TagListWidgetItem
Definition: configureappearancepage.h:197
AppearancePageMessageTagTab::slotMoveTagUp
void slotMoveTagUp()
Increases the currently selected tag's priority and handles related visual changes.
Definition: configureappearancepage.cpp:1191
AppearancePageSystemTrayTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:948
configuredialog_p.h
AppearancePageLayoutTab::AppearancePageLayoutTab
AppearancePageLayoutTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:523
AppearancePageColorsTab::save
void save()
Definition: configureappearancepage.cpp:481
AppearancePageReaderTab
Definition: configureappearancepage.h:158
QString
QList< MailCommon::TagPtr >
AppearancePageColorsTab::AppearancePageColorsTab
AppearancePageColorsTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:355
AppearancePage::HeadersTab
AppearancePageHeadersTab HeadersTab
Definition: configureappearancepage.h:302
AppearancePageMessageTagTab::slotAddNewTag
void slotAddNewTag()
Creates a generic tag with the visible name from the line edit widget for adding tags.
Definition: configureappearancepage.cpp:1374
AppearancePage::MessageTagTab
AppearancePageMessageTagTab MessageTagTab
Definition: configureappearancepage.h:305
QSpinBox
AppearancePageColorsTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:321
AppearancePageFontsTab
Definition: configureappearancepage.h:57
KMAIL_EXPORT
#define KMAIL_EXPORT
Definition: kmail_export.h:35
KLineEdit
AppearancePageMessageTagTab::AppearancePageMessageTagTab
AppearancePageMessageTagTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:1040
QListWidgetItem::icon
QIcon icon() const
KComboBox
AppearancePageColorsTab
Definition: configureappearancepage.h:82
QPushButton
AppearancePageFontsTab::save
void save()
Definition: configureappearancepage.cpp:281
ConfigModuleWithTabs
Definition: configuredialog_p.h:54
AppearancePageFontsTab::AppearancePageFontsTab
AppearancePageFontsTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:158
AppearancePageMessageTagTab::slotMoveTagDown
void slotMoveTagDown()
Decreases the currently selected tag's priority and handles related visual changes.
Definition: configureappearancepage.cpp:1200
ColorListBox
Definition: colorlistbox.h:33
AppearancePageSystemTrayTab::AppearancePageSystemTrayTab
AppearancePageSystemTrayTab(QWidget *parent=0)
Definition: configureappearancepage.cpp:953
AppearancePage::SystemTrayTab
AppearancePageSystemTrayTab SystemTrayTab
Definition: configureappearancepage.h:304
QObject::parent
QObject * parent() const
AppearancePageFontsTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:132
AppearancePageMessageTagTab::save
void save()
Definition: configureappearancepage.cpp:1449
AppearancePageLayoutTab::save
void save()
Definition: configureappearancepage.cpp:610
KJob
AppearancePageMessageTagTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:1009
AppearancePageReaderTab::helpAnchor
QString helpAnchor() const
Definition: configureappearancepage.cpp:896
QListWidgetItem::text
QString text() const
AppearancePageSystemTrayTab::save
void save()
Definition: configureappearancepage.cpp:1001
QIcon
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal