The concept of local folders doesn't apply any more.
[kdepim.git] / kalarm / dbushandler.h
blobb91d7a6d528c67280a4f66884bbac06af51bd683
1 /*
2 * dbushandler.h - handler for D-Bus calls by other applications
3 * Program: kalarm
4 * Copyright © 2001-2011 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
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 DBUSHANDLER_H
22 #define DBUSHANDLER_H
24 #include "kalarmiface.h"
26 #include <kalarmcal/kaevent.h>
28 #ifdef USE_AKONADI
29 #include <kcalcore/duration.h>
30 #else
31 #include <kcal/duration.h>
32 #endif
34 #include <QWidget>
35 class KUrl;
37 using namespace KAlarmCal;
40 class DBusHandler : public QObject, public KAlarmIface
42 Q_OBJECT
43 Q_CLASSINFO("D-Bus Interface", "org.kde.kalarm.kalarm")
44 public:
45 DBusHandler();
47 public Q_SLOTS:
48 Q_SCRIPTABLE bool cancelEvent(const QString& eventId);
49 Q_SCRIPTABLE bool triggerEvent(const QString& eventId);
51 Q_SCRIPTABLE bool scheduleMessage(const QString& message, const QString& startDateTime, int lateCancel, unsigned flags,
52 const QString& bgColor, const QString& fgColor, const QString& font,
53 const QString& audioUrl, int reminderMins, const QString& recurrence,
54 int subRepeatInterval, int subRepeatCount);
55 Q_SCRIPTABLE bool scheduleMessage(const QString& message, const QString& startDateTime, int lateCancel, unsigned flags,
56 const QString& bgColor, const QString& fgColor, const QString& font,
57 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, int recurCount);
58 Q_SCRIPTABLE bool scheduleMessage(const QString& message, const QString& startDateTime, int lateCancel, unsigned flags,
59 const QString& bgColor, const QString& fgColor, const QString& font,
60 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, const QString& endDateTime);
61 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
62 const QString& audioUrl, int reminderMins, const QString& recurrence,
63 int subRepeatInterval, int subRepeatCount);
64 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
65 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, int recurCount);
66 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
67 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, const QString& endDateTime);
68 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
69 const QString& recurrence, int subRepeatInterval, int subRepeatCount);
70 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
71 int recurType, int recurInterval, int recurCount);
72 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
73 int recurType, int recurInterval, const QString& endDateTime);
74 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
75 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
76 const QString& recurrence, int subRepeatInterval, int subRepeatCount);
77 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
78 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
79 int recurType, int recurInterval, int recurCount);
80 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
81 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
82 int recurType, int recurInterval, const QString& endDateTime);
83 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
84 unsigned flags, const QString& recurrence, int subRepeatInterval, int subRepeatCount);
85 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
86 unsigned flags, int recurType, int recurInterval, int recurCount);
87 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
88 unsigned flags, int recurType, int recurInterval, const QString& endDateTime);
89 Q_SCRIPTABLE bool edit(const QString& eventID);
90 Q_SCRIPTABLE bool editNew(int type);
91 Q_SCRIPTABLE bool editNew(const QString& templateName);
93 private:
94 static bool scheduleMessage(const QString& message, const KDateTime& start, int lateCancel, unsigned flags,
95 const QString& bgColor, const QString& fgColor, const QString& fontStr,
96 const KUrl& audioFile, int reminderMins, const KARecurrence&,
97 #ifdef USE_AKONADI
98 const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
99 #else
100 const KCal::Duration& subRepeatDuration = KCal::Duration(0), int subRepeatCount = 0);
101 #endif
102 static bool scheduleFile(const KUrl& file, const KDateTime& start, int lateCancel, unsigned flags, const QString& bgColor,
103 const KUrl& audioFile, int reminderMins, const KARecurrence&,
104 #ifdef USE_AKONADI
105 const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
106 #else
107 const KCal::Duration& subRepeatDuration = KCal::Duration(0), int subRepeatCount = 0);
108 #endif
109 static bool scheduleCommand(const QString& commandLine, const KDateTime& start, int lateCancel, unsigned flags,
110 #ifdef USE_AKONADI
111 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
112 #else
113 const KARecurrence&, const KCal::Duration& subRepeatDuration = KCal::Duration(0), int subRepeatCount = 0);
114 #endif
115 static bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
116 const QString& attachments, const KDateTime& start, int lateCancel, unsigned flags,
117 #ifdef USE_AKONADI
118 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
119 #else
120 const KARecurrence&, const KCal::Duration& subRepeatDuration = KCal::Duration(0), int subRepeatCount = 0);
121 #endif
122 static bool scheduleAudio(const QString& audioUrl, int volumePercent, const KDateTime& start, int lateCancel, unsigned flags,
123 #ifdef USE_AKONADI
124 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
125 #else
126 const KARecurrence&, const KCal::Duration& subRepeatDuration = KCal::Duration(0), int subRepeatCount = 0);
127 #endif
128 static KDateTime convertDateTime(const QString& dateTime, const KDateTime& = KDateTime());
129 static KAEvent::Flags convertStartFlags(const KDateTime& start, unsigned flags);
130 static QColor convertBgColour(const QString& bgColor);
131 #ifdef USE_AKONADI
132 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, const QString& icalRecurrence, int subRepeatInterval, KCalCore::Duration& subRepeatDuration);
133 #else
134 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, const QString& icalRecurrence, int subRepeatInterval, KCal::Duration& subRepeatDuration);
135 #endif
136 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, int recurType, int recurInterval, int recurCount);
137 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, int recurType, int recurInterval, const QString& endDateTime);
138 static bool convertRecurrence(KARecurrence&, const KDateTime& start, int recurType, int recurInterval, int recurCount, const KDateTime& end);
141 #endif // DBUSHANDLER_H
143 // vim: et sw=4: