summaryrefslogtreecommitdiffabout
path: root/libkcal/calendar.h
authorzautrix <zautrix>2005-06-10 20:13:31 (UTC)
committer zautrix <zautrix>2005-06-10 20:13:31 (UTC)
commitcdc55afb3d2c3ebd970843b7dce02acb1e6a189b (patch) (unidiff)
tree45f3bfa69a72de4e8b53bbcb2414478ec65cd183 /libkcal/calendar.h
parent31fed261955dcb25d06052a8154ac4cc630b0f7d (diff)
downloadkdepimpi-cdc55afb3d2c3ebd970843b7dce02acb1e6a189b.zip
kdepimpi-cdc55afb3d2c3ebd970843b7dce02acb1e6a189b.tar.gz
kdepimpi-cdc55afb3d2c3ebd970843b7dce02acb1e6a189b.tar.bz2
many preparations for multiple calendars
Diffstat (limited to 'libkcal/calendar.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index ab40970..4c6760f 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -209,151 +209,158 @@ public:
209 Remove a todo from the todolist. 209 Remove a todo from the todolist.
210 */ 210 */
211 virtual void deleteTodo( Todo * ) = 0; 211 virtual void deleteTodo( Todo * ) = 0;
212 virtual void deleteJournal( Journal * ) = 0; 212 virtual void deleteJournal( Journal * ) = 0;
213 /** 213 /**
214 Return filterd list of todos. 214 Return filterd list of todos.
215 */ 215 */
216 virtual QPtrList<Todo> todos(); 216 virtual QPtrList<Todo> todos();
217 /** 217 /**
218 Searches todolist for an event with this unique string identifier, 218 Searches todolist for an event with this unique string identifier,
219 returns a pointer or null. 219 returns a pointer or null.
220 */ 220 */
221 virtual Todo *todo( const QString &uid ) = 0; 221 virtual Todo *todo( const QString &uid ) = 0;
222 virtual Todo *todo( QString, QString ) = 0; 222 virtual Todo *todo( QString, QString ) = 0;
223 /** 223 /**
224 Returns list of todos due on the specified date. 224 Returns list of todos due on the specified date.
225 */ 225 */
226 virtual QPtrList<Todo> todos( const QDate &date ) = 0; 226 virtual QPtrList<Todo> todos( const QDate &date ) = 0;
227 /** 227 /**
228 Return unfiltered list of todos. 228 Return unfiltered list of todos.
229 */ 229 */
230 virtual QPtrList<Todo> rawTodos() = 0; 230 virtual QPtrList<Todo> rawTodos() = 0;
231 231
232 /** 232 /**
233 Add a Journal entry to calendar. 233 Add a Journal entry to calendar.
234 234
235 @return true on success, false on error. 235 @return true on success, false on error.
236 */ 236 */
237 virtual bool addJournal( Journal * ) = 0; 237 virtual bool addJournal( Journal * ) = 0;
238 /** 238 /**
239 Return Journal for given date. 239 Return Journal for given date.
240 */ 240 */
241 virtual Journal *journal( const QDate & ) = 0; 241 virtual Journal *journal( const QDate & ) = 0;
242 /** 242 /**
243 Return Journal with given UID. 243 Return Journal with given UID.
244 */ 244 */
245 virtual Journal *journal( const QString &UID ) = 0; 245 virtual Journal *journal( const QString &UID ) = 0;
246 /** 246 /**
247 Return list of all Journal entries. 247 Return list of all Journal entries.
248 */ 248 */
249 virtual QPtrList<Journal> journals() = 0; 249 virtual QPtrList<Journal> journals() = 0;
250 250
251 /** 251 /**
252 Searches all incidence types for an incidence with this unique 252 Searches all incidence types for an incidence with this unique
253 string identifier, returns a pointer or null. 253 string identifier, returns a pointer or null.
254 */ 254 */
255 Incidence* incidence( const QString&UID ); 255 Incidence* incidence( const QString&UID );
256 256
257 /** 257 /**
258 Setup relations for an incidence. 258 Setup relations for an incidence.
259 */ 259 */
260 virtual void setupRelations( Incidence * ); 260 virtual void setupRelations( Incidence * );
261 /** 261 /**
262 Remove all relations to an incidence 262 Remove all relations to an incidence
263 */ 263 */
264 virtual void removeRelations( Incidence * ); 264 virtual void removeRelations( Incidence * );
265 265
266 /** 266 /**
267 Set calendar filter, which filters events for the events() functions. 267 Set calendar filter, which filters events for the events() functions.
268 The Filter object is owned by the caller. 268 The Filter object is owned by the caller.
269 */ 269 */
270 void setFilter( CalFilter * ); 270 void setFilter( CalFilter * );
271 /** 271 /**
272 Return calendar filter. 272 Return calendar filter.
273 */ 273 */
274 CalFilter *filter(); 274 CalFilter *filter();
275 virtual QDateTime nextAlarm( int daysTo ) = 0; 275 virtual QDateTime nextAlarm( int daysTo ) = 0;
276 virtual QString nextSummary( ) const = 0; 276 virtual QString nextSummary( ) const = 0;
277 virtual void reInitAlarmSettings() = 0; 277 virtual void reInitAlarmSettings() = 0;
278 virtual QDateTime nextAlarmEventDateTime() const = 0; 278 virtual QDateTime nextAlarmEventDateTime() const = 0;
279 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; 279 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0;
280 /** 280 /**
281 Return all alarms, which ocur in the given time interval. 281 Return all alarms, which ocur in the given time interval.
282 */ 282 */
283 virtual Alarm::List alarms( const QDateTime &from, 283 virtual Alarm::List alarms( const QDateTime &from,
284 const QDateTime &to ) = 0; 284 const QDateTime &to ) = 0;
285 285
286 class Observer { 286 class Observer {
287 public: 287 public:
288 virtual void calendarModified( bool, Calendar * ) = 0; 288 virtual void calendarModified( bool, Calendar * ) = 0;
289 }; 289 };
290 290
291 void registerObserver( Observer * ); 291 void registerObserver( Observer * );
292 292
293 void setModified( bool ); 293 void setModified( bool );
294 294
295 /** 295 /**
296 Set product id returned by loadedProductId(). This function is only 296 Set product id returned by loadedProductId(). This function is only
297 useful for the calendar loading code. 297 useful for the calendar loading code.
298 */ 298 */
299 void setLoadedProductId( const QString & ); 299 void setLoadedProductId( const QString & );
300 /** 300 /**
301 Return product id taken from file that has been loaded. Returns 301 Return product id taken from file that has been loaded. Returns
302 QString::null, if no calendar has been loaded. 302 QString::null, if no calendar has been loaded.
303 */ 303 */
304 QString loadedProductId(); 304 QString loadedProductId();
305 305 void setDefaultCalendar( int );
306 int defaultCalendar();
307 virtual void setCalendarEnabled( int id, bool enable ) = 0;
308 virtual void setAlarmEnabled( int id, bool enable ) = 0;
309 virtual void setDefaultCalendarEnabledOnly() = 0;
306 signals: 310 signals:
307 void calendarChanged(); 311 void calendarChanged();
308 void calendarSaved(); 312 void calendarSaved();
309 void calendarLoaded(); 313 void calendarLoaded();
310 void addAlarm(const QDateTime &qdt, const QString &noti ); 314 void addAlarm(const QDateTime &qdt, const QString &noti );
311 void removeAlarm(const QDateTime &qdt, const QString &noti ); 315 void removeAlarm(const QDateTime &qdt, const QString &noti );
312 316
313 protected: 317 protected:
314 /** 318 /**
315 Get unfiltered events, which occur on the given date. 319 Get unfiltered events, which occur on the given date.
316 */ 320 */
317 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; 321 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0;
318 /** 322 /**
319 Get unfiltered events, which occur on the given date. 323 Get unfiltered events, which occur on the given date.
320 */ 324 */
321 virtual QPtrList<Event> rawEventsForDate( const QDate &date, 325 virtual QPtrList<Event> rawEventsForDate( const QDate &date,
322 bool sorted = false ) = 0; 326 bool sorted = false ) = 0;
323 /** 327 /**
324 Get events in a range of dates. If inclusive is set to true, only events 328 Get events in a range of dates. If inclusive is set to true, only events
325 are returned, which are completely included in the range. 329 are returned, which are completely included in the range.
326 */ 330 */
327 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 331 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
328 bool inclusive = false ) = 0; 332 bool inclusive = false ) = 0;
333
329 Incidence *mNextAlarmIncidence; 334 Incidence *mNextAlarmIncidence;
330 Incidence *mUndoIncidence; 335 Incidence *mUndoIncidence;
336 int mDefaultCalendar;
331 337
332private: 338private:
333 void init(); 339 void init();
334 340
335 QString mOwner; // who the calendar belongs to 341 QString mOwner; // who the calendar belongs to
336 QString mOwnerEmail; // email address of the owner 342 QString mOwnerEmail; // email address of the owner
337 int mTimeZone; // timezone OFFSET from GMT (MINUTES) 343 int mTimeZone; // timezone OFFSET from GMT (MINUTES)
338 bool mLocalTime; // use local time, not UTC or a time zone 344 bool mLocalTime; // use local time, not UTC or a time zone
339 345
340 CalFilter *mFilter; 346 CalFilter *mFilter;
341 CalFilter *mDefaultFilter; 347 CalFilter *mDefaultFilter;
348
342 349
343 QString mTimeZoneId; 350 QString mTimeZoneId;
344 351
345 Observer *mObserver; 352 Observer *mObserver;
346 bool mNewObserver; 353 bool mNewObserver;
347 354
348 bool mModified; 355 bool mModified;
349 356
350 QString mLoadedProductId; 357 QString mLoadedProductId;
351 358
352 // This list is used to put together related todos 359 // This list is used to put together related todos
353 QDict<Incidence> mOrphans; 360 QDict<Incidence> mOrphans;
354 QDict<Incidence> mOrphanUids; 361 QDict<Incidence> mOrphanUids;
355}; 362};
356 363
357} 364}
358 365
359#endif 366#endif