kalarm

dcophandler.h
1 /*
2  * dcophandler.h - handler for DCOP calls by other applications
3  * Program: kalarm
4  * Copyright © 2001,2002,2004-2006,2008 by David Jarvie <djarvie@kde.org>
5  *
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.
10  *
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.
15  *
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.
19  */
20 
21 #ifndef DCOPHANDLER_H
22 #define DCOPHANDLER_H
23 
24 #include <tqwidget.h>
25 #include <dcopobject.h>
26 
27 #include "datetime.h"
28 #include "kalarmiface.h"
29 
30 
31 class DcopHandler : public TQWidget, virtual public KAlarmIface
32 {
33  public:
34  DcopHandler();
35  virtual bool cancelEvent(const TQString& url,const TQString& eventId);
36  virtual bool triggerEvent(const TQString& url,const TQString& eventId);
37 
38  virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags,
39  const TQString& bgColor, const TQString& fgColor, const TQString& font,
40  const KURL& audioFile, int reminderMins, const TQString& recurrence,
41  int subRepeatInterval, int subRepeatCount);
42  virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags,
43  const TQString& bgColor, const TQString& fgColor, const TQString& font,
44  const KURL& audioFile, int reminderMins, int recurType, int recurInterval, int recurCount);
45  virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags,
46  const TQString& bgColor, const TQString& fgColor, const TQString& font,
47  const KURL& audioFile, int reminderMins, int recurType, int recurInterval, const TQString& endDateTime);
48  virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor,
49  const KURL& audioFile, int reminderMins, const TQString& recurrence,
50  int subRepeatInterval, int subRepeatCount);
51  virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor,
52  const KURL& audioFile, int reminderMins, int recurType, int recurInterval, int recurCount);
53  virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor,
54  const KURL& audioFile, int reminderMins, int recurType, int recurInterval, const TQString& endDateTime);
55  virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags,
56  const TQString& recurrence, int subRepeatInterval, int subRepeatCount);
57  virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags,
58  int recurType, int recurInterval, int recurCount);
59  virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags,
60  int recurType, int recurInterval, const TQString& endDateTime);
61  virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message,
62  const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags,
63  const TQString& recurrence, int recurInterval, int recurCount);
64  virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message,
65  const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags,
66  int recurType, int recurInterval, int recurCount);
67  virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message,
68  const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags,
69  int recurType, int recurInterval, const TQString& endDateTime);
70  virtual bool edit(const TQString& eventID);
71  virtual bool editNew(const TQString& templateName);
72 
73  private:
74  static bool scheduleMessage(const TQString& message, const DateTime& start, int lateCancel, unsigned flags,
75  const TQString& bgColor, const TQString& fgColor, const TQString& fontStr,
76  const KURL& audioFile, int reminderMins, const KARecurrence&,
77  int subRepeatInterval = 0, int subRepeatCount = 0);
78  static bool scheduleFile(const KURL& file, const DateTime& start, int lateCancel, unsigned flags, const TQString& bgColor,
79  const KURL& audioFile, int reminderMins, const KARecurrence&,
80  int subRepeatInterval = 0, int subRepeatCount = 0);
81  static bool scheduleCommand(const TQString& commandLine, const DateTime& start, int lateCancel, unsigned flags,
82  const KARecurrence&, int subRepeatInterval = 0, int subRepeatCount = 0);
83  static bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message,
84  const TQString& attachments, const DateTime& start, int lateCancel, unsigned flags,
85  const KARecurrence&, int subRepeatInterval = 0, int subRepeatCount = 0);
86  static DateTime convertStartDateTime(const TQString& startDateTime);
87  static unsigned convertStartFlags(const DateTime& start, unsigned flags);
88  static TQColor convertBgColour(const TQString& bgColor);
89  static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, const TQString& icalRecurrence, int& subRepeatInterval);
90  static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, int recurType, int recurInterval, int recurCount);
91  static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, int recurType, int recurInterval, const TQString& endDateTime);
92  static bool convertRecurrence(KARecurrence&, const DateTime& start, int recurType, int recurInterval, int recurCount, const TQDateTime& end);
93 };
94 
95 #endif // DCOPHANDLER_H
KAlarmIface provides a DCOP interface for other applications to request KAlarm actions.
Definition: kalarmiface.h:37
virtual bool scheduleCommand(const TQString &commandLine, const TQString &startDateTime, int lateCancel, unsigned flags, const TQString &recurrence, int repeatInterval, int repeatCount)=0
Schedule a command execution alarm.
virtual bool edit(const TQString &eventID)=0
Open the alarm edit dialog to edit an existing alarm.
virtual bool scheduleMessage(const TQString &message, const TQString &startDateTime, int lateCancel, unsigned flags, const TQString &bgColor, const TQString &fgColor, const TQString &font, const KURL &audioFile, int reminderMins, const TQString &recurrence, int repeatInterval, int repeatCount)=0
Schedule a message display alarm.
virtual bool cancelEvent(const TQString &url, const TQString &eventId)=0
Cancel (delete) an already scheduled alarm.
virtual bool editNew(const TQString &templateName)=0
Open the alarm edit dialog to edit a new alarm.
virtual bool triggerEvent(const TQString &url, const TQString &eventId)=0
Trigger the immediate display or execution of an alarm, regardless of what time it is scheduled for.
virtual bool scheduleFile(const KURL &file, const TQString &startDateTime, int lateCancel, unsigned flags, const TQString &bgColor, const KURL &audioFile, int reminderMins, const TQString &recurrence, int repeatInterval, int repeatCount)=0
Schedule a file display alarm.
virtual bool scheduleEmail(const TQString &fromID, const TQString &addresses, const TQString &subject, const TQString &message, const TQString &attachments, const TQString &startDateTime, int lateCancel, unsigned flags, const TQString &recurrence, int repeatInterval, int repeatCount)=0
Schedule an email alarm.
DCOP interface to KAlarm