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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
prefdlg_p.h
Go to the documentation of this file.
1 /*
2  * prefdlg_p.h - private classes for program preferences dialog
3  * Program: kalarm
4  * Copyright © 2001-2012 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef PREFDLG_P_H
22 #define PREFDLG_P_H
23 
24 #include "preferences.h"
25 #include "prefdlg.h"
26 #include "stackedwidgets.h"
27 
28 class QCheckBox;
29 class QGroupBox;
30 class QAbstractButton;
31 class QRadioButton;
32 class QPushButton;
33 class QLabel;
34 class QSpinBox;
35 class KTimeZone;
36 class KLineEdit;
37 class KVBox;
38 class KComboBox;
39 class FontColourChooser;
40 class ColourButton;
41 class ButtonGroup;
42 class RadioButton;
43 class TimeEdit;
44 class TimePeriod;
45 class SpinBox;
46 class TimeSpinBox;
47 class SpecialActionsButton;
48 class TimeZoneCombo;
49 
50 
51 // Base class for each tab in the Preferences dialog
52 class PrefsTabBase : public StackedScrollWidget
53 {
54  Q_OBJECT
55  public:
56  explicit PrefsTabBase(StackedScrollGroup*);
57 
58  void setPreferences();
59  virtual void restore(bool defaults, bool allTabs) = 0;
60  virtual void apply(bool syncToDisc) = 0;
61  void addAlignedLabel(QLabel*);
62  KVBox* topWidget() const { return mTopWidget; }
63  QVBoxLayout* topLayout() const { return mTopLayout; }
64  static int indentWidth() { return mIndentWidth; }
65 
66  protected:
67  virtual void showEvent(QShowEvent*);
68 
69  private:
70  static int mIndentWidth; // indent width for checkboxes etc.
71  KVBox* mTopWidget;
72  QVBoxLayout* mTopLayout;
73  QList<QLabel*> mLabels; // labels to right-align
74  bool mLabelsAligned; // labels have been aligned
75 };
76 
77 
78 // Miscellaneous tab of the Preferences dialog
79 class MiscPrefTab : public PrefsTabBase
80 {
81  Q_OBJECT
82  public:
83  explicit MiscPrefTab(StackedScrollGroup*);
84 
85  virtual void restore(bool defaults, bool allTabs);
86  virtual void apply(bool syncToDisc);
87 
88  private slots:
89  void slotAutostartClicked();
90  void slotOtherTerminalToggled(bool);
91 
92  private:
93  void setTimeZone(const KTimeZone&);
94 
95  QCheckBox* mAutoStart;
96  QCheckBox* mQuitWarn;
97  QCheckBox* mConfirmAlarmDeletion;
98  TimeSpinBox* mDefaultDeferTime;
99  ButtonGroup* mXtermType;
100  KLineEdit* mXtermCommand;
101  int mXtermFirst; // id of first terminal window radio button
102  int mXtermCount; // number of terminal window types
103 };
104 
105 
106 // Date/time tab of the Preferences dialog
107 class TimePrefTab : public PrefsTabBase
108 {
109  Q_OBJECT
110  public:
111  explicit TimePrefTab(StackedScrollGroup*);
112 
113  virtual void restore(bool defaults, bool allTabs);
114  virtual void apply(bool syncToDisc);
115 
116  private:
117  void setWorkDays(const QBitArray& days);
118 
119  TimeZoneCombo* mTimeZone;
120  KComboBox* mHolidays;
121  QMap<QString, QString> mHolidayNames;
122  TimeEdit* mStartOfDay;
123  QCheckBox* mWorkDays[7];
124  TimeEdit* mWorkStart;
125  TimeEdit* mWorkEnd;
126  TimeSpinBox* mKOrgEventDuration;
127 };
128 
129 
130 // Storage tab of the Preferences dialog
131 class StorePrefTab : public PrefsTabBase
132 {
133  Q_OBJECT
134  public:
135  explicit StorePrefTab(StackedScrollGroup*);
136 
137  virtual void restore(bool defaults, bool allTabs);
138  virtual void apply(bool syncToDisc);
139 
140  private slots:
141  void slotArchivedToggled(bool);
142  void slotClearArchived();
143 
144  private:
145  void setArchivedControls(int purgeDays);
146 
147  QRadioButton* mDefaultResource;
148  QRadioButton* mAskResource;
149  QCheckBox* mKeepArchived;
150  QCheckBox* mPurgeArchived;
151  SpinBox* mPurgeAfter;
152  QLabel* mPurgeAfterLabel;
153  QPushButton* mClearArchived;
154  bool mOldKeepArchived; // previous setting of keep-archived
155  bool mCheckKeepChanges;
156 };
157 
158 
159 // Email tab of the Preferences dialog
160 class EmailPrefTab : public PrefsTabBase
161 {
162  Q_OBJECT
163  public:
164  explicit EmailPrefTab(StackedScrollGroup*);
165 
166  QString validate();
167  virtual void restore(bool defaults, bool allTabs);
168  virtual void apply(bool syncToDisc);
169 
170  private slots:
171  void slotEmailClientChanged(QAbstractButton*);
172  void slotFromAddrChanged(QAbstractButton*);
173  void slotBccAddrChanged(QAbstractButton*);
174  void slotAddressChanged() { mAddressChanged = true; }
175 
176  private:
177  void setEmailAddress(Preferences::MailFrom, const QString& address);
178  void setEmailBccAddress(bool useSystemSettings, const QString& address);
179  QString validateAddr(ButtonGroup*, KLineEdit* addr, const QString& msg);
180 
181  ButtonGroup* mEmailClient;
182  RadioButton* mKMailButton;
183  RadioButton* mSendmailButton;
184  ButtonGroup* mFromAddressGroup;
185  RadioButton* mFromAddrButton;
186  RadioButton* mFromCCentreButton;
187  RadioButton* mFromKMailButton;
188  KLineEdit* mEmailAddress;
189  ButtonGroup* mBccAddressGroup;
190  RadioButton* mBccAddrButton;
191  RadioButton* mBccCCentreButton;
192  KLineEdit* mEmailBccAddress;
193  QCheckBox* mEmailQueuedNotify;
194  QCheckBox* mEmailCopyToKMail;
195  bool mAddressChanged;
196  bool mBccAddressChanged;
197 };
198 
199 
200 // Edit defaults tab of the Preferences dialog
201 class EditPrefTab : public PrefsTabBase
202 {
203  Q_OBJECT
204  public:
205  explicit EditPrefTab(StackedScrollGroup*);
206 
207  QString validate();
208  virtual void restore(bool defaults, bool allTabs);
209  virtual void apply(bool syncToDisc);
210 
211  private slots:
212  void slotBrowseSoundFile();
213 
214  private:
215  KTabWidget* mTabs;
216  QCheckBox* mAutoClose;
217  QCheckBox* mConfirmAck;
218  KComboBox* mReminderUnits;
219  SpecialActionsButton* mSpecialActionsButton;
220  QCheckBox* mCmdScript;
221  QCheckBox* mCmdXterm;
222  QCheckBox* mEmailBcc;
223  KComboBox* mSound;
224  QLabel* mSoundFileLabel;
225  KLineEdit* mSoundFile;
226  QPushButton* mSoundFileBrowse;
227  QCheckBox* mSoundRepeat;
228  QCheckBox* mCopyToKOrganizer;
229  QCheckBox* mLateCancel;
230  KComboBox* mRecurPeriod;
231  ButtonGroup* mFeb29;
232  FontColourChooser* mFontChooser;
233  int mTabGeneral; // index of General tab
234  int mTabTypes; // index of Alarm Types tab
235  int mTabFontColour; // index of Font & Color tab
236 
237  static int soundIndex(Preferences::SoundType);
238 };
239 
240 
241 // View tab of the Preferences dialog
242 class ViewPrefTab : public PrefsTabBase
243 {
244  Q_OBJECT
245  public:
246  explicit ViewPrefTab(StackedScrollGroup*);
247 
248  virtual void restore(bool defaults, bool allTabs);
249  virtual void apply(bool syncToDisc);
250 
251  private slots:
252  void slotTooltipAlarmsToggled(bool);
253  void slotTooltipMaxToggled(bool);
254  void slotTooltipTimeToggled(bool);
255  void slotTooltipTimeToToggled(bool);
256  void slotAutoHideSysTrayChanged(QAbstractButton*);
257  void slotWindowPosChanged(QAbstractButton*);
258 
259  private:
260  void setTooltip(int maxAlarms, bool time, bool timeTo, const QString& prefix);
261 
262  KTabWidget* mTabs;
263  ColourButton* mDisabledColour;
264  ColourButton* mArchivedColour;
265  QGroupBox* mShowInSystemTray;
266  ButtonGroup* mAutoHideSystemTray;
267  TimePeriod* mAutoHideSystemTrayPeriod;
268  QCheckBox* mTooltipShowAlarms;
269  QCheckBox* mTooltipMaxAlarms;
270  SpinBox* mTooltipMaxAlarmCount;
271  QCheckBox* mTooltipShowTime;
272  QCheckBox* mTooltipShowTimeTo;
273  KLineEdit* mTooltipTimeToPrefix;
274  QLabel* mTooltipTimeToPrefixLabel;
275  ButtonGroup* mWindowPosition;
276  QSpinBox* mWindowButtonDelay;
277  QLabel* mWindowButtonDelayLabel;
278  QCheckBox* mModalMessages;
279  int mTabGeneral; // index of General tab
280  int mTabWindows; // index of Alarm Windows tab
281 };
282 
283 #endif // PREFDLG_P_H
284 
285 // vim: et sw=4:
PrefsTabBase::addAlignedLabel
void addAlignedLabel(QLabel *)
Definition: prefdlg.cpp:380
EmailPrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:1095
KVBox
FontColourChooser
Definition: fontcolour.h:33
Preferences::MailFrom
MailFrom
Definition: preferences.h:40
EditPrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:1405
TimeSpinBox
EditPrefTab
Definition: prefdlg_p.h:201
PrefsTabBase::topLayout
QVBoxLayout * topLayout() const
Definition: prefdlg_p.h:63
RadioButton
QMap< QString, QString >
EmailPrefTab::validate
QString validate()
Definition: prefdlg.cpp:1159
TimePrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:796
TimePrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:764
prefdlg.h
PrefsTabBase::indentWidth
static int indentWidth()
Definition: prefdlg_p.h:64
StackedScrollGroup
PrefsTabBase::topWidget
KVBox * topWidget() const
Definition: prefdlg_p.h:62
MiscPrefTab
Definition: prefdlg_p.h:79
PrefsTabBase::setPreferences
void setPreferences()
TimeZoneCombo
EditPrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:1462
TimeEdit
ViewPrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:1789
PrefsTabBase::PrefsTabBase
PrefsTabBase(StackedScrollGroup *)
Definition: prefdlg.cpp:355
StorePrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:902
PrefsTabBase::apply
virtual void apply(bool syncToDisc)=0
Definition: prefdlg.cpp:374
QGroupBox
QShowEvent
TimePeriod
EmailPrefTab::EmailPrefTab
EmailPrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:978
QCheckBox
ViewPrefTab::ViewPrefTab
ViewPrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:1593
MiscPrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:536
SpecialActionsButton
Definition: specialactions.h:36
QVBoxLayout
QString
QList< QLabel * >
QBitArray
PrefsTabBase
Definition: prefdlg_p.h:52
ColourButton
MiscPrefTab::MiscPrefTab
MiscPrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:415
MiscPrefTab::restore
virtual void restore(bool defaults, bool allTabs)
Definition: prefdlg.cpp:515
QSpinBox
TimePrefTab
Definition: prefdlg_p.h:107
PrefsTabBase::showEvent
virtual void showEvent(QShowEvent *)
Definition: prefdlg.cpp:385
SpinBox
preferences.h
StorePrefTab::StorePrefTab
StorePrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:835
StackedScrollWidget
StorePrefTab
Definition: prefdlg_p.h:131
QAbstractButton
KLineEdit
TimePrefTab::TimePrefTab
TimePrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:611
PrefsTabBase::restore
virtual void restore(bool defaults, bool allTabs)=0
QRadioButton
EditPrefTab::EditPrefTab
EditPrefTab(StackedScrollGroup *)
Definition: prefdlg.cpp:1204
ViewPrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:1832
KComboBox
StorePrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:916
QPushButton
ViewPrefTab
Definition: prefdlg_p.h:242
EditPrefTab::validate
QString validate()
Definition: prefdlg.cpp:1578
QLabel
stackedwidgets.h
EmailPrefTab
Definition: prefdlg_p.h:160
EmailPrefTab::apply
virtual void apply(bool syncToDisc)
Definition: prefdlg.cpp:1106
ButtonGroup
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • 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