Diffstat (limited to 'noncore/unsupported/libopie/pim/opimnotifymanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/libopie/pim/opimnotifymanager.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/opimnotifymanager.h b/noncore/unsupported/libopie/pim/opimnotifymanager.h new file mode 100644 index 0000000..f3c22f9 --- a/dev/null +++ b/noncore/unsupported/libopie/pim/opimnotifymanager.h | |||
@@ -0,0 +1,91 @@ | |||
1 | #ifndef OPIE_PIM_NOTIFY_MANAGER_H | ||
2 | #define OPIE_PIM_NOTIFY_MANAGER_H | ||
3 | |||
4 | #include <qvaluelist.h> | ||
5 | |||
6 | #include <opie/opimnotify.h> | ||
7 | |||
8 | /** | ||
9 | * The notify manager keeps track of the Notifiers.... | ||
10 | */ | ||
11 | class OPimNotifyManager { | ||
12 | public: | ||
13 | typedef QValueList<OPimReminder> Reminders; | ||
14 | typedef QValueList<OPimAlarm> Alarms; | ||
15 | OPimNotifyManager( const Reminders& rems = Reminders(), const Alarms& alarms = Alarms() ); | ||
16 | ~OPimNotifyManager(); | ||
17 | |||
18 | /* we will cast it for you ;) */ | ||
19 | void add( const OPimNotify& ); | ||
20 | void remove( const OPimNotify& ); | ||
21 | /* replaces all with this one! */ | ||
22 | void replace( const OPimNotify& ); | ||
23 | |||
24 | Reminders reminders()const; | ||
25 | |||
26 | /** | ||
27 | * Return | ||
28 | */ | ||
29 | Alarms alarms()const; | ||
30 | |||
31 | /** | ||
32 | * Return alarm at DateTime "when". If more than one is registered at this | ||
33 | * DateTime, the first one is returned. | ||
34 | * If none was found, an empty Alarm is returned. | ||
35 | * @param when The date and time of the returned alarm | ||
36 | * @param found Returns true if anything was found. | ||
37 | * @return Returns the found alarm at given DateTime. It is empty if found is false | ||
38 | * (nothing could be found at given date and time) | ||
39 | */ | ||
40 | OPimAlarm alarmAtDateTime( const QDateTime& when, bool& found ) const; | ||
41 | |||
42 | void setAlarms( const Alarms& ); | ||
43 | void setReminders( const Reminders& ); | ||
44 | |||
45 | /* register is a Ansi C keyword... */ | ||
46 | /** | ||
47 | * This function will register the Notify to the Alarm Server | ||
48 | * or datebook depending on the type of the notify | ||
49 | */ | ||
50 | void registerNotify( const OPimNotify& ); | ||
51 | |||
52 | /** | ||
53 | * this will do the opposite.. | ||
54 | */ | ||
55 | void deregister( const OPimNotify& ); | ||
56 | |||
57 | bool isEmpty()const; | ||
58 | |||
59 | /** | ||
60 | * Return all alarms as string | ||
61 | */ | ||
62 | QString alarmsToString() const; | ||
63 | /** | ||
64 | * Return all notifiers as string | ||
65 | */ | ||
66 | QString remindersToString() const; | ||
67 | |||
68 | /** | ||
69 | * Convert string to alarms | ||
70 | * @param str String created by alarmsToString() | ||
71 | */ | ||
72 | void alarmsFromString( const QString& str ); | ||
73 | |||
74 | /** | ||
75 | * Convert string to reminders | ||
76 | * @param str String created by remindersToString() | ||
77 | */ | ||
78 | void remindersFromString( const QString& str ); | ||
79 | |||
80 | |||
81 | |||
82 | private: | ||
83 | Reminders m_rem; | ||
84 | Alarms m_al; | ||
85 | |||
86 | class Private; | ||
87 | Private *d; | ||
88 | |||
89 | }; | ||
90 | |||
91 | #endif | ||