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

kalarm

  • sources
  • kde-4.12
  • kdepim
  • kalarm
recurrenceedit.h
Go to the documentation of this file.
1 /*
2  * recurrenceedit.h - widget to edit the event's recurrence definition
3  * Program: kalarm
4  * Copyright © 2002-2011 by David Jarvie <djarvie@kde.org>
5  *
6  * Based originally on KOrganizer module koeditorrecurrence.h,
7  * Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef RECURRENCEEDIT_H
25 #define RECURRENCEEDIT_H
26 
27 #include <kalarmcal/repetition.h>
28 
29 #include <kdatetime.h>
30 
31 #include <QFrame>
32 
33 class KDateComboBox;
34 class QDate;
35 class QShowEvent;
36 class QStackedWidget;
37 class QGroupBox;
38 class QLabel;
39 class QListWidget;
40 class QAbstractButton;
41 class QPushButton;
42 class SpinBox;
43 class CheckBox;
44 class RadioButton;
45 class TimeEdit;
46 class ButtonGroup;
47 class RepetitionButton;
48 class Rule;
49 class NoRule;
50 class SubDailyRule;
51 class DailyRule;
52 class WeeklyRule;
53 class MonthlyRule;
54 class YearlyRule;
55 namespace KAlarmCal { class KAEvent; }
56 
57 using namespace KAlarmCal;
58 
59 class RecurrenceEdit : public QFrame
60 {
61  Q_OBJECT
62  public:
63  // Don't alter the order of these recurrence types
64  enum RepeatType { INVALID_RECUR = -1, NO_RECUR, AT_LOGIN, SUBDAILY, DAILY, WEEKLY, MONTHLY, ANNUAL };
65 
66  explicit RecurrenceEdit(bool readOnly, QWidget* parent = 0);
67  virtual ~RecurrenceEdit() { }
68 
70  void setDefaults(const KDateTime& from);
72  void set(const KAEvent&);
74  void setRepeatAtLogin();
76  void updateEvent(KAEvent&, bool adjustStart);
77  QWidget* checkData(const KDateTime& startDateTime, QString& errorMessage) const;
78  RepeatType repeatType() const { return mRuleButtonType; }
79  bool isTimedRepeatType() const { return mRuleButtonType >= SUBDAILY; }
80  Repetition subRepetition() const;
81  void setSubRepetition(int reminderMinutes, bool dateOnly);
82  void setStartDate(const QDate&, const QDate& today);
83  void setDefaultEndDate(const QDate&);
84  void setEndDateTime(const KDateTime&);
85  KDateTime endDateTime() const;
86  bool stateChanged() const;
87  void activateSubRepetition();
88  void showMoreOptions(bool);
89 
90  static QString i18n_combo_NoRecur(); // text of 'No recurrence' selection
91  static QString i18n_combo_AtLogin(); // text of 'At login' selection
92  static QString i18n_combo_HourlyMinutely(); // text of 'Hourly/Minutely'
93  static QString i18n_combo_Daily(); // text of 'Daily' selection
94  static QString i18n_combo_Weekly(); // text of 'Weekly' selection
95  static QString i18n_combo_Monthly(); // text of 'Monthly' selection
96  static QString i18n_combo_Yearly(); // text of 'Yearly' selection
97 
98  public slots:
99  void setDateTime(const KDateTime& start) { mCurrStartDateTime = start; }
100 
101  signals:
102  void shown();
103  void typeChanged(int recurType); // returns a RepeatType value
104  void frequencyChanged();
105  void repeatNeedsInitialisation();
106  void contentsChanged();
107 
108  protected:
109  virtual void showEvent(QShowEvent*);
110 
111  private slots:
112  void periodClicked(QAbstractButton*);
113  void rangeTypeClicked();
114  void repeatCountChanged(int value);
115  void slotAnyTimeToggled(bool);
116  void addException();
117  void changeException();
118  void deleteException();
119  void enableExceptionButtons();
120 
121  private:
122  void setRuleDefaults(const QDate& start);
123  void saveState();
124 
125  // Main rule box and choices
126  QStackedWidget* mRuleStack;
127  Rule* mRule; // current rule widget, or 0 if NoRule
128  NoRule* mNoRule;
129  SubDailyRule* mSubDailyRule;
130  DailyRule* mDailyRule;
131  WeeklyRule* mWeeklyRule;
132  MonthlyRule* mMonthlyRule;
133  YearlyRule* mYearlyRule;
134 
135  ButtonGroup* mRuleButtonGroup;
136  RadioButton* mNoneButton;
137  RadioButton* mAtLoginButton;
138  RadioButton* mSubDailyButton;
139  RadioButton* mDailyButton;
140  RadioButton* mWeeklyButton;
141  RadioButton* mMonthlyButton;
142  RadioButton* mYearlyButton;
143  RepeatType mRuleButtonType;
144  bool mDailyShown; // daily rule has been displayed at some time or other
145  bool mWeeklyShown; // weekly rule has been displayed at some time or other
146  bool mMonthlyShown; // monthly rule has been displayed at some time or other
147  bool mYearlyShown; // yearly rule has been displayed at some time or other
148 
149  // Range
150  QGroupBox* mRangeButtonBox;
151  ButtonGroup* mRangeButtonGroup;
152  RadioButton* mNoEndDateButton;
153  RadioButton* mRepeatCountButton;
154  SpinBox* mRepeatCountEntry;
155  QLabel* mRepeatCountLabel;
156  RadioButton* mEndDateButton;
157  KDateComboBox* mEndDateEdit;
158  TimeEdit* mEndTimeEdit;
159  CheckBox* mEndAnyTimeCheckBox;
160 
161  // Exceptions
162  QGroupBox* mExceptionGroup;
163  QListWidget* mExceptionDateList;
164  KDateComboBox* mExceptionDateEdit;
165  QPushButton* mChangeExceptionButton;
166  QPushButton* mDeleteExceptionButton;
167  CheckBox* mExcludeHolidays;
168  CheckBox* mWorkTimeOnly;
169  QList<QDate> mExceptionDates;
170 
171  // Current start date and time
172  KDateTime mCurrStartDateTime;
173  RepetitionButton* mSubRepetition;
174  bool mNoEmitTypeChanged; // suppress typeChanged() signal
175  bool mReadOnly;
176 
177  // Initial state of non-rule controls
178  QAbstractButton* mSavedRuleButton; // which rule button was selected
179  QAbstractButton* mSavedRangeButton; // which range button was selected
180  int mSavedRecurCount; // recurrence repeat count
181  KDateTime mSavedEndDateTime; // end date/time
182  QList<QDate> mSavedExceptionDates; // exception dates
183  Repetition mSavedRepetition; // sub-repetition interval & count (via mSubRepetition button)
184  bool mSavedExclHolidays; // exclude holidays
185  bool mSavedWorkTimeOnly; // only during working hours
186 };
187 
188 #endif // RECURRENCEEDIT_H
189 
190 // vim: et sw=4:
saveState
KDEPIM_EXPORT void saveState(QWidget *widget, KConfigGroup &config)
RadioButton
QWidget
QListWidget
QPushButton
from
QString from() const
SubDailyRule
Definition: recurrenceedit_p.h:83
RecurrenceEdit::setDateTime
void setDateTime(const KDateTime &start)
Definition: recurrenceedit.h:99
TimeEdit
YearlyRule
Definition: recurrenceedit_p.h:186
CheckBox
RecurrenceEdit::WEEKLY
Definition: recurrenceedit.h:64
RecurrenceEdit::repeatType
RepeatType repeatType() const
Definition: recurrenceedit.h:78
DailyRule
Definition: recurrenceedit_p.h:112
NoRule
Definition: recurrenceedit_p.h:47
QGroupBox
RecurrenceEdit::isTimedRepeatType
bool isTimedRepeatType() const
Definition: recurrenceedit.h:79
RecurrenceEdit
Definition: recurrenceedit.h:59
Rule
Definition: recurrenceedit_p.h:55
SpinBox
set
void set(quint32, const QString &, const QString &, const QString &, const QString &, time_t)
WeeklyRule
Definition: recurrenceedit_p.h:120
RecurrenceEdit::~RecurrenceEdit
virtual ~RecurrenceEdit()
Definition: recurrenceedit.h:67
QLabel
MonthlyRule
Definition: recurrenceedit_p.h:178
RepetitionButton
Definition: repetitionbutton.h:45
QFrame
RecurrenceEdit::RepeatType
RepeatType
Definition: recurrenceedit.h:64
QList< QDate >
ButtonGroup
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:10 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

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