dcophandler.h
00001 /* 00002 * dcophandler.h - handler for DCOP calls by other applications 00003 * Program: kalarm 00004 * Copyright © 2001,2002,2004-2006,2008 by David Jarvie <djarvie@kde.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef DCOPHANDLER_H 00022 #define DCOPHANDLER_H 00023 00024 #include <tqwidget.h> 00025 #include <dcopobject.h> 00026 00027 #include "datetime.h" 00028 #include "kalarmiface.h" 00029 00030 00031 class DcopHandler : public TQWidget, virtual public KAlarmIface 00032 { 00033 public: 00034 DcopHandler(); 00035 virtual bool cancelEvent(const TQString& url,const TQString& eventId); 00036 virtual bool triggerEvent(const TQString& url,const TQString& eventId); 00037 00038 virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags, 00039 const TQString& bgColor, const TQString& fgColor, const TQString& font, 00040 const KURL& audioFile, int reminderMins, const TQString& recurrence, 00041 int subRepeatInterval, int subRepeatCount); 00042 virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags, 00043 const TQString& bgColor, const TQString& fgColor, const TQString& font, 00044 const KURL& audioFile, int reminderMins, int recurType, int recurInterval, int recurCount); 00045 virtual bool scheduleMessage(const TQString& message, const TQString& startDateTime, int lateCancel, unsigned flags, 00046 const TQString& bgColor, const TQString& fgColor, const TQString& font, 00047 const KURL& audioFile, int reminderMins, int recurType, int recurInterval, const TQString& endDateTime); 00048 virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor, 00049 const KURL& audioFile, int reminderMins, const TQString& recurrence, 00050 int subRepeatInterval, int subRepeatCount); 00051 virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor, 00052 const KURL& audioFile, int reminderMins, int recurType, int recurInterval, int recurCount); 00053 virtual bool scheduleFile(const KURL& file, const TQString& startDateTime, int lateCancel, unsigned flags, const TQString& bgColor, 00054 const KURL& audioFile, int reminderMins, int recurType, int recurInterval, const TQString& endDateTime); 00055 virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags, 00056 const TQString& recurrence, int subRepeatInterval, int subRepeatCount); 00057 virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags, 00058 int recurType, int recurInterval, int recurCount); 00059 virtual bool scheduleCommand(const TQString& commandLine, const TQString& startDateTime, int lateCancel, unsigned flags, 00060 int recurType, int recurInterval, const TQString& endDateTime); 00061 virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message, 00062 const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags, 00063 const TQString& recurrence, int recurInterval, int recurCount); 00064 virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message, 00065 const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags, 00066 int recurType, int recurInterval, int recurCount); 00067 virtual bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message, 00068 const TQString& attachments, const TQString& startDateTime, int lateCancel, unsigned flags, 00069 int recurType, int recurInterval, const TQString& endDateTime); 00070 virtual bool edit(const TQString& eventID); 00071 virtual bool editNew(const TQString& templateName); 00072 00073 private: 00074 static bool scheduleMessage(const TQString& message, const DateTime& start, int lateCancel, unsigned flags, 00075 const TQString& bgColor, const TQString& fgColor, const TQString& fontStr, 00076 const KURL& audioFile, int reminderMins, const KARecurrence&, 00077 int subRepeatInterval = 0, int subRepeatCount = 0); 00078 static bool scheduleFile(const KURL& file, const DateTime& start, int lateCancel, unsigned flags, const TQString& bgColor, 00079 const KURL& audioFile, int reminderMins, const KARecurrence&, 00080 int subRepeatInterval = 0, int subRepeatCount = 0); 00081 static bool scheduleCommand(const TQString& commandLine, const DateTime& start, int lateCancel, unsigned flags, 00082 const KARecurrence&, int subRepeatInterval = 0, int subRepeatCount = 0); 00083 static bool scheduleEmail(const TQString& fromID, const TQString& addresses, const TQString& subject, const TQString& message, 00084 const TQString& attachments, const DateTime& start, int lateCancel, unsigned flags, 00085 const KARecurrence&, int subRepeatInterval = 0, int subRepeatCount = 0); 00086 static DateTime convertStartDateTime(const TQString& startDateTime); 00087 static unsigned convertStartFlags(const DateTime& start, unsigned flags); 00088 static TQColor convertBgColour(const TQString& bgColor); 00089 static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, const TQString& icalRecurrence, int& subRepeatInterval); 00090 static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, int recurType, int recurInterval, int recurCount); 00091 static bool convertRecurrence(DateTime& start, KARecurrence&, const TQString& startDateTime, int recurType, int recurInterval, const TQString& endDateTime); 00092 static bool convertRecurrence(KARecurrence&, const DateTime& start, int recurType, int recurInterval, int recurCount, const TQDateTime& end); 00093 }; 00094 00095 #endif // DCOPHANDLER_H