#include <resourcecached.h>
Public Types | |
enum | { ReloadNever , ReloadOnStartup , ReloadInterval } |
enum | { SaveNever , SaveOnExit , SaveInterval , SaveDelayed , SaveAlways } |
Public Member Functions | |
ResourceCached (const TDEConfig *) | |
void | readConfig (const TDEConfig *config) |
void | writeConfig (TDEConfig *config) |
void | setReloadPolicy (int policy) |
int | reloadPolicy () const |
void | setReloadInterval (int minutes) |
int | reloadInterval () const |
void | setSavePolicy (int policy) |
int | savePolicy () const |
void | setSaveInterval (int minutes) |
int | saveInterval () const |
TQDateTime | lastLoad () const |
TQDateTime | lastSave () const |
TDE_DEPRECATED bool | addEvent (Event *event) |
bool | addEvent (Event *event, const TQString &subresource) |
bool | deleteEvent (Event *) |
Event * | event (const TQString &UniqueStr) |
Event::List | events () |
Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEventsForDate (const TQDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEventsForDate (const TQDateTime &qdt) |
Event::List | rawEvents (const TQDate &start, const TQDate &end, bool inclusive=false) |
TDE_DEPRECATED bool | addTodo (Todo *todo) |
bool | addTodo (Todo *todo, const TQString &subresource) |
bool | deleteTodo (Todo *) |
Todo * | todo (const TQString &uid) |
Todo::List | rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Todo::List | rawTodosForDate (const TQDate &date) |
TDE_DEPRECATED bool | addJournal (Journal *journal) |
bool | addJournal (Journal *journal, const TQString &subresource) |
bool | deleteJournal (Journal *) |
Journal * | journal (const TQString &uid) |
Journal::List | rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Journal::List | rawJournalsForDate (const TQDate &date) |
Alarm::List | alarms (const TQDateTime &from, const TQDateTime &to) |
Alarm::List | alarmsTo (const TQDateTime &to) |
void | setTimeZoneId (const TQString &timeZoneId) |
TQString | timeZoneId () const |
const Person & | getOwner () const |
void | setOwner (const Person &owner) |
void | enableChangeNotification () |
void | disableChangeNotification () |
void | clearChange (Incidence *) |
void | clearChange (const TQString &uid) |
void | clearChanges () |
bool | hasChanges () const |
Incidence::List | allChanges () const |
Incidence::List | addedIncidences () const |
Incidence::List | changedIncidences () const |
Incidence::List | deletedIncidences () const |
void | loadCache () |
void | saveCache () |
void | clearCache () |
void | clearEventsCache () |
void | clearTodosCache () |
void | clearJournalsCache () |
void | cleanUpEventCache (const KCal::Event::List &eventList) |
void | cleanUpTodoCache (const KCal::Todo::List &todoList) |
KPIM::IdMapper & | idMapper () |
Public Member Functions inherited from KCal::ResourceCalendar | |
ResourceCalendar (const TDEConfig *) | |
void | clearException () |
void | setException (ErrorFormat *error) |
ErrorFormat * | exception () |
void | setResolveConflict (bool b) |
virtual TQString | infoText () const |
bool | load () |
bool | save (Incidence *incidence=0) |
virtual bool | isSaving () |
virtual TDEABC::Lock * | lock ()=0 |
virtual TDE_DEPRECATED bool | addIncidence (Incidence *) |
virtual bool | addIncidence (Incidence *, const TQString &subresource) |
virtual bool | deleteIncidence (Incidence *) |
Incidence * | incidence (const TQString &uid) |
virtual bool | setValue (const TQString &key, const TQString &value) |
Incidence::List | rawIncidences () |
virtual TQStringList | subresources () const |
virtual bool | canHaveSubresources () const |
virtual bool | subresourceActive (const TQString &) const |
virtual bool | subresourceWritable (const TQString &) const |
virtual const TQString | labelForSubresource (const TQString &resource) const |
virtual TQString | subresourceIdentifier (Incidence *incidence) |
virtual bool | removeSubresource (const TQString &resource) |
virtual bool | addSubresource (const TQString &resource, const TQString &parent) |
virtual TQString | subresourceType (const TQString &resource) |
virtual void | beginAddingIncidences () |
virtual void | endAddingIncidences () |
Public Member Functions inherited from KCal::Calendar::Observer | |
virtual void | calendarModified (bool, Calendar *) |
Static Public Member Functions | |
static bool | editorWindowOpen () |
static void | setEditorWindowOpen (bool open) |
Protected Slots | |
void | slotReload () |
void | slotSave () |
void | setIdMapperIdentifier () |
Protected Member Functions | |
void | calendarIncidenceAdded (KCal::Incidence *incidence) |
void | calendarIncidenceChanged (KCal::Incidence *incidence) |
void | calendarIncidenceDeleted (KCal::Incidence *incidence) |
virtual void | doClose () |
virtual bool | doOpen () |
bool | checkForReload () |
bool | checkForSave () |
void | checkForAutomaticSave () |
void | addInfoText (TQString &) const |
void | setupSaveTimer () |
void | setupReloadTimer () |
virtual TQString | cacheFile () const |
virtual TQString | changesCacheFile (const TQString &) const |
void | loadChangesCache (TQMap< Incidence *, bool > &, const TQString &) |
void | loadChangesCache () |
void | saveChangesCache (const TQMap< Incidence *, bool > &, const TQString &) |
void | saveChangesCache () |
Protected Member Functions inherited from KCal::ResourceCalendar | |
virtual bool | doLoad ()=0 |
virtual bool | doSave ()=0 |
virtual bool | doSave (Incidence *) |
void | loadError (const TQString &errorMessage=TQString()) |
void | saveError (const TQString &errorMessage=TQString()) |
Protected Attributes | |
CalendarLocal | mCalendar |
Protected Attributes inherited from KCal::ResourceCalendar | |
bool | mResolveConflict |
Additional Inherited Members | |
Public Slots inherited from KCal::ResourceCalendar | |
virtual void | setSubresourceActive (const TQString &, bool active) |
Signals inherited from KCal::ResourceCalendar | |
void | resourceChanged (ResourceCalendar *) |
void | resourceLoaded (ResourceCalendar *) |
void | resourceSaved (ResourceCalendar *) |
void | resourceLoadError (ResourceCalendar *, const TQString &error) |
void | resourceSaveError (ResourceCalendar *, const TQString &error) |
void | signalSubresourceAdded (ResourceCalendar *, const TQString &type, const TQString &subresource, const TQString &label) |
void | signalSubresourceRemoved (ResourceCalendar *, const TQString &, const TQString &) |
Detailed Description
This class provides a calendar resource using a local CalendarLocal object to cache the calendar data.
Definition at line 45 of file resourcecached.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Reload policy.
- See also
- setReloadPolicy(), reloadPolicy()
Definition at line 56 of file resourcecached.h.
◆ anonymous enum
anonymous enum |
Member Function Documentation
◆ addEvent()
|
virtual |
Add event to calendar.
Implements KCal::ResourceCalendar.
Definition at line 159 of file resourcecached.cpp.
◆ addInfoText()
|
protectedvirtual |
Add info text for concrete resources.
Called by infoText().
Reimplemented from KCal::ResourceCalendar.
Definition at line 687 of file resourcecached.cpp.
◆ addJournal()
|
virtual |
Add a Journal entry to calendar.
Implements KCal::ResourceCalendar.
Definition at line 246 of file resourcecached.cpp.
◆ addTodo()
|
virtual |
Add a todo to the todolist.
Implements KCal::ResourceCalendar.
Definition at line 209 of file resourcecached.cpp.
◆ alarms()
|
virtual |
Return all alarms, which ocur in the given time interval.
Implements KCal::ResourceCalendar.
Definition at line 278 of file resourcecached.cpp.
◆ alarmsTo()
|
virtual |
Return all alarms, which ocur before given date.
Implements KCal::ResourceCalendar.
Definition at line 273 of file resourcecached.cpp.
◆ cacheFile()
|
protectedvirtual |
This method is used by loadCache() and saveCache(), reimplement it to change the location of the cache.
Definition at line 418 of file resourcecached.cpp.
◆ calendarIncidenceAdded()
|
protectedvirtual |
Notify the Observer that an Incidence has been inserted.
First parameter is a pointer to the Incidence that was inserted.
Reimplemented from KCal::Calendar::Observer.
Definition at line 480 of file resourcecached.cpp.
◆ calendarIncidenceChanged()
|
protectedvirtual |
Notify the Observer that an Incidence has been modified.
First parameter is a pointer to the Incidence that was modified.
Reimplemented from KCal::Calendar::Observer.
Definition at line 496 of file resourcecached.cpp.
◆ calendarIncidenceDeleted()
|
protectedvirtual |
Notify the Observer that an Incidence has been removed.
First parameter is a pointer to the Incidence that was removed.
Reimplemented from KCal::Calendar::Observer.
Definition at line 513 of file resourcecached.cpp.
◆ changesCacheFile()
|
protectedvirtual |
Functions for keeping the changes persistent.
Definition at line 423 of file resourcecached.cpp.
◆ checkForReload()
|
protected |
Check if reload required according to reload policy.
Definition at line 674 of file resourcecached.cpp.
◆ checkForSave()
|
protected |
Check if save required according to save policy.
Definition at line 681 of file resourcecached.cpp.
◆ clearCache()
void ResourceCached::clearCache | ( | ) |
Clear cache.
Definition at line 334 of file resourcecached.cpp.
◆ clearEventsCache()
void ResourceCached::clearEventsCache | ( | ) |
Clear events cache.
Definition at line 339 of file resourcecached.cpp.
◆ clearJournalsCache()
void ResourceCached::clearJournalsCache | ( | ) |
Clear journals cache.
Definition at line 349 of file resourcecached.cpp.
◆ clearTodosCache()
void ResourceCached::clearTodosCache | ( | ) |
Clear todos cache.
Definition at line 344 of file resourcecached.cpp.
◆ deleteEvent()
|
virtual |
Deletes an event from this calendar.
Implements KCal::ResourceCalendar.
Definition at line 171 of file resourcecached.cpp.
◆ deleteJournal()
|
virtual |
Remove a Journal from the calendar.
Implements KCal::ResourceCalendar.
Definition at line 225 of file resourcecached.cpp.
◆ deleteTodo()
|
virtual |
Remove a todo from the todolist.
Implements KCal::ResourceCalendar.
Definition at line 220 of file resourcecached.cpp.
◆ doClose()
|
protectedvirtual |
Virtual method from KRES::Resource, called when the last instace of the resource is closed.
Definition at line 701 of file resourcecached.cpp.
◆ doOpen()
|
protectedvirtual |
Opens the resource.
Dummy implementation, so child classes don't have to reimplement this method. By default, this does not do anything, but can be reimplemented in child classes
Definition at line 706 of file resourcecached.cpp.
◆ event()
|
virtual |
Retrieves an event on the basis of the unique string ID.
Implements KCal::ResourceCalendar.
Definition at line 179 of file resourcecached.cpp.
◆ events()
Event::List KCal::ResourceCached::events | ( | ) |
Return filtered list of all events in calendar.
◆ getOwner()
const Person & KCal::ResourceCached::getOwner | ( | ) | const |
Return the owner of the calendar's full name.
Definition at line 717 of file resourcecached.cpp.
◆ idMapper()
KPIM::IdMapper & ResourceCached::idMapper | ( | ) |
Returns a reference to the id mapper.
Definition at line 413 of file resourcecached.cpp.
◆ journal()
|
virtual |
Return Journal with given unique id.
Implements KCal::ResourceCalendar.
Definition at line 257 of file resourcecached.cpp.
◆ lastLoad()
TQDateTime KCal::ResourceCached::lastLoad | ( | ) | const |
Return time of last load.
◆ lastSave()
TQDateTime KCal::ResourceCached::lastSave | ( | ) | const |
Return time of last save.
◆ loadCache()
void ResourceCached::loadCache | ( | ) |
Loads the cache, this method should be called on load.
Definition at line 302 of file resourcecached.cpp.
◆ rawEvents() [1/2]
|
virtual |
Get unfiltered events in a range of dates.
If inclusive is set to true, only events are returned, which are completely included in the range.
Implements KCal::ResourceCalendar.
Definition at line 193 of file resourcecached.cpp.
◆ rawEvents() [2/2]
|
virtual |
Return unfiltered list of all events in calendar.
Implements KCal::ResourceCalendar.
Definition at line 204 of file resourcecached.cpp.
◆ rawEventsForDate() [1/2]
|
virtual |
Builds and then returns a list of all events that match for the date specified.
useful for dayView, etc. etc.
Implements KCal::ResourceCalendar.
Definition at line 184 of file resourcecached.cpp.
◆ rawEventsForDate() [2/2]
|
virtual |
Get unfiltered events for date qdt.
Implements KCal::ResourceCalendar.
Definition at line 199 of file resourcecached.cpp.
◆ rawJournals()
|
virtual |
Return list of all journals.
Implements KCal::ResourceCalendar.
Definition at line 262 of file resourcecached.cpp.
◆ rawJournalsForDate()
|
virtual |
Return list of journals for the given date.
Implements KCal::ResourceCalendar.
Definition at line 267 of file resourcecached.cpp.
◆ rawTodos()
|
virtual |
Return list of all todos.
Implements KCal::ResourceCalendar.
Definition at line 231 of file resourcecached.cpp.
◆ rawTodosForDate()
|
virtual |
Returns list of todos due on the specified date.
Implements KCal::ResourceCalendar.
Definition at line 241 of file resourcecached.cpp.
◆ reloadInterval()
int ResourceCached::reloadInterval | ( | ) | const |
Return reload interval in minutes.
Definition at line 83 of file resourcecached.cpp.
◆ reloadPolicy()
int ResourceCached::reloadPolicy | ( | ) | const |
◆ saveCache()
void ResourceCached::saveCache | ( | ) |
Saves the cache back.
Definition at line 319 of file resourcecached.cpp.
◆ saveInterval()
int ResourceCached::saveInterval | ( | ) | const |
Return save interval in minutes.
Definition at line 105 of file resourcecached.cpp.
◆ savePolicy()
int ResourceCached::savePolicy | ( | ) | const |
◆ setOwner()
void KCal::ResourceCached::setOwner | ( | const Person & | owner | ) |
Set the owner of the calendar.
Should be owner's full name.
Definition at line 712 of file resourcecached.cpp.
◆ setReloadInterval()
void ResourceCached::setReloadInterval | ( | int | minutes | ) |
Set reload interval in minutes which is used when reload policy is ReloadInterval.
Definition at line 78 of file resourcecached.cpp.
◆ setReloadPolicy()
void ResourceCached::setReloadPolicy | ( | int | policy | ) |
Set reload policy.
This controls when the cache is refreshed.
ReloadNever never reload ReloadOnStartup reload when resource is started ReloadInterval reload regularly after given interval
Definition at line 66 of file resourcecached.cpp.
◆ setSaveInterval()
void ResourceCached::setSaveInterval | ( | int | minutes | ) |
Set save interval in minutes which is used when save policy is SaveInterval.
Definition at line 100 of file resourcecached.cpp.
◆ setSavePolicy()
void ResourceCached::setSavePolicy | ( | int | policy | ) |
Set save policy.
This controls when the cache is refreshed.
SaveNever never save SaveOnExit save when resource is exited SaveInterval save regularly after given interval SaveDelayed save after small delay SaveAlways save on every change
Definition at line 88 of file resourcecached.cpp.
◆ setTimeZoneId()
|
virtual |
Set id of timezone, e.g.
"Europe/Berlin"
Implements KCal::ResourceCalendar.
Definition at line 285 of file resourcecached.cpp.
◆ todo()
|
virtual |
Searches todolist for an event with this unique string identifier, returns a pointer or null.
Implements KCal::ResourceCalendar.
Definition at line 236 of file resourcecached.cpp.
The documentation for this class was generated from the following files: