SVN_SILENT made messages (.desktop file) - always resolve ours
[kdepim.git] / kalarm / dbushandler.h
blob2bdc34a6b398dbdd08e79b9d896d02679352b7c7
1 /*
2 * dbushandler.h - handler for D-Bus calls by other applications
3 * Program: kalarm
4 * Copyright © 2001-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
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 #include <KCalCore/Duration>
30 class QUrl;
32 using namespace KAlarmCal;
35 class DBusHandler : public QObject, public KAlarmIface
37 Q_OBJECT
38 Q_CLASSINFO("D-Bus Interface", "org.kde.kalarm.kalarm")
39 public:
40 DBusHandler();
42 public Q_SLOTS:
43 Q_SCRIPTABLE bool cancelEvent(const QString& eventId);
44 Q_SCRIPTABLE bool triggerEvent(const QString& eventId);
45 Q_SCRIPTABLE QString list();
47 Q_SCRIPTABLE bool scheduleMessage(const QString& message, const QString& startDateTime, int lateCancel, unsigned flags,
48 const QString& bgColor, const QString& fgColor, const QString& font,
49 const QString& audioUrl, int reminderMins, const QString& recurrence,
50 int subRepeatInterval, int subRepeatCount);
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, int recurType, int recurInterval, int recurCount);
54 Q_SCRIPTABLE bool scheduleMessage(const QString& message, const QString& startDateTime, int lateCancel, unsigned flags,
55 const QString& bgColor, const QString& fgColor, const QString& font,
56 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, const QString& endDateTime);
57 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
58 const QString& audioUrl, int reminderMins, const QString& recurrence,
59 int subRepeatInterval, int subRepeatCount);
60 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
61 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, int recurCount);
62 Q_SCRIPTABLE bool scheduleFile(const QString& url, const QString& startDateTime, int lateCancel, unsigned flags, const QString& bgColor,
63 const QString& audioUrl, int reminderMins, int recurType, int recurInterval, const QString& endDateTime);
64 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
65 const QString& recurrence, int subRepeatInterval, int subRepeatCount);
66 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
67 int recurType, int recurInterval, int recurCount);
68 Q_SCRIPTABLE bool scheduleCommand(const QString& commandLine, const QString& startDateTime, int lateCancel, unsigned flags,
69 int recurType, int recurInterval, const QString& endDateTime);
70 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
71 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
72 const QString& recurrence, int subRepeatInterval, int subRepeatCount);
73 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
74 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
75 int recurType, int recurInterval, int recurCount);
76 Q_SCRIPTABLE bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
77 const QString& attachments, const QString& startDateTime, int lateCancel, unsigned flags,
78 int recurType, int recurInterval, const QString& endDateTime);
79 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
80 unsigned flags, const QString& recurrence, int subRepeatInterval, int subRepeatCount);
81 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
82 unsigned flags, int recurType, int recurInterval, int recurCount);
83 Q_SCRIPTABLE bool scheduleAudio(const QString& audioUrl, int volumePercent, const QString& startDateTime, int lateCancel,
84 unsigned flags, int recurType, int recurInterval, const QString& endDateTime);
85 Q_SCRIPTABLE bool edit(const QString& eventID);
86 Q_SCRIPTABLE bool editNew(int type);
87 Q_SCRIPTABLE bool editNew(const QString& templateName);
89 private:
90 static bool scheduleMessage(const QString& message, const KDateTime& start, int lateCancel, unsigned flags,
91 const QString& bgColor, const QString& fgColor, const QString& fontStr,
92 const QUrl& audioFile, int reminderMins, const KARecurrence&,
93 const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
94 static bool scheduleFile(const QUrl& file, const KDateTime& start, int lateCancel, unsigned flags, const QString& bgColor,
95 const QUrl& audioFile, int reminderMins, const KARecurrence&,
96 const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
97 static bool scheduleCommand(const QString& commandLine, const KDateTime& start, int lateCancel, unsigned flags,
98 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
99 static bool scheduleEmail(const QString& fromID, const QString& addresses, const QString& subject, const QString& message,
100 const QString& attachments, const KDateTime& start, int lateCancel, unsigned flags,
101 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
102 static bool scheduleAudio(const QString& audioUrl, int volumePercent, const KDateTime& start, int lateCancel, unsigned flags,
103 const KARecurrence&, const KCalCore::Duration& subRepeatDuration = KCalCore::Duration(0), int subRepeatCount = 0);
104 static KDateTime convertDateTime(const QString& dateTime, const KDateTime& = KDateTime());
105 static KAEvent::Flags convertStartFlags(const KDateTime& start, unsigned flags);
106 static QColor convertBgColour(const QString& bgColor);
107 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, const QString& icalRecurrence, int subRepeatInterval, KCalCore::Duration& subRepeatDuration);
108 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, int recurType, int recurInterval, int recurCount);
109 static bool convertRecurrence(KDateTime& start, KARecurrence&, const QString& startDateTime, int recurType, int recurInterval, const QString& endDateTime);
110 static bool convertRecurrence(KARecurrence&, const KDateTime& start, int recurType, int recurInterval, int recurCount, const KDateTime& end);
113 #endif // DBUSHANDLER_H
115 // vim: et sw=4: