libkcal
KCal::ResourceCalendar Class Reference
#include <resourcecalendar.h>
Inheritance diagram for KCal::ResourceCalendar:

Detailed Description
This class provides the interfaces for a calendar resource.It makes use of the kresources framework.
- Warning:
- This code is still under heavy development. Don't expect source or binary compatibility in future versions.
Definition at line 56 of file resourcecalendar.h.
Public Slots | |
virtual void | setSubresourceActive (const QString &, bool active) |
Signals | |
void | resourceChanged (ResourceCalendar *) |
void | resourceLoaded (ResourceCalendar *) |
void | resourceSaved (ResourceCalendar *) |
void | resourceLoadError (ResourceCalendar *, const QString &error) |
void | resourceSaveError (ResourceCalendar *, const QString &error) |
void | signalSubresourceAdded (ResourceCalendar *, const QString &type, const QString &subresource, const QString &label) |
void | signalSubresourceRemoved (ResourceCalendar *, const QString &, const QString &) |
Public Member Functions | |
ResourceCalendar (const KConfig *) | |
virtual | ~ResourceCalendar () |
void | setResolveConflict (bool b) |
virtual void | writeConfig (KConfig *config) |
virtual QString | infoText () const |
bool | load () |
bool | save (Incidence *incidence=0) |
virtual bool | isSaving () |
virtual KABC::Lock * | lock ()=0 |
virtual bool | addIncidence (Incidence *) |
virtual bool | deleteIncidence (Incidence *) |
Incidence * | incidence (const QString &uid) |
virtual bool | addEvent (Event *event)=0 |
virtual bool | deleteEvent (Event *)=0 |
virtual Event * | event (const QString &uid)=0 |
virtual Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event::List | rawEventsForDate (const QDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event::List | rawEventsForDate (const QDateTime &qdt)=0 |
virtual Event::List | rawEvents (const QDate &start, const QDate &end, bool inclusive=false)=0 |
virtual bool | setValue (const QString &key, const QString &value) |
virtual bool | addTodo (Todo *todo)=0 |
virtual bool | deleteTodo (Todo *)=0 |
virtual Todo * | todo (const QString &uid)=0 |
virtual Todo::List | rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Todo::List | rawTodosForDate (const QDate &date)=0 |
virtual bool | addJournal (Journal *)=0 |
virtual bool | deleteJournal (Journal *)=0 |
virtual Journal * | journal (const QString &uid)=0 |
virtual Journal::List | rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Journal::List | rawJournalsForDate (const QDate &date)=0 |
virtual Alarm::List | alarms (const QDateTime &from, const QDateTime &to)=0 |
virtual Alarm::List | alarmsTo (const QDateTime &to)=0 |
Incidence::List | rawIncidences () |
virtual void | setTimeZoneId (const QString &timeZoneId)=0 |
virtual QStringList | subresources () const |
virtual bool | subresourceActive (const QString &) const |
virtual const QString | labelForSubresource (const QString &resource) const |
virtual QString | subresourceIdentifier (Incidence *incidence) |
Protected Member Functions | |
virtual bool | doLoad ()=0 |
virtual bool | doSave ()=0 |
virtual bool | doSave (Incidence *) |
virtual void | addInfoText (QString &) const |
void | loadError (const QString &errorMessage=QString::null) |
void | saveError (const QString &errorMessage=QString::null) |
Protected Attributes | |
bool | mResolveConflict |
Member Function Documentation
|
Add event to resource.
Implemented in KCal::ResourceCached. |
|
Add incidence to resource.
Definition at line 81 of file resourcecalendar.cpp. |
|
Add info text for concrete resources. Called by infoText(). Reimplemented in KCal::ResourceCached. Definition at line 366 of file resourcecalendar.h. |
|
Add a Journal entry to the resource.
Implemented in KCal::ResourceCached. |
|
Add a todo to the todolist.
Implemented in KCal::ResourceCached. |
|
Return all alarms which occur in the given time interval.
Implemented in KCal::ResourceCached. |
|
Return all alarms which occur before given date.
Implemented in KCal::ResourceCached. |
|
Delete event from this resource.
Implemented in KCal::ResourceCached, and KCal::ResourceLocalDir. |
|
Delete incidence from resource.
Definition at line 87 of file resourcecalendar.cpp. |
|
Remove a Journal entry from calendar.
Implemented in KCal::ResourceCached, and KCal::ResourceLocalDir. |
|
Remove a todo from the todolist.
Implemented in KCal::ResourceCached, and KCal::ResourceLocalDir. |
|
Do the actual loading of the resource data. Called by load(). Implemented in KCal::ResourceLocal, and KCal::ResourceLocalDir. |
|
Do the actual saving of the resource data. Called by save(). Save one Incidence. The default implementation calls doSave() to save everything Reimplemented in KCal::ResourceLocalDir. Definition at line 163 of file resourcecalendar.cpp. |
|
Do the actual saving of the resource data. Called by save(). Implemented in KCal::ResourceLocal, and KCal::ResourceLocalDir. |
|
Retrieves an event on the basis of the unique string ID.
Implemented in KCal::ResourceCached. |
|
Return incidence with given unique id. If there is no incidence with that uid, return 0. Definition at line 71 of file resourcecalendar.cpp. |
|
Return rich text with info about the resource. Adds standard info and then calls addInfoText() to add info about concrete resources. Definition at line 48 of file resourcecalendar.cpp. |
|
Return true if a save operation is still in progress, otherwise return false.
Definition at line 117 of file resourcecalendar.h. |
|
Return Journal with given unique id.
Implemented in KCal::ResourceCached. |
|
What is the label for this subresource?
Definition at line 324 of file resourcecalendar.h. |
|
Load resource data. After calling this function all data is accessible by calling the incidence/event/todo/etc. accessor functions. Whether data is actually loaded within this function or the loading is delayed until it is accessed by another function depends on the implementation of the resource. If loading the data takes significant time, the resource should return cached values if available, and return the results via the resourceChanged signal. When the resource has finished loading, the resourceLoaded() signal is emitted. Calling this function multiple times should have the same effect as calling it once, given that the data isn't changed between calls. This function calls doLoad() which has to be reimplented by the resource to do the actual loading. Definition at line 102 of file resourcecalendar.cpp. |
|
A resource should call this function if a load error happens.
Definition at line 131 of file resourcecalendar.cpp. |
|
Return object for locking the resource.
Implemented in KCal::ResourceLocal, and KCal::ResourceLocalDir. |
|
Get unfiltered events in a range of dates. If inclusive is set to true, only events which are completely included in the range are returned. Implemented in KCal::ResourceCached. |
|
Return unfiltered list of all events in calendar. Use with care, this can be a bad idea for server-based calendars. Implemented in KCal::ResourceCached. |
|
Get unfiltered events for date qdt.
Implemented in KCal::ResourceCached. |
|
Builds and then returns a list of all events that match the date specified. Useful for dayView, etc. etc. Implemented in KCal::ResourceCached. |
|
Returns a list of all incideces.
Definition at line 93 of file resourcecalendar.cpp. |
|
Return list of all journals.
Implemented in KCal::ResourceCached. |
|
Returns list of journals for the given date.
Implemented in KCal::ResourceCached. |
|
Return list of all todos.
Implemented in KCal::ResourceCached. |
|
Returns list of todos due on the specified date.
Implemented in KCal::ResourceCached. |
|
This signal is emitted when the data in the resource has changed. The resource has to make sure that this signal is emitted whenever any pointers to incidences which the resource has previously given to the calling code, become invalid. |
|
This signal is emitted when loading data into the resource has been finished.
|
|
This signal is emitted when an error occurs during loading.
|
|
This signal is emitted when saving the data of the resource has been finished.
|
|
This signal is emitted when an error occurs during saving.
|
|
Save resource data. After calling this function it is safe to close the resource without losing data. Whether data is actually saved within this function or saving is delayed depends on the implementation of the resource. If saving the data takes significant time, the resource should return from the function, do the saving in the background and notify the end of the save by emitting the signal resourceSaved(). This function calls doSave() which has to be reimplented by the resource to do the actual saving.
Definition at line 144 of file resourcecalendar.cpp. |
|
A resource should call this function if a save error happens.
Definition at line 168 of file resourcecalendar.cpp. |
|
(De-)activate a subresource.
Definition at line 98 of file resourcecalendar.cpp. |
|
Set time zone id used by this resource, e.g. "Europe/Berlin". Implemented in KCal::ResourceCached. |
|
Sets a particular value of the resource's configuration. The possible keys are resource specific. This method is provided to make it possible to set resource-type specific settings without actually linking to the resource's library. Its use is discouraged, but in some situations the only possibility to avoid unwanted compiling and linking dependencies. E.g. if you don't want to link to the remote resource, but need to create a remote resource at the URL given in yourURL, you can use code like the following: KCal::ResourceCalendar *res = manager->createResource( "remote" ); if ( res ) { res->setTimeZoneId( timezone ); res->setResourceName( i18n("Test resource") ); res->setValue( "DownloadURL", yourURL ); manager->add( res ); } Reimplemented in KCal::ResourceLocal. Definition at line 181 of file resourcecalendar.cpp. |
|
This signal is emitted when a subresource is added.
|
|
This signal is emitted when a subresource is removed.
|
|
Is this subresource active or not?
Definition at line 319 of file resourcecalendar.h. |
|
Get the identifier of the subresource associated with a specified incidence.
Definition at line 336 of file resourcecalendar.h. |
|
If this resource has subresources, return a QStringList of them. In most cases, resources do not have subresources, so this is by default just empty. Definition at line 314 of file resourcecalendar.h. |
|
Searches todolist for an event with this unique id.
Implemented in KCal::ResourceCached. |
The documentation for this class was generated from the following files: