KDE PIM / Developers / API Docs / libkcal

KCal::ResourceCalendar Class Reference

This class provides the interfaces for a calendar resource. More...

#include <resourcecalendar.h>

Inherits Resource.

Inherited by KCal::ResourceCached, and KCal::ResourceKABC.

List of all members.

Public Slots

Signals

Public Member Functions

Protected Member Functions

Protected Attributes


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.


Member Function Documentation

QString ResourceCalendar::infoText  )  const [virtual]
 

Return rich text with info about the resource.

Adds standard info and then calls addInfoText() to add info about concrete resources.

bool ResourceCalendar::load  ) 
 

Load resource data.

After calling this function all data is accessible by calling the incidence/event/todo/etc. accessor functions.

If 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.

bool ResourceCalendar::save Incidence incidence = 0  ) 
 

Save resource data.

After calling this function it is safe to close the resource without losing data.

If 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.

Parameters:
incidence if given as 0, doSave() is called to save all incidences, else doSave(incidence) is called to save only the given one

virtual bool KCal::ResourceCalendar::isSaving  )  [inline, virtual]
 

Return true if a save operation is still in progress, otherwise return false.

Reimplemented in KCal::ResourceKABC.

virtual KABC::Lock* KCal::ResourceCalendar::lock  )  [pure virtual]
 

Return object for locking the resource.

Implemented in KCal::ResourceKABC, and KCal::ResourceLocal.

bool ResourceCalendar::addIncidence Incidence  )  [virtual]
 

Add incidence to resource.

bool ResourceCalendar::deleteIncidence Incidence  )  [virtual]
 

Delete incidence from resource.

Incidence * ResourceCalendar::incidence const QString &  uid  ) 
 

Return incidence with given unique id.

If there is no incidence with that uid, return 0.

virtual bool KCal::ResourceCalendar::addEvent Event event  )  [pure virtual]
 

Add event to resource.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual void KCal::ResourceCalendar::deleteEvent Event  )  [pure virtual]
 

Delete event from this resource.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Event* KCal::ResourceCalendar::event const QString &  uid  )  [pure virtual]
 

Retrieves an event on the basis of the unique string ID.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Event::List KCal::ResourceCalendar::rawEvents EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
[pure virtual]
 

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, and KCal::ResourceKABC.

virtual Event::List KCal::ResourceCalendar::rawEventsForDate const QDate &  date,
bool  sorted = false
[pure virtual]
 

Builds and then returns a list of all events that match for the date specified.

useful for dayView, etc. etc.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Event::List KCal::ResourceCalendar::rawEventsForDate const QDateTime &  qdt  )  [pure virtual]
 

Get unfiltered events for date qdt.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Event::List KCal::ResourceCalendar::rawEvents const QDate &  start,
const QDate &  end,
bool  inclusive = false
[pure 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.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

void KCal::ResourceCalendar::resourceChanged ResourceCalendar  )  [signal]
 

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 become invalid the resource has given to the calling code before.

void KCal::ResourceCalendar::resourceLoaded ResourceCalendar  )  [signal]
 

This signal is emitted when loading data into the resource has been finished.

void KCal::ResourceCalendar::resourceSaved ResourceCalendar  )  [signal]
 

This signal is emitted when saving the data of the resource has been finished.

void KCal::ResourceCalendar::resourceLoadError ResourceCalendar ,
const QString &  error
[signal]
 

This signal is emitted when an error occurs during loading.

void KCal::ResourceCalendar::resourceSaveError ResourceCalendar ,
const QString &  error
[signal]
 

This signal is emitted when an error occurs during saving.

void KCal::ResourceCalendar::signalSubresourceAdded ResourceCalendar ,
const QString &  type,
const QString &  subresource,
const QString &  label
[signal]
 

This signal is emitted when a subresource is added.

void KCal::ResourceCalendar::signalSubresourceRemoved ResourceCalendar ,
const QString &  ,
const QString & 
[signal]
 

This signal is emitted when a subresource is removed.

virtual bool KCal::ResourceCalendar::addTodo Todo todo  )  [pure virtual]
 

Add a todo to the todolist.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual void KCal::ResourceCalendar::deleteTodo Todo  )  [pure virtual]
 

Remove a todo from the todolist.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Todo* KCal::ResourceCalendar::todo const QString &  uid  )  [pure virtual]
 

Searches todolist for an event with this unique id.

Returns:
pointer to todo or 0 if todo wasn't found

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Todo::List KCal::ResourceCalendar::rawTodos TodoSortField  sortField = TodoSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
[pure virtual]
 

Return list of all todos.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Todo::List KCal::ResourceCalendar::rawTodosForDate const QDate &  date  )  [pure virtual]
 

Returns list of todos due on the specified date.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual bool KCal::ResourceCalendar::addJournal Journal  )  [pure virtual]
 

Add a Journal entry to resource.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual void KCal::ResourceCalendar::deleteJournal Journal  )  [pure virtual]
 

Remove a Journal entry from calendar.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Journal* KCal::ResourceCalendar::journal const QString &  uid  )  [pure virtual]
 

Return Journal with given unique id.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Journal::List KCal::ResourceCalendar::rawJournals JournalSortField  sortField = JournalSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
[pure virtual]
 

Return list of all journals.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Journal::List KCal::ResourceCalendar::rawJournalsForDate const QDate &  date  )  [pure virtual]
 

Returns list of journals for the given date.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Alarm::List KCal::ResourceCalendar::alarms const QDateTime &  from,
const QDateTime &  to
[pure virtual]
 

Return all alarms, which ocur in the given time interval.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual Alarm::List KCal::ResourceCalendar::alarmsTo const QDateTime &  to  )  [pure virtual]
 

Return all alarms, which ocur before given date.

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

Incidence::List ResourceCalendar::rawIncidences  ) 
 

Returns a list of all incideces.

virtual void KCal::ResourceCalendar::setTimeZoneId const QString &  tzid  )  [pure virtual]
 

Set time zone id used by this resource, e.g.

"Europe/Berlin".

Implemented in KCal::ResourceCached, and KCal::ResourceKABC.

virtual QStringList KCal::ResourceCalendar::subresources  )  const [inline, virtual]
 

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.

virtual bool KCal::ResourceCalendar::subresourceActive const QString &   )  const [inline, virtual]
 

Is this subresource active or not?

virtual const QString KCal::ResourceCalendar::labelForSubresource const QString &  resource  )  const [inline, virtual]
 

What is the label for this subresource?

void ResourceCalendar::setSubresourceActive const QString &  ,
bool  active
[virtual, slot]
 

(De-)activate a subresource.

virtual bool KCal::ResourceCalendar::doLoad  )  [protected, pure virtual]
 

Do the actual loading of the resource data.

Called by load().

Implemented in KCal::ResourceKABC, and KCal::ResourceLocal.

virtual bool KCal::ResourceCalendar::doSave  )  [protected, pure virtual]
 

Do the actual saving of the resource data.

Called by save().

Implemented in KCal::ResourceKABC, and KCal::ResourceLocal.

bool ResourceCalendar::doSave Incidence  )  [protected, virtual]
 

Do the actual saving of the resource data.

Called by save(). Save one Incidence. The default implementation calls doSave() to save everything

virtual void KCal::ResourceCalendar::addInfoText QString &   )  const [inline, protected, virtual]
 

Add info text for concrete resources.

Called by infoText().

Reimplemented in KCal::ResourceCached.

void ResourceCalendar::loadError const QString &  errorMessage = QString::null  )  [protected]
 

A resource should call this function if a load error happens.

void ResourceCalendar::saveError const QString &  errorMessage = QString::null  )  [protected]
 

A resource should call this function if a save error happens.


The documentation for this class was generated from the following files: