Move unittestenv to correct location
[kdepim.git] / kalarm / deferdlg.h
blobdbbb095695fa8c0a7c2c8963bf5eb0502a836737
1 /*
2 * deferdlg.h - dialog to defer an alarm
3 * Program: kalarm
4 * Copyright © 2002-2004,2006,2007-2012 by David Jarvie <djarvie@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.
21 #ifndef DEFERDLG_H
22 #define DEFERDLG_H
24 #include "eventid.h"
26 #include <kalarmcal/datetime.h>
27 #include <AkonadiCore/collection.h>
28 #include <QDialog>
30 class AlarmTimeWidget;
31 class QDialogButtonBox;
32 namespace KAlarmCal { class KAEvent; }
34 using namespace KAlarmCal;
37 class DeferAlarmDlg : public QDialog
39 Q_OBJECT
40 public:
41 DeferAlarmDlg(const DateTime& initialDT, bool anyTimeOption, bool cancelButton, QWidget* parent = Q_NULLPTR);
42 void setLimit(const DateTime&);
43 DateTime setLimit(const KAEvent& event);
44 const DateTime& getDateTime() const { return mAlarmDateTime; }
45 void setDeferMinutes(int mins);
46 int deferMinutes() const { return mDeferMinutes; }
48 protected Q_SLOTS:
49 virtual void slotOk();
50 virtual void slotCancelDeferral();
52 private Q_SLOTS:
53 void slotPastLimit();
55 private:
56 AlarmTimeWidget* mTimeWidget;
57 QDialogButtonBox* mButtonBox;
58 DateTime mAlarmDateTime;
59 DateTime mLimitDateTime; // latest date/time allowed for deferral
60 EventId mLimitEventId; // event IDs from whose recurrences to derive the limit date/time for deferral
61 int mDeferMinutes; // number of minutes deferral selected, or 0 if date/time entered
64 #endif // DEFERDLG_H
66 // vim: et sw=4: