• 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
specialactions.h
Go to the documentation of this file.
1 /*
2  * specialactions.h - widget to specify special alarm actions
3  * Program: kalarm
4  * Copyright © 2004-2010,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 SPECIALACTIONS_H
22 #define SPECIALACTIONS_H
23 
24 #include <kalarmcal/kaevent.h>
25 #include <kdialog.h>
26 #include <QWidget>
27 #include <QPushButton>
28 
29 using namespace KAlarmCal;
30 
31 class QResizeEvent;
32 class KLineEdit;
33 class CheckBox;
34 
35 
36 class SpecialActionsButton : public QPushButton
37 {
38  Q_OBJECT
39  public:
40  explicit SpecialActionsButton(bool enableCheckboxes, QWidget* parent = 0);
41  void setActions(const QString& pre, const QString& post, KAEvent::ExtraActionOptions);
42  const QString& preAction() const { return mPreAction; }
43  const QString& postAction() const { return mPostAction; }
44  KAEvent::ExtraActionOptions options() const { return mOptions; }
45  virtual void setReadOnly(bool ro) { mReadOnly = ro; }
46  virtual bool isReadOnly() const { return mReadOnly; }
47 
48  signals:
50  void selected();
51 
52  protected slots:
53  void slotButtonPressed();
54 
55  private:
56  QString mPreAction;
57  QString mPostAction;
58  KAEvent::ExtraActionOptions mOptions;
59  bool mEnableCheckboxes;
60  bool mReadOnly;
61 };
62 
63 
64 // Pre- and post-alarm actions widget
65 class SpecialActions : public QWidget
66 {
67  Q_OBJECT
68  public:
69  explicit SpecialActions(bool enableCheckboxes, QWidget* parent = 0);
70  void setActions(const QString& pre, const QString& post, KAEvent::ExtraActionOptions);
71  QString preAction() const;
72  QString postAction() const;
73  KAEvent::ExtraActionOptions options() const;
74  void setReadOnly(bool);
75  bool isReadOnly() const { return mReadOnly; }
76 
77  private slots:
78  void slotPreActionChanged(const QString& text);
79 
80  private:
81  KLineEdit* mPreAction;
82  KLineEdit* mPostAction;
83  CheckBox* mCancelOnError;
84  CheckBox* mDontShowError;
85  CheckBox* mExecOnDeferral;
86  bool mEnableCheckboxes; // enable checkboxes even if mPreAction is blank
87  bool mReadOnly;
88 };
89 
90 
91 // Pre- and post-alarm actions dialog displayed by the push button
92 class SpecialActionsDlg : public KDialog
93 {
94  Q_OBJECT
95  public:
96  SpecialActionsDlg(const QString& preAction, const QString& postAction,
97  KAEvent::ExtraActionOptions, bool enableCheckboxes,
98  QWidget* parent = 0);
99  QString preAction() const { return mActions->preAction(); }
100  QString postAction() const { return mActions->postAction(); }
101  KAEvent::ExtraActionOptions options() const { return mActions->options(); }
102  void setReadOnly(bool ro) { mActions->setReadOnly(ro); }
103  bool isReadOnly() const { return mActions->isReadOnly(); }
104 
105  protected:
106  virtual void resizeEvent(QResizeEvent*);
107 
108  protected slots:
109  virtual void slotOk();
110 
111  private:
112  SpecialActions* mActions;
113 };
114 
115 #endif // SPECIALACTIONS_H
116 
117 // vim: et sw=4:
SpecialActions
Definition: specialactions.h:65
QResizeEvent
QWidget
text
virtual QByteArray text(quint32 serialNumber) const =0
SpecialActionsButton::isReadOnly
virtual bool isReadOnly() const
Definition: specialactions.h:46
KDialog
SpecialActionsDlg::options
KAEvent::ExtraActionOptions options() const
Definition: specialactions.h:101
SpecialActions::isReadOnly
bool isReadOnly() const
Definition: specialactions.h:75
SpecialActionsDlg::isReadOnly
bool isReadOnly() const
Definition: specialactions.h:103
CheckBox
SpecialActionsDlg::preAction
QString preAction() const
Definition: specialactions.h:99
SpecialActionsButton
Definition: specialactions.h:36
SpecialActionsDlg::postAction
QString postAction() const
Definition: specialactions.h:100
QString
SpecialActionsButton::options
KAEvent::ExtraActionOptions options() const
Definition: specialactions.h:44
SpecialActionsDlg::setReadOnly
void setReadOnly(bool ro)
Definition: specialactions.h:102
SpecialActionsButton::setReadOnly
virtual void setReadOnly(bool ro)
Definition: specialactions.h:45
KLineEdit
SpecialActionsDlg
Definition: specialactions.h:92
QPushButton
SpecialActionsButton::preAction
const QString & preAction() const
Definition: specialactions.h:42
SpecialActionsButton::postAction
const QString & postAction() const
Definition: specialactions.h:43
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