2 This file is part of the KDE reminder agent.
4 Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org>
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.
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.
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.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
24 #ifndef KORGAC_ALARMDIALOG_H
25 #define KORGAC_ALARMDIALOG_H
27 #include <Akonadi/Calendar/ETMCalendar>
30 #include <KCalCore/Incidence>
41 namespace KIdentityManagement
43 class IdentityManager
;
46 namespace CalendarSupport
48 class IncidenceViewer
;
51 class ReminderTreeItem
;
57 class QTreeWidgetItem
;
60 class AlarmDialog
: public QDialog
64 explicit AlarmDialog(const Akonadi::ETMCalendar::Ptr
&calendar
, QWidget
*parent
= Q_NULLPTR
);
67 void addIncidence(const Akonadi::Item
&incidence
, const QDateTime
&reminderAt
,
68 const QString
&displayText
);
69 void setRemindAt(const QDateTime
&dt
);
70 void eventNotification();
73 void slotOk(); // suspend
74 void slotUser1(); // edit
75 void slotUser2(); // dismiss all
76 void slotUser3(); // dismiss selected
84 void dismissCurrent();
86 void accept() Q_DECL_OVERRIDE
;
89 If an incidence changed, for example in korg, we must update
90 the date and summary shown in the list view.
92 void slotCalendarChanged();
95 void reminderCount(int count
);
102 void keyPressEvent(QKeyEvent
*e
) Q_DECL_OVERRIDE
;
103 void closeEvent(QCloseEvent
*) Q_DECL_OVERRIDE
;
106 typedef QList
<ReminderTreeItem
*> ReminderList
;
108 static KDateTime
triggerDateForIncidence(const KCalCore::Incidence::Ptr
&inc
,
109 const QDateTime
&reminderAt
,
110 QString
&displayStr
);
112 // Removes each Incidence-X group that has one of the specified uids
113 void removeFromConfig(const QList
<Akonadi::Item::Id
> &);
115 // Opens through dbus, @deprecated
116 bool openIncidenceEditorThroughKOrganizer(const KCalCore::Incidence::Ptr
&incidence
);
119 bool openIncidenceEditorNG(const Akonadi::Item
&incidence
);
121 bool startKOrganizer();
122 ReminderTreeItem
*searchByItem(const Akonadi::Item
&incidence
);
124 void dismiss(ReminderList selections
);
126 ReminderList
selectedItems() const;
127 void toggleDetails(QTreeWidgetItem
*item
);
128 void showDetails(QTreeWidgetItem
*item
);
130 Akonadi::ETMCalendar::Ptr mCalendar
;
131 QTreeWidget
*mIncidenceTree
;
132 CalendarSupport::IncidenceViewer
*mDetailView
;
133 KIdentityManagement::IdentityManager
*mIdentityManager
;
136 QSpinBox
*mSuspendSpin
;
137 KComboBox
*mSuspendUnit
;
138 QTimer mSuspendTimer
;
139 QTreeWidgetItem
*mLastItem
;
140 QPushButton
*mUser1Button
;
141 QPushButton
*mUser2Button
;
142 QPushButton
*mUser3Button
;
143 QPushButton
*mOkButton
;