22 #ifndef KCAL_RESOURCECACHED_H
23 #define KCAL_RESOURCECACHED_H
25 #include "resourcecalendar.h"
28 #include <kdatetime.h>
30 #include <QtCore/QString>
33 namespace KRES {
class IdMapper; }
85 void readConfig(
const KConfigGroup &group );
86 void writeConfig( KConfigGroup &group );
95 void setReloadPolicy(
int policy );
101 int reloadPolicy()
const;
107 void setReloadInterval(
int minutes );
112 int reloadInterval()
const;
122 bool inhibitDefaultReload(
bool inhibit );
123 bool defaultReloadInhibited()
const;
128 bool reloaded()
const;
139 void setSavePolicy(
int policy );
145 int savePolicy()
const;
151 void setSaveInterval(
int minutes );
156 int saveInterval()
const;
161 KDateTime lastLoad()
const;
166 KDateTime lastSave()
const;
174 bool load( CacheAction action );
191 bool save( CacheAction action,
Incidence *incidence = 0 );
196 virtual bool save(
Incidence *incidence = 0 );
203 bool addEvent(
Event *event );
208 bool deleteEvent(
Event *event );
213 void deleteAllEvents();
228 Event::List rawEvents( EventSortField sortField = EventSortUnsorted,
229 SortDirection sortDirection = SortDirectionAscending );
241 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
242 EventSortField sortField = EventSortUnsorted,
243 SortDirection sortDirection = SortDirectionAscending );
248 Event::List rawEventsForDate(
const KDateTime &dt );
261 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
262 bool inclusive =
false );
269 bool addTodo(
Todo *todo );
274 bool deleteTodo(
Todo * );
279 void deleteAllTodos();
290 Todo::List rawTodos( TodoSortField sortField = TodoSortUnsorted,
291 SortDirection sortDirection = SortDirectionAscending );
303 virtual KCAL_DEPRECATED
bool addJournal(
Journal *journal );
308 virtual bool deleteJournal(
Journal * );
313 virtual void deleteAllJournals();
323 Journal::List rawJournals( JournalSortField sortField = JournalSortUnsorted,
324 SortDirection sortDirection = SortDirectionAscending );
334 Alarm::List alarms(
const KDateTime &from,
const KDateTime &to );
347 void setTimeSpec(
const KDateTime::Spec &timeSpec );
354 KDateTime::Spec timeSpec()
const;
362 void setTimeZoneId(
const QString &timeZoneId );
376 virtual void shiftTimes(
const KDateTime::Spec &oldSpec,
const KDateTime::Spec &newSpec );
387 void setOwner(
const Person &owner );
389 void enableChangeNotification();
390 void disableChangeNotification();
392 void clearChange(
Incidence *incidence );
393 void clearChange(
const QString &uid );
397 bool hasChanges()
const;
409 bool loadFromCache();
443 virtual void doClose();
450 virtual bool doOpen();
455 virtual bool doLoad(
bool syncCache ) = 0;
463 void setReloaded(
bool done );
473 virtual bool doSave(
bool syncCache ) = 0;
484 virtual bool doSave(
bool syncCache,
Incidence *incidence );
489 bool checkForReload();
496 void checkForAutomaticSave();
498 void addInfoText(
QString & )
const;
500 void setupSaveTimer();
501 void setupReloadTimer();
507 virtual QString cacheFile()
const;
514 void loadChangesCache();
516 void saveChangesCache();
522 void setIdMapperIdentifier();
save when the resource is closed
Provides a To-do in the sense of RFC2445.
use the default action set by setReloadPolicy() or setSavePolicy()
perform a cache-only operation, without downloading or uploading
This class provides an Event in the sense of RFC2445.
never reload the resource automatically
never save the resource automatically
This class provides a calendar stored as a local file.
This class provides the interfaces for a calendar resource.
virtual bool event(QEvent *e)
The CalendarObserver class.
save after every change, after a 15 second delay
reload when the resource is opened
Represents a person, by name ane email address.
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
This class provides a template for lists of pointers.
Provides a Journal in the sense of RFC2445.
This file is part of the API for handling calendar data and defines the Incidence class...
This class provides a calendar resource using a local CalendarLocal object to cache the calendar data...
CacheAction
Whether to update the cache file when loading a resource, or whether to upload the cache file after s...
save at regular intervals set by setSaveInterval()