• 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
repetitionbutton.h
Go to the documentation of this file.
1 /*
2  * repetitionbutton.h - pushbutton and dialog to specify alarm repetition
3  * Program: kalarm
4  * Copyright © 2004-2007,2009-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 REPETITIONBUTTON_H
22 #define REPETITIONBUTTON_H
23 
24 #include <kalarmcal/repetition.h>
25 
26 #include <kdialog.h>
27 #include <QPushButton>
28 
29 using namespace KAlarmCal;
30 
31 class QGroupBox;
32 class ButtonGroup;
33 class RadioButton;
34 class SpinBox;
35 class TimeSelector;
36 class TimePeriod;
37 class RepetitionDlg;
38 
39 #ifdef USE_AKONADI
40 namespace KCalCore { class Duration; }
41 #else
42 namespace KCal { class Duration; }
43 #endif
44 
45 class RepetitionButton : public QPushButton
46 {
47  Q_OBJECT
48  public:
49  RepetitionButton(const QString& caption, bool waitForInitialisation, QWidget* parent);
50  void set(const Repetition&);
51  void set(const Repetition&, bool dateOnly, int maxDuration = -1);
52  void initialise(const Repetition&, bool dateOnly, int maxDuration = -1); // use only after needsInitialisation() signal
53  void activate() { activate(false); }
54  Repetition repetition() const { return mRepetition; }
55  virtual void setReadOnly(bool ro) { mReadOnly = ro; }
56  virtual bool isReadOnly() const { return mReadOnly; }
57 
58  signals:
59  void needsInitialisation(); // dialog has been created and needs set() to be called
60  void changed(); // the repetition dialog has been edited
61 
62  private slots:
63  void slotPressed() { activate(mWaitForInit); }
64 
65  private:
66  void activate(bool waitForInitialisation);
67  void displayDialog();
68 
69  RepetitionDlg* mDialog;
70  Repetition mRepetition; // repetition interval and count
71  int mMaxDuration; // maximum allowed duration in minutes, or -1 for infinite
72  bool mDateOnly; // hours/minutes cannot be displayed
73  bool mWaitForInit; // emit needsInitialisation() when button pressed, display when initialise() called
74  bool mReadOnly;
75 };
76 
77 
78 class RepetitionDlg : public KDialog
79 {
80  Q_OBJECT
81  public:
82  RepetitionDlg(const QString& caption, bool readOnly, QWidget* parent = 0);
83  void setReadOnly(bool);
84  void set(const Repetition&, bool dateOnly = false, int maxDuration = -1);
85  Repetition repetition() const; // get the repetition interval and count
86 
87  private slots:
88  void typeClicked();
89  void countChanged(int);
90 #ifdef USE_AKONADI
91  void intervalChanged(const KCalCore::Duration&);
92  void durationChanged(const KCalCore::Duration&);
93 #else
94  void intervalChanged(const KCal::Duration&);
95  void durationChanged(const KCal::Duration&);
96 #endif
97  void repetitionToggled(bool);
98 
99  private:
100  TimeSelector* mTimeSelector;
101  QGroupBox* mButtonBox;
102  ButtonGroup* mButtonGroup;
103  RadioButton* mCountButton;
104  SpinBox* mCount;
105  RadioButton* mDurationButton;
106  TimePeriod* mDuration;
107  int mMaxDuration; // maximum allowed duration in minutes, or -1 for infinite
108  bool mDateOnly; // hours/minutes cannot be displayed
109  bool mReadOnly; // the widget is read only
110 };
111 
112 #endif // REPETITIONBUTTON_H
113 
114 // vim: et sw=4:
QWidget
RadioButton
KDialog
RepetitionButton::activate
void activate()
Definition: repetitionbutton.h:53
QGroupBox
TimePeriod
RepetitionDlg
Definition: repetitionbutton.h:78
QString
SpinBox
set
void set(quint32, const QString &, const QString &, const QString &, const QString &, time_t)
RepetitionButton::isReadOnly
virtual bool isReadOnly() const
Definition: repetitionbutton.h:56
TimeSelector
Definition: timeselector.h:31
QPushButton
RepetitionButton::repetition
Repetition repetition() const
Definition: repetitionbutton.h:54
RepetitionButton
Definition: repetitionbutton.h:45
RepetitionButton::setReadOnly
virtual void setReadOnly(bool ro)
Definition: repetitionbutton.h:55
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