Fix show info in statusbar
[kdepim.git] / korgac / alarmdialog.h
blob78d63888ea87ee129f57277ef1f1dd2e26fc261e
1 /*
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>
28 #include <Item>
29 #include <QDialog>
30 #include <KCalCore/Incidence>
31 #include <KDateTime>
33 #include <QPoint>
34 #include <QTimer>
36 namespace Akonadi
38 class Item;
41 namespace KIdentityManagement
43 class IdentityManager;
46 namespace CalendarSupport
48 class IncidenceViewer;
51 class ReminderTreeItem;
53 class KComboBox;
55 class QDateTime;
56 class QTreeWidget;
57 class QTreeWidgetItem;
58 class QSpinBox;
60 class AlarmDialog : public QDialog
62 Q_OBJECT
63 public:
64 explicit AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *parent = Q_NULLPTR);
65 ~AlarmDialog();
67 void addIncidence(const Akonadi::Item &incidence, const QDateTime &reminderAt,
68 const QString &displayText);
69 void setRemindAt(const QDateTime &dt);
70 void eventNotification();
72 public Q_SLOTS:
73 void slotOk(); // suspend
74 void slotUser1(); // edit
75 void slotUser2(); // dismiss all
76 void slotUser3(); // dismiss selected
77 void slotSave();
78 void wakeUp();
79 void show();
80 void edit();
81 void suspend();
82 void suspendAll();
83 void dismissAll();
84 void dismissCurrent();
85 /*reimp*/
86 void accept() Q_DECL_OVERRIDE;
88 /**
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();
94 Q_SIGNALS:
95 void reminderCount(int count);
97 private Q_SLOTS:
98 void update();
99 void updateButtons();
101 protected:
102 void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
103 void closeEvent(QCloseEvent *) Q_DECL_OVERRIDE;
105 private:
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);
118 // opens directly
119 bool openIncidenceEditorNG(const Akonadi::Item &incidence);
121 bool startKOrganizer();
122 ReminderTreeItem *searchByItem(const Akonadi::Item &incidence);
123 void setTimer();
124 void dismiss(ReminderList selections);
125 int activeCount();
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;
135 QPoint mPos;
136 QSpinBox *mSuspendSpin;
137 KComboBox *mSuspendUnit;
138 QTimer mSuspendTimer;
139 QTreeWidgetItem *mLastItem;
140 QPushButton *mUser1Button;
141 QPushButton *mUser2Button;
142 QPushButton *mUser3Button;
143 QPushButton *mOkButton;
147 #endif