32 #include <kalarmcal/kaevent.h>
34 #include <kuniqueapplication.h>
41 namespace KCal {
class Event; }
43 namespace Akonadi {
class Collection; }
49 class OrgKdeKSpeechInterface;
51 using namespace KAlarmCal;
59 virtual int newInstance();
62 bool wantShowInSystemTray()
const;
65 OrgKdeKSpeechInterface* kspeechInterface(
QString& error)
const;
67 bool restoreSession();
71 static void displayFatalError(
const QString& message);
76 bool displayTrayIcon(
bool show,
MainWindow* = 0);
81 void* execAlarm(KAEvent&,
const KAAlarm&,
bool reschedule,
bool allowDefer =
true,
bool noPreAction =
false);
82 ShellProcess* execCommandAlarm(
const KAEvent&,
const KAAlarm&,
const QObject* receiver = 0,
const char* slot = 0);
83 void alarmCompleted(
const KAEvent&);
87 void notifyAudioPlaying(
bool playing);
88 void setSpreadWindowsState(
bool spread);
89 bool windowFocusBroken()
const;
90 bool needWindowFocusFix()
const;
92 bool scheduleEvent(KAEvent::SubAction,
const QString&
text,
const KDateTime&,
93 int lateCancel, KAEvent::Flags flags,
const QColor& bg,
const QColor& fg,
94 const QFont&,
const QString& audioFile,
float audioVolume,
95 int reminderMinutes,
const KARecurrence& recurrence,
96 KCalCore::Duration repeatInterval,
int repeatCount,
98 uint mailFromID = 0,
const KCalCore::Person::List& mailAddresses = KCalCore::Person::List(),
105 bool dbusTriggerEvent(
const EventId& eventID) {
return dbusHandleEvent(eventID, EVENT_TRIGGER); }
106 bool dbusDeleteEvent(
const EventId& eventID) {
return dbusHandleEvent(eventID, EVENT_CANCEL); }
115 void setAlarmsEnabled(
bool);
117 void purgeNewArchivedDefault(
const Akonadi::Collection&);
118 void atLoginEventAdded(
const KAEvent&);
122 void spreadWindows(
bool);
126 void trayIconToggled();
127 void alarmEnabledToggled(
bool);
128 void audioPlaying(
bool);
129 void spreadWindowsToggled(
bool);
130 void execAlarmSuccess();
136 typedef Preferences::Feb29Type Feb29Type;
140 void checkNextDueAlarm();
141 void checkKtimezoned();
142 void slotShowInSystemTrayChanged();
143 void changeStartOfDay();
145 void slotHolidaysChanged(
const KHolidays::HolidayRegion&);
146 void slotFeb29TypeChanged(Feb29Type);
147 void checkWritableCalendar();
148 void slotMessageFontChanged(
const QFont&);
149 void setArchivePurgeDays();
150 void slotPurge() { purge(mArchivedPurgeDays); }
152 void purgeAfterDelay();
155 void slotDBusServiceUnregistered(
const QString& serviceName);
166 ProcData(
ShellProcess*, KAEvent*, KAAlarm*,
int flags = 0);
168 enum { PRE_ACTION = 0x01, POST_ACTION = 0x02, RESCHEDULE = 0x04, ALLOW_DEFER = 0x08,
169 TEMP_FILE = 0x10, EXEC_IN_XTERM = 0x20, DISP_OUTPUT = 0x40 };
170 bool preAction()
const {
return flags & PRE_ACTION; }
171 bool postAction()
const {
return flags & POST_ACTION; }
172 bool reschedule()
const {
return flags & RESCHEDULE; }
173 bool allowDefer()
const {
return flags & ALLOW_DEFER; }
174 bool tempFile()
const {
return flags & TEMP_FILE; }
175 bool execInXterm()
const {
return flags & EXEC_IN_XTERM; }
176 bool dispOutput()
const {
return flags & DISP_OUTPUT; }
187 ActionQEntry(EventFunc f,
const EventId&
id) : function(f), eventId(id) { }
189 ActionQEntry(EventFunc f,
const QString&
id) : function(f), eventId(id) { }
191 ActionQEntry(
const KAEvent& e, EventFunc f = EVENT_HANDLE) : function(f), event(e) { }
204 bool initCheck(
bool calendarOnly =
false,
bool waitForCollection =
false, Akonadi::Collection::Id = -1);
206 bool initCheck(
bool calendarOnly =
false);
208 bool quitIf(
int exitCode,
bool force =
false);
209 bool checkSystemTray();
210 void startProcessQueue();
211 void queueAlarmId(
const KAEvent&);
213 bool dbusHandleEvent(
const EventId&, EventFunc);
214 bool handleEvent(
const EventId&, EventFunc,
bool checkDuplicates =
false);
216 bool dbusHandleEvent(
const QString& eventID, EventFunc);
217 bool handleEvent(
const QString& eventID, EventFunc);
219 int rescheduleAlarm(KAEvent&,
const KAAlarm&,
bool updateCalAndDisplay,
220 const KDateTime& nextDt = KDateTime());
221 bool cancelAlarm(KAEvent&, KAAlarm::Type,
bool updateCalAndDisplay);
222 bool cancelReminderAndDeferral(KAEvent&);
224 int flags = 0,
const QObject* receiver = 0,
const char* slot = 0);
225 QString composeXTermCommand(
const QString& command,
const KAEvent&,
const KAAlarm*,
226 int flags,
QString& tempScriptFile)
const;
227 QString createTempScriptFile(
const QString& command,
bool insertShell,
const KAEvent&,
const KAAlarm&)
const;
228 void commandErrorMsg(
const ShellProcess*,
const KAEvent&,
const KAAlarm*,
int flags = 0);
229 void purge(
int daysToKeep);
233 static int mActiveCount;
234 static int mFatalError;
237 bool mRedisplayAlarms;
240 bool mLoginAlarmsDone;
244 QColor mPrefsArchivedColour;
245 int mArchivedPurgeDays;
246 int mPurgeDaysQueued;
249 mutable OrgKdeKSpeechInterface* mKSpeech;
250 int mPendingQuitCode;
253 bool mProcessingQueue;
255 bool mSessionClosingDown;
256 bool mOldShowInSystemTray;
259 bool mKOrganizerEnabled;
260 bool mWindowFocusBroken;
265 #endif // KALARMAPP_H
void rescheduleAlarm(KAEvent &e, const KAAlarm &a)
bool alarmsEnabled() const
virtual QByteArray text(quint32 serialNumber) const =0
bool dbusDeleteEvent(const QString &eventID)
bool trayIconDisplayed() const
static KAlarmApp * getInstance()
bool dbusTriggerEvent(const QString &eventID)
bool korganizerEnabled() const
void notifyAudioStopped()
void addWindow(TrayWindow *w)
Unique event identifier for Akonadi.
bool sessionClosingDown() const
TrayWindow * trayWindow() const
bool speechEnabled() const