author | mickeyl <mickeyl> | 2004-02-23 13:15:42 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-23 13:15:42 (UTC) |
commit | f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf (patch) (unidiff) | |
tree | 4044006e676c78370fdeccf960ea4214f13eabd2 /libopie2/opiepim/core/opimnotify.h | |
parent | 2d37d653310da0a9d6e2e2e6c9f5bf092e54cbbb (diff) | |
download | opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.zip opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.gz opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.bz2 |
cosmetics
Diffstat (limited to 'libopie2/opiepim/core/opimnotify.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimnotify.h | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/libopie2/opiepim/core/opimnotify.h b/libopie2/opiepim/core/opimnotify.h index fed3970..d0e40ca 100644 --- a/libopie2/opiepim/core/opimnotify.h +++ b/libopie2/opiepim/core/opimnotify.h | |||
@@ -26,14 +26,16 @@ | |||
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_NOTIFY_H | ||
30 | #define OPIE_PIM_NOTIFY_H | ||
31 | 29 | ||
30 | #ifndef OPIMNOTIFY_H | ||
31 | #define OPIMNOTIFY_H | ||
32 | |||
33 | /* QT */ | ||
32 | #include <qdatetime.h> | 34 | #include <qdatetime.h> |
33 | #include <qvaluelist.h> | 35 | #include <qvaluelist.h> |
34 | 36 | ||
35 | 37 | namespace Opie | |
36 | namespace Opie { | 38 | { |
37 | /** | 39 | /** |
38 | * This is the base class of Notifiers. Possible | 40 | * This is the base class of Notifiers. Possible |
39 | * notifiers would be Alarms, Reminders | 41 | * notifiers would be Alarms, Reminders |
@@ -47,44 +49,46 @@ namespace Opie { | |||
47 | * given on the Due/Start Date? -zecke | 49 | * given on the Due/Start Date? -zecke |
48 | * discuss: do we need a uid for the notify? -zecke | 50 | * discuss: do we need a uid for the notify? -zecke |
49 | */ | 51 | */ |
50 | class OPimNotify { | 52 | class OPimNotify |
51 | public: | 53 | { |
54 | |||
55 | public: | ||
52 | typedef QValueList<OPimNotify> ValueList; | 56 | typedef QValueList<OPimNotify> ValueList; |
53 | OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); | 57 | OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); |
54 | OPimNotify( const OPimNotify& ); | 58 | OPimNotify( const OPimNotify& ); |
55 | virtual ~OPimNotify(); | 59 | virtual ~OPimNotify(); |
56 | 60 | ||
57 | OPimNotify &operator=(const OPimNotify& ); | 61 | OPimNotify &operator=( const OPimNotify& ); |
58 | bool operator==( const OPimNotify& ); | 62 | bool operator==( const OPimNotify& ); |
59 | 63 | ||
60 | virtual QString type()const = 0; | 64 | virtual QString type() const = 0; |
61 | 65 | ||
62 | /** start date */ | 66 | /** start date */ |
63 | QDateTime dateTime()const; | 67 | QDateTime dateTime() const; |
64 | QString service()const; | 68 | QString service() const; |
65 | 69 | ||
66 | /** | 70 | /** |
67 | * RETURN the parent uid | 71 | * RETURN the parent uid |
68 | */ | 72 | */ |
69 | int parent()const; | 73 | int parent() const; |
70 | 74 | ||
71 | /** | 75 | /** |
72 | * in Seconds | 76 | * in Seconds |
73 | */ | 77 | */ |
74 | int duration()const; | 78 | int duration() const; |
75 | 79 | ||
76 | /** | 80 | /** |
77 | * Start Time + Duration | 81 | * Start Time + Duration |
78 | */ | 82 | */ |
79 | QDateTime endTime()const; | 83 | QDateTime endTime() const; |
80 | 84 | ||
81 | void setDateTime( const QDateTime& ); | 85 | void setDateTime( const QDateTime& ); |
82 | void setDuration( int dur ); | 86 | void setDuration( int dur ); |
83 | void setParent(int uid ); | 87 | void setParent( int uid ); |
84 | void setService( const QString& ); | 88 | void setService( const QString& ); |
85 | 89 | ||
86 | 90 | ||
87 | private: | 91 | private: |
88 | inline void copyIntern(); | 92 | inline void copyIntern(); |
89 | void deref(); | 93 | void deref(); |
90 | struct Data; | 94 | struct Data; |
@@ -100,25 +104,26 @@ private: | |||
100 | * at a given time to inform about | 104 | * at a given time to inform about |
101 | * an Event | 105 | * an Event |
102 | */ | 106 | */ |
103 | class OPimAlarm : public OPimNotify { | 107 | class OPimAlarm : public OPimNotify |
104 | public: | 108 | { |
105 | enum Sound{Loud=1, Silent=0, Custom=2 }; | 109 | public: |
110 | enum Sound{Loud = 1, Silent = 0, Custom = 2 }; | ||
106 | OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); | 111 | OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); |
107 | OPimAlarm( const OPimAlarm& ); | 112 | OPimAlarm( const OPimAlarm& ); |
108 | ~OPimAlarm(); | 113 | ~OPimAlarm(); |
109 | 114 | ||
110 | OPimAlarm &operator=( const OPimAlarm& ); | 115 | OPimAlarm &operator=( const OPimAlarm& ); |
111 | bool operator==( const OPimAlarm& ); | 116 | bool operator==( const OPimAlarm& ); |
112 | QString type()const; | 117 | QString type() const; |
113 | 118 | ||
114 | int sound()const; | 119 | int sound() const; |
115 | QString file()const; | 120 | QString file() const; |
116 | 121 | ||
117 | void setSound( int ); | 122 | void setSound( int ); |
118 | /* only when sound is custom... */ | 123 | /* only when sound is custom... */ |
119 | void setFile( const QString& sound ); | 124 | void setFile( const QString& sound ); |
120 | 125 | ||
121 | private: | 126 | private: |
122 | void deref(); | 127 | void deref(); |
123 | void copyIntern(); | 128 | void copyIntern(); |
124 | struct Data; | 129 | struct Data; |
@@ -135,9 +140,9 @@ private: | |||
135 | * Note that the returned dateTime() may be not valid. | 140 | * Note that the returned dateTime() may be not valid. |
136 | * In these cases one must resolve the uid and get the OEvent | 141 | * In these cases one must resolve the uid and get the OEvent |
137 | */ | 142 | */ |
138 | class OPimReminder : public OPimNotify { | 143 | class OPimReminder : public OPimNotify |
139 | public: | 144 | { |
140 | 145 | public: | |
141 | /** | 146 | /** |
142 | * c'tor of a reminder | 147 | * c'tor of a reminder |
143 | * @param uid The uid of the Record inside the Datebook | 148 | * @param uid The uid of the Record inside the Datebook |
@@ -145,12 +150,12 @@ public: | |||
145 | * @param duration The duration of the event ( -1 for all day ) | 150 | * @param duration The duration of the event ( -1 for all day ) |
146 | * @param parent The 'parent' record of this reminder | 151 | * @param parent The 'parent' record of this reminder |
147 | */ | 152 | */ |
148 | OPimReminder( int uid = 0, const QDateTime& start = QDateTime(), | 153 | OPimReminder( int uid = 0, const QDateTime& start = QDateTime(), |
149 | int duration = 0, int parent = 0 ); | 154 | int duration = 0, int parent = 0 ); |
150 | OPimReminder( const OPimReminder& ); | 155 | OPimReminder( const OPimReminder& ); |
151 | OPimReminder &operator=(const OPimReminder& ); | 156 | OPimReminder &operator=( const OPimReminder& ); |
152 | 157 | ||
153 | QString type()const; | 158 | QString type() const; |
154 | 159 | ||
155 | bool operator==( const OPimReminder& ); | 160 | bool operator==( const OPimReminder& ); |
156 | 161 | ||
@@ -158,10 +163,10 @@ public: | |||
158 | * the uid of the alarm | 163 | * the uid of the alarm |
159 | * inside the 'datebook' application | 164 | * inside the 'datebook' application |
160 | */ | 165 | */ |
161 | int recordUid()const; | 166 | int recordUid() const; |
162 | void setRecordUid( int uid ); | 167 | void setRecordUid( int uid ); |
163 | 168 | ||
164 | private: | 169 | private: |
165 | void deref(); | 170 | void deref(); |
166 | void copyIntern(); | 171 | void copyIntern(); |
167 | 172 | ||