• 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
alarmtimewidget.h
Go to the documentation of this file.
1 /*
2  * alarmtimewidget.h - alarm date/time entry widget
3  * Program: kalarm
4  * Copyright © 2001-2011 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 ALARMTIMEWIDGET_H
22 #define ALARMTIMEWIDGET_H
23 
24 #include <kalarmcal/datetime.h>
25 #include <QFrame>
26 
27 class QAbstractButton;
28 class KDateComboBox;
29 class KHBox;
30 class ButtonGroup;
31 class RadioButton;
32 class CheckBox;
33 class PushButton;
34 class TimeEdit;
35 class TimeSpinBox;
36 class TimeZoneCombo;
37 
38 using namespace KAlarmCal;
39 
40 
41 class AlarmTimeWidget : public QFrame
42 {
43  Q_OBJECT
44  public:
45  enum Mode { // 'mode' values for constructor
46  AT_TIME = 0x01, // "At ..."
47  DEFER_TIME = 0x02, // "Defer to ..."
48  DEFER_ANY_TIME = DEFER_TIME | 0x04 // "Defer to ..." with 'any time' option
49  };
50  AlarmTimeWidget(const QString& groupBoxTitle, Mode, QWidget* parent = 0);
51  explicit AlarmTimeWidget(Mode, QWidget* parent = 0);
52  KDateTime getDateTime(int* minsFromNow = 0, bool checkExpired = true, bool showErrorMessage = true, QWidget** errorWidget = 0) const;
53  void setDateTime(const DateTime&);
54  void setMinDateTimeIsCurrent();
55  void setMinDateTime(const KDateTime& = KDateTime());
56  void setMaxDateTime(const DateTime& = DateTime());
57  const KDateTime& maxDateTime() const { return mMaxDateTime; }
58  KDateTime::Spec timeSpec() const { return mTimeSpec; }
59  void setReadOnly(bool);
60  bool anyTime() const { return mAnyTime; }
61  void enableAnyTime(bool enable);
62  void selectTimeFromNow(int minutes = 0);
63  void showMoreOptions(bool);
64  QSize sizeHint() const { return minimumSizeHint(); }
65 
66  static QString i18n_TimeAfterPeriod();
67  static const int maxDelayTime; // maximum time from now
68 
69  signals:
70  void changed(const KDateTime&);
71  void dateOnlyToggled(bool anyTime);
72  void pastMax();
73 
74  private slots:
75  void updateTimes();
76  void slotButtonSet(QAbstractButton*);
77  void dateTimeChanged();
78  void delayTimeChanged(int);
79  void slotAnyTimeToggled(bool);
80  void slotTimeZoneChanged();
81  void slotTimeZoneToggled(bool);
82  void showTimeZoneSelector();
83 
84  private:
85  void init(Mode, const QString& groupBoxTitle = QString());
86  void setAnyTime();
87  void setMaxDelayTime(const KDateTime& now);
88  void setMaxMinTimeIf(const KDateTime& now);
89 
90  ButtonGroup* mButtonGroup;
91  RadioButton* mAtTimeRadio;
92  RadioButton* mAfterTimeRadio;
93  CheckBox* mAnyTimeCheckBox;
94  KDateComboBox* mDateEdit;
95  TimeEdit* mTimeEdit;
96  TimeSpinBox* mDelayTimeEdit;
97  PushButton* mTimeZoneButton;
98  KHBox* mTimeZoneBox; // contains label and time zone combo box
99  CheckBox* mNoTimeZone;
100  TimeZoneCombo* mTimeZone;
101  KDateTime mMinDateTime; // earliest allowed date/time
102  KDateTime mMaxDateTime; // latest allowed date/time
103  KDateTime::Spec mTimeSpec; // time spec used
104  int mAnyTime; // 0 = date/time is specified, 1 = only a date, -1 = uninitialised
105  bool mAnyTimeAllowed; // 'mAnyTimeCheckBox' is enabled
106  bool mDeferring; // being used to enter a deferral time
107  bool mMinDateTimeIsNow; // earliest allowed date/time is the current time
108  bool mPastMax; // current time is past the maximum date/time
109  bool mMinMaxTimeSet; // limits have been set for the time edit control
110  bool mTimerSyncing; // mTimer is not yet synchronized to the minute boundary
111 };
112 
113 #endif // ALARMTIMEWIDGET_H
114 
115 // vim: et sw=4:
QWidget
AlarmTimeWidget::Mode
Mode
Definition: alarmtimewidget.h:45
TimeSpinBox
RadioButton
AlarmTimeWidget::maxDelayTime
static const int maxDelayTime
Definition: alarmtimewidget.h:67
AlarmTimeWidget
Definition: alarmtimewidget.h:41
PushButton
TimeZoneCombo
TimeEdit
CheckBox
QString
QSize
QFrame
AlarmTimeWidget::sizeHint
QSize sizeHint() const
Definition: alarmtimewidget.h:64
QAbstractButton
AlarmTimeWidget::timeSpec
KDateTime::Spec timeSpec() const
Definition: alarmtimewidget.h:58
KHBox
AlarmTimeWidget::anyTime
bool anyTime() const
Definition: alarmtimewidget.h:60
AlarmTimeWidget::maxDateTime
const KDateTime & maxDateTime() const
Definition: alarmtimewidget.h:57
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