author | zautrix <zautrix> | 2005-06-13 13:57:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-13 13:57:22 (UTC) |
commit | 56de219c5ce910a470a01a0e5003d1a113837ef4 (patch) (unidiff) | |
tree | 3393cb306cec8dcdc05d6ed0fae3ae7d374f2794 /libkcal/calendar.h | |
parent | 4f3ff02932b39bf16b9692c3cb69c101a28b4616 (diff) | |
download | kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.zip kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.gz kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.bz2 |
fixxx
-rw-r--r-- | libkcal/calendar.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 73f82bb..2243e28 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -123,251 +123,252 @@ public: | |||
123 | values). | 123 | values). |
124 | */ | 124 | */ |
125 | void setTimeZoneId( const QString & ); | 125 | void setTimeZoneId( const QString & ); |
126 | /** | 126 | /** |
127 | Return time zone id. | 127 | Return time zone id. |
128 | */ | 128 | */ |
129 | QString timeZoneId() const; | 129 | QString timeZoneId() const; |
130 | /** | 130 | /** |
131 | Use local time, not UTC or a time zone. | 131 | Use local time, not UTC or a time zone. |
132 | */ | 132 | */ |
133 | void setLocalTime(); | 133 | void setLocalTime(); |
134 | /** | 134 | /** |
135 | Return whether local time is being used. | 135 | Return whether local time is being used. |
136 | */ | 136 | */ |
137 | bool isLocalTime() const; | 137 | bool isLocalTime() const; |
138 | 138 | ||
139 | /** | 139 | /** |
140 | Add an incidence to calendar. | 140 | Add an incidence to calendar. |
141 | 141 | ||
142 | @return true on success, false on error. | 142 | @return true on success, false on error. |
143 | */ | 143 | */ |
144 | virtual bool addIncidence( Incidence * ); | 144 | virtual bool addIncidence( Incidence * ); |
145 | 145 | ||
146 | // Adds an incidence and all relatedto incidences to the cal | 146 | // Adds an incidence and all relatedto incidences to the cal |
147 | void addIncidenceBranch( Incidence * ); | 147 | void addIncidenceBranch( Incidence * ); |
148 | /** | 148 | /** |
149 | Return filtered list of all incidences of this calendar. | 149 | Return filtered list of all incidences of this calendar. |
150 | */ | 150 | */ |
151 | virtual QPtrList<Incidence> incidences(); | 151 | virtual QPtrList<Incidence> incidences(); |
152 | 152 | ||
153 | /** | 153 | /** |
154 | Return unfiltered list of all incidences of this calendar. | 154 | Return unfiltered list of all incidences of this calendar. |
155 | */ | 155 | */ |
156 | virtual QPtrList<Incidence> rawIncidences(); | 156 | virtual QPtrList<Incidence> rawIncidences(); |
157 | 157 | ||
158 | /** | 158 | /** |
159 | Adds a Event to this calendar object. | 159 | Adds a Event to this calendar object. |
160 | @param anEvent a pointer to the event to add | 160 | @param anEvent a pointer to the event to add |
161 | 161 | ||
162 | @return true on success, false on error. | 162 | @return true on success, false on error. |
163 | */ | 163 | */ |
164 | virtual bool addEventNoDup( Event *event ) = 0; | 164 | virtual bool addEventNoDup( Event *event ) = 0; |
165 | virtual bool addAnniversaryNoDup( Event *event ) = 0; | 165 | virtual bool addAnniversaryNoDup( Event *event ) = 0; |
166 | virtual bool addEvent( Event *anEvent ) = 0; | 166 | virtual bool addEvent( Event *anEvent ) = 0; |
167 | /** | 167 | /** |
168 | Delete event from calendar. | 168 | Delete event from calendar. |
169 | */ | 169 | */ |
170 | virtual void deleteEvent( Event * ) = 0; | 170 | virtual void deleteEvent( Event * ) = 0; |
171 | /** | 171 | /** |
172 | Retrieves an event on the basis of the unique string ID. | 172 | Retrieves an event on the basis of the unique string ID. |
173 | */ | 173 | */ |
174 | virtual Event *event( const QString &UniqueStr ) = 0; | 174 | virtual Event *event( const QString &UniqueStr ) = 0; |
175 | virtual Event *event( QString, QString ) = 0; | 175 | virtual Event *event( QString, QString ) = 0; |
176 | /** | 176 | /** |
177 | Builds and then returns a list of all events that match for the | 177 | Builds and then returns a list of all events that match for the |
178 | date specified. useful for dayView, etc. etc. | 178 | date specified. useful for dayView, etc. etc. |
179 | The calendar filter is applied. | 179 | The calendar filter is applied. |
180 | */ | 180 | */ |
181 | QPtrList<Event> events( const QDate &date, bool sorted = false); | 181 | QPtrList<Event> events( const QDate &date, bool sorted = false); |
182 | /** | 182 | /** |
183 | Get events, which occur on the given date. | 183 | Get events, which occur on the given date. |
184 | The calendar filter is applied. | 184 | The calendar filter is applied. |
185 | */ | 185 | */ |
186 | QPtrList<Event> events( const QDateTime &qdt ); | 186 | QPtrList<Event> events( const QDateTime &qdt ); |
187 | /** | 187 | /** |
188 | Get events in a range of dates. If inclusive is set to true, only events | 188 | Get events in a range of dates. If inclusive is set to true, only events |
189 | are returned, which are completely included in the range. | 189 | are returned, which are completely included in the range. |
190 | The calendar filter is applied. | 190 | The calendar filter is applied. |
191 | */ | 191 | */ |
192 | QPtrList<Event> events( const QDate &start, const QDate &end, | 192 | QPtrList<Event> events( const QDate &start, const QDate &end, |
193 | bool inclusive = false); | 193 | bool inclusive = false); |
194 | /** | 194 | /** |
195 | Return filtered list of all events in calendar. | 195 | Return filtered list of all events in calendar. |
196 | */ | 196 | */ |
197 | virtual QPtrList<Event> events(); | 197 | virtual QPtrList<Event> events(); |
198 | /** | 198 | /** |
199 | Return unfiltered list of all events in calendar. | 199 | Return unfiltered list of all events in calendar. |
200 | */ | 200 | */ |
201 | virtual QPtrList<Event> rawEvents() = 0; | 201 | virtual QPtrList<Event> rawEvents() = 0; |
202 | 202 | ||
203 | /** | 203 | /** |
204 | Add a todo to the todolist. | 204 | Add a todo to the todolist. |
205 | 205 | ||
206 | @return true on success, false on error. | 206 | @return true on success, false on error. |
207 | */ | 207 | */ |
208 | virtual bool addTodo( Todo *todo ) = 0; | 208 | virtual bool addTodo( Todo *todo ) = 0; |
209 | virtual bool addTodoNoDup( Todo *todo ) = 0; | 209 | virtual bool addTodoNoDup( Todo *todo ) = 0; |
210 | /** | 210 | /** |
211 | Remove a todo from the todolist. | 211 | Remove a todo from the todolist. |
212 | */ | 212 | */ |
213 | virtual void deleteTodo( Todo * ) = 0; | 213 | virtual void deleteTodo( Todo * ) = 0; |
214 | virtual void deleteJournal( Journal * ) = 0; | 214 | virtual void deleteJournal( Journal * ) = 0; |
215 | /** | 215 | /** |
216 | Return filterd list of todos. | 216 | Return filterd list of todos. |
217 | */ | 217 | */ |
218 | virtual QPtrList<Todo> todos(); | 218 | virtual QPtrList<Todo> todos(); |
219 | /** | 219 | /** |
220 | Searches todolist for an event with this unique string identifier, | 220 | Searches todolist for an event with this unique string identifier, |
221 | returns a pointer or null. | 221 | returns a pointer or null. |
222 | */ | 222 | */ |
223 | virtual Todo *todo( const QString &uid ) = 0; | 223 | virtual Todo *todo( const QString &uid ) = 0; |
224 | virtual Todo *todo( QString, QString ) = 0; | 224 | virtual Todo *todo( QString, QString ) = 0; |
225 | /** | 225 | /** |
226 | Returns list of todos due on the specified date. | 226 | Returns list of todos due on the specified date. |
227 | */ | 227 | */ |
228 | virtual QPtrList<Todo> todos( const QDate &date ) = 0; | 228 | virtual QPtrList<Todo> todos( const QDate &date ) = 0; |
229 | /** | 229 | /** |
230 | Return unfiltered list of todos. | 230 | Return unfiltered list of todos. |
231 | */ | 231 | */ |
232 | virtual QPtrList<Todo> rawTodos() = 0; | 232 | virtual QPtrList<Todo> rawTodos() = 0; |
233 | 233 | ||
234 | /** | 234 | /** |
235 | Add a Journal entry to calendar. | 235 | Add a Journal entry to calendar. |
236 | 236 | ||
237 | @return true on success, false on error. | 237 | @return true on success, false on error. |
238 | */ | 238 | */ |
239 | virtual bool addJournal( Journal * ) = 0; | 239 | virtual bool addJournal( Journal * ) = 0; |
240 | /** | 240 | /** |
241 | Return Journal for given date. | 241 | Return Journal for given date. |
242 | */ | 242 | */ |
243 | virtual Journal *journal( const QDate & ) = 0; | 243 | virtual Journal *journal( const QDate & ) = 0; |
244 | /** | 244 | /** |
245 | Return Journal with given UID. | 245 | Return Journal with given UID. |
246 | */ | 246 | */ |
247 | virtual Journal *journal( const QString &UID ) = 0; | 247 | virtual Journal *journal( const QString &UID ) = 0; |
248 | /** | 248 | /** |
249 | Return list of all Journal entries. | 249 | Return list of all Journal entries. |
250 | */ | 250 | */ |
251 | virtual QPtrList<Journal> journals() = 0; | 251 | virtual QPtrList<Journal> journals() = 0; |
252 | 252 | ||
253 | /** | 253 | /** |
254 | Searches all incidence types for an incidence with this unique | 254 | Searches all incidence types for an incidence with this unique |
255 | string identifier, returns a pointer or null. | 255 | string identifier, returns a pointer or null. |
256 | */ | 256 | */ |
257 | Incidence* incidence( const QString&UID ); | 257 | Incidence* incidence( const QString&UID ); |
258 | 258 | ||
259 | /** | 259 | /** |
260 | Setup relations for an incidence. | 260 | Setup relations for an incidence. |
261 | */ | 261 | */ |
262 | virtual void setupRelations( Incidence * ); | 262 | virtual void setupRelations( Incidence * ); |
263 | /** | 263 | /** |
264 | Remove all relations to an incidence | 264 | Remove all relations to an incidence |
265 | */ | 265 | */ |
266 | virtual void removeRelations( Incidence * ); | 266 | virtual void removeRelations( Incidence * ); |
267 | 267 | ||
268 | /** | 268 | /** |
269 | Set calendar filter, which filters events for the events() functions. | 269 | Set calendar filter, which filters events for the events() functions. |
270 | The Filter object is owned by the caller. | 270 | The Filter object is owned by the caller. |
271 | */ | 271 | */ |
272 | void setFilter( CalFilter * ); | 272 | void setFilter( CalFilter * ); |
273 | /** | 273 | /** |
274 | Return calendar filter. | 274 | Return calendar filter. |
275 | */ | 275 | */ |
276 | CalFilter *filter(); | 276 | CalFilter *filter(); |
277 | virtual QDateTime nextAlarm( int daysTo ) = 0; | 277 | virtual QDateTime nextAlarm( int daysTo ) = 0; |
278 | virtual QString nextSummary( ) const = 0; | 278 | virtual QString nextSummary( ) const = 0; |
279 | virtual void reInitAlarmSettings() = 0; | 279 | virtual void reInitAlarmSettings() = 0; |
280 | virtual QDateTime nextAlarmEventDateTime() const = 0; | 280 | virtual QDateTime nextAlarmEventDateTime() const = 0; |
281 | virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; | 281 | virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; |
282 | /** | 282 | /** |
283 | Return all alarms, which ocur in the given time interval. | 283 | Return all alarms, which ocur in the given time interval. |
284 | */ | 284 | */ |
285 | virtual Alarm::List alarms( const QDateTime &from, | 285 | virtual Alarm::List alarms( const QDateTime &from, |
286 | const QDateTime &to ) = 0; | 286 | const QDateTime &to ) = 0; |
287 | 287 | ||
288 | class Observer { | 288 | class Observer { |
289 | public: | 289 | public: |
290 | virtual void calendarModified( bool, Calendar * ) = 0; | 290 | virtual void calendarModified( bool, Calendar * ) = 0; |
291 | }; | 291 | }; |
292 | 292 | ||
293 | void registerObserver( Observer * ); | 293 | void registerObserver( Observer * ); |
294 | 294 | ||
295 | void setModified( bool ); | 295 | void setModified( bool ); |
296 | 296 | ||
297 | /** | 297 | /** |
298 | Set product id returned by loadedProductId(). This function is only | 298 | Set product id returned by loadedProductId(). This function is only |
299 | useful for the calendar loading code. | 299 | useful for the calendar loading code. |
300 | */ | 300 | */ |
301 | void setLoadedProductId( const QString & ); | 301 | void setLoadedProductId( const QString & ); |
302 | /** | 302 | /** |
303 | Return product id taken from file that has been loaded. Returns | 303 | Return product id taken from file that has been loaded. Returns |
304 | QString::null, if no calendar has been loaded. | 304 | QString::null, if no calendar has been loaded. |
305 | */ | 305 | */ |
306 | QString loadedProductId(); | 306 | QString loadedProductId(); |
307 | int defaultCalendar(); | 307 | int defaultCalendar(); |
308 | void setDontDeleteIncidencesOnClose (); | 308 | void setDontDeleteIncidencesOnClose (); |
309 | public slots: | 309 | public slots: |
310 | void setDefaultCalendar( int ); | 310 | void setDefaultCalendar( int ); |
311 | virtual void setCalendarEnabled( int id, bool enable ) = 0; | 311 | virtual void setCalendarEnabled( int id, bool enable ) = 0; |
312 | virtual void setAlarmEnabled( int id, bool enable ) = 0; | 312 | virtual void setAlarmEnabled( int id, bool enable ) = 0; |
313 | virtual void setReadOnly( int id, bool enable ) = 0; | 313 | virtual void setReadOnly( int id, bool enable ) = 0; |
314 | virtual void setDefaultCalendarEnabledOnly() = 0; | 314 | virtual void setDefaultCalendarEnabledOnly() = 0; |
315 | virtual void setCalendarRemove( int id ) = 0; | ||
315 | signals: | 316 | signals: |
316 | void calendarChanged(); | 317 | void calendarChanged(); |
317 | void calendarSaved(); | 318 | void calendarSaved(); |
318 | void calendarLoaded(); | 319 | void calendarLoaded(); |
319 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 320 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
320 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 321 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
321 | 322 | ||
322 | protected: | 323 | protected: |
323 | /** | 324 | /** |
324 | Get unfiltered events, which occur on the given date. | 325 | Get unfiltered events, which occur on the given date. |
325 | */ | 326 | */ |
326 | virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; | 327 | virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; |
327 | /** | 328 | /** |
328 | Get unfiltered events, which occur on the given date. | 329 | Get unfiltered events, which occur on the given date. |
329 | */ | 330 | */ |
330 | virtual QPtrList<Event> rawEventsForDate( const QDate &date, | 331 | virtual QPtrList<Event> rawEventsForDate( const QDate &date, |
331 | bool sorted = false ) = 0; | 332 | bool sorted = false ) = 0; |
332 | /** | 333 | /** |
333 | Get events in a range of dates. If inclusive is set to true, only events | 334 | Get events in a range of dates. If inclusive is set to true, only events |
334 | are returned, which are completely included in the range. | 335 | are returned, which are completely included in the range. |
335 | */ | 336 | */ |
336 | virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, | 337 | virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, |
337 | bool inclusive = false ) = 0; | 338 | bool inclusive = false ) = 0; |
338 | 339 | ||
339 | Incidence *mNextAlarmIncidence; | 340 | Incidence *mNextAlarmIncidence; |
340 | Incidence *mUndoIncidence; | 341 | Incidence *mUndoIncidence; |
341 | int mDefaultCalendar; | 342 | int mDefaultCalendar; |
342 | bool mDeleteIncidencesOnClose; | 343 | bool mDeleteIncidencesOnClose; |
343 | 344 | ||
344 | private: | 345 | private: |
345 | void init(); | 346 | void init(); |
346 | 347 | ||
347 | QString mOwner; // who the calendar belongs to | 348 | QString mOwner; // who the calendar belongs to |
348 | QString mOwnerEmail; // email address of the owner | 349 | QString mOwnerEmail; // email address of the owner |
349 | int mTimeZone; // timezone OFFSET from GMT (MINUTES) | 350 | int mTimeZone; // timezone OFFSET from GMT (MINUTES) |
350 | bool mLocalTime; // use local time, not UTC or a time zone | 351 | bool mLocalTime; // use local time, not UTC or a time zone |
351 | 352 | ||
352 | 353 | ||
353 | CalFilter *mFilter; | 354 | CalFilter *mFilter; |
354 | CalFilter *mDefaultFilter; | 355 | CalFilter *mDefaultFilter; |
355 | 356 | ||
356 | 357 | ||
357 | QString mTimeZoneId; | 358 | QString mTimeZoneId; |
358 | 359 | ||
359 | Observer *mObserver; | 360 | Observer *mObserver; |
360 | bool mNewObserver; | 361 | bool mNewObserver; |
361 | 362 | ||
362 | bool mModified; | 363 | bool mModified; |
363 | 364 | ||
364 | QString mLoadedProductId; | 365 | QString mLoadedProductId; |
365 | 366 | ||
366 | // This list is used to put together related todos | 367 | // This list is used to put together related todos |
367 | QDict<Incidence> mOrphans; | 368 | QDict<Incidence> mOrphans; |
368 | QDict<Incidence> mOrphanUids; | 369 | QDict<Incidence> mOrphanUids; |
369 | }; | 370 | }; |
370 | 371 | ||
371 | } | 372 | } |
372 | 373 | ||
373 | #endif | 374 | #endif |