25 #include <tqdatetime.h>
26 #include <tdeaction.h>
28 #include <kalarmd/kalarmd.h>
29 #include <kalarmd/alarmguiiface.h>
31 class TDEActionCollection;
33 class AlarmEnableAction;
34 class NotificationHandler;
37 class Daemon : public TQObject
42 static void initialise();
43 static void createDcopHandler();
44 static bool isDcopHandlerReady() { return mDcopHandler; }
45 static AlarmEnableAction* createAlarmEnableAction(TDEActionCollection*, const char* name);
47 static bool reregister() { return registerWith( true); }
50 static bool autoStart();
51 static void enableAutoStart( bool enable);
52 static void notifyTimeChanged();
53 static void setAlarmsEnabled() { mInstance->setAlarmsEnabled( true); }
54 static void checkStatus() { checkIfRunning(); }
55 static bool monitoringAlarms();
56 static bool isRunning( bool startDaemon = true);
57 static int maxTimeSinceCheck();
58 static bool isRegistered() { return mStatus == REGISTERED; }
59 static void allowRegisterFailMsg() { mRegisterFailMsg = false; }
61 static void queueEvent( const TQString& eventID);
62 static void savingEvent( const TQString& eventID);
63 static void eventHandled( const TQString& eventID, bool reloadCal);
66 void daemonRunning( bool running);
70 void checkIfStarted();
71 void slotStarted() { updateRegisteredStatus( true); }
72 void registerTimerExpired() { registrationResult((mStatus == REGISTERED), KAlarmd::FAILURE); }
74 void setAlarmsEnabled( bool enable);
75 void timerCheckIfRunning();
76 void slotPreferencesChanged();
87 static bool registerWith( bool reregister);
88 static void registrationResult( bool reregister, int result, int version = 0);
90 static void notifyEventHandled( const TQString& eventID, bool reloadCal);
91 static void updateRegisteredStatus( bool timeout = false);
92 static void enableCalendar( bool enable);
93 static void calendarIsEnabled( bool enabled);
94 static bool checkIfRunning();
95 static void setFastCheck();
97 static Daemon* mInstance;
98 static NotificationHandler* mDcopHandler;
99 static TQValueList<TQString> mQueuedEvents;
100 static TQValueList<TQString> mSavingEvents;
101 static TQTimer* mStartTimer;
102 static TQTimer* mRegisterTimer;
103 static TQTimer* mStatusTimer;
104 static int mStatusTimerCount;
105 static int mStatusTimerInterval;
106 static int mStartTimeout;
107 static Status mStatus;
108 static bool mRunning;
109 static bool mCalendarDisabled;
110 static bool mEnableCalPending;
111 static bool mRegisterFailMsg;
113 friend class NotificationHandler;
120 class AlarmEnableAction : public TDEToggleAction
125 AlarmEnableAction( int accel, TQObject* parent, const char* name = 0);
127 void setCheckedActual( bool);
128 virtual void setChecked( bool);
131 void userClicked( bool);
Provides read and write access to calendar files.
|