KDE PIM / Developers / API Docs / libkcal

KCal::Calendar Class Reference

This is the main "calendar" object class for KOrganizer. More...

#include <calendar.h>

Inherits QObject, KCal::CustomProperties, and KCal::IncidenceBase::Observer.

Inherited by KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

List of all members.

Signals

Public Member Functions

Static Public Member Functions

Protected Member Functions


Detailed Description

This is the main "calendar" object class for KOrganizer.

It holds information like all appointments/events, user information, etc. etc. one calendar is associated with each CalendarView (

See also:
calendarview.h ). This is an abstract base class defining the interface to a calendar. It is implemented by subclasses like

CalendarLocal, which use different methods to store and access the data.

Ownership of events etc. is handled by the following policy: As soon as an event (or any other subclass of IncidenceBase) object is added to the Calendar by addEvent() it is owned by the Calendar object. The Calendar takes care of deleting it. All Events returned by the query functions are returned as pointers, that means all changes to the returned events are immediately visible in the Calendar. You shouldn't delete any Event object you get from Calendar.


Member Function Documentation

virtual void KCal::Calendar::close (   )  [pure virtual]
 

Clears out the current calendar, freeing all used memory etc.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual void KCal::Calendar::save (   )  [pure virtual]
 

Sync changes in memory to persistant storage.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

const Person & Calendar::getOwner (   )  const
 

Return the owner of the calendar's full name.

void Calendar::setOwner (  const Person &  owner  ) 
 

Set the owner of the calendar.

Should be owner's full name.

void Calendar::setTimeZoneId (  const QString &   ) 
 

Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal values).

QString Calendar::timeZoneId (   )  const
 

Return time zone id.

void Calendar::setLocalTime (   ) 
 

Use local time, not UTC or a time zone.

bool Calendar::isLocalTime (   )  const
 

Return whether local time is being used.

Event::List Calendar::sortEvents (  Event::List *  eventList,
EventSortField  sortField,
SortDirection  sortDirection
)  [static]
 

Sort eventList according to sortField.

Todo::List Calendar::sortTodos (  Todo::List *  todoList,
TodoSortField  sortField,
SortDirection  sortDirection
)  [static]
 

Sort todoList according to sortField.

Journal::List Calendar::sortJournals (  Journal::List *  journalList,
JournalSortField  sortField,
SortDirection  sortDirection
)  [static]
 

Sort journalList according to sortField.

bool Calendar::addIncidence (  Incidence *   )  [virtual]
 

Add an incidence to calendar.

Returns:
true on success, false on error.

Reimplemented in KCal::CalendarResources.

bool Calendar::deleteIncidence (  Incidence *   )  [virtual]
 

Delete an incidence from calendar.

Returns:
true on success, false on error.

Incidence::List Calendar::incidences (   )  [virtual]
 

Return filtered list of all incidences of this calendar.

Incidence::List Calendar::rawIncidences (   )  [virtual]
 

Return unfiltered list of all incidences of this calendar.

QStringList Calendar::incidenceCategories (   ) 
 

Return a list of all categories used in this calendar.

virtual bool KCal::Calendar::addEvent (  Event *   )  [pure virtual]
 

Adds a Event to this calendar object.

Returns:
true on success, false on error.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual void KCal::Calendar::deleteEvent (  Event *   )  [pure virtual]
 

Delete event from calendar.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual Event* KCal::Calendar::event (  const QString &  UniqueStr  )  [pure virtual]
 

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

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

Event::List Calendar::events (  const QDate &  date,
bool  sorted = false
) 
 

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

useful for dayView, etc. etc. The calendar filter is applied.

Event::List Calendar::events (  const QDateTime &  qdt  ) 
 

Get events, which occur on the given date.

The calendar filter is applied.

Event::List Calendar::events (  const QDate &  start,
const QDate &  end,
bool  inclusive = false
) 
 

Get events in a range of dates.

If inclusive is set to true, only events are returned, which are completely included in the range. The calendar filter is applied.

Event::List Calendar::events (  EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
)  [virtual]
 

Return filtered list of all events sorted according to sortField.

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

Return unfiltered list of all events in calendar.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual bool KCal::Calendar::addTodo (  Todo *  todo  )  [pure virtual]
 

Add a todo to the todolist.

Returns:
true on success, false on error.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual void KCal::Calendar::deleteTodo (  Todo *   )  [pure virtual]
 

Remove a todo from the todolist.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

Todo::List Calendar::todos (  TodoSortField  = TodoSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
)  [virtual]
 

Return filtered list of todos.

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

Searches todolist for an event with this unique string identifier, returns a pointer or null.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

Todo::List Calendar::todos (  const QDate &  date  )  [virtual]
 

Returns list of todos due on the specified date.

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

Return unfiltered list of todos.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

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

Return unfiltered list of todos.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual bool KCal::Calendar::addJournal (  Journal *   )  [pure virtual]
 

Add a Journal entry to calendar.

Returns:
true on success, false on error.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual void KCal::Calendar::deleteJournal (  Journal *   )  [pure virtual]
 

Remove a journal entry from the calendar.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

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

Return Journal with given UID.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

Journal::List Calendar::journals (  JournalSortField  sortField = JournalSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending
)  [virtual]
 

Return list of all Journal entries.

Journal::List Calendar::journals (  const QDate &  date  )  [virtual]
 

Returns list of journals for the specified date.

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

Return unfiltered list of all journals in calendar.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

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

Return unfiltered list of journals for a given date.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

Incidence * Calendar::incidence (  const QString &  uid  ) 
 

Searches all incidence types for an incidence with this unique string identifier, returns a pointer or null.

Incidence * Calendar::incidenceFromSchedulingID (  const QString &  uid  ) 
 

Searches all events and todos for an incidence with this scheduling ID.

Returns a pointer or null.

void Calendar::setupRelations (  Incidence *   )  [virtual]
 

Setup relations for an incidence.

void Calendar::removeRelations (  Incidence *   )  [virtual]
 

Remove all relations to an incidence.

void Calendar::setFilter (  CalFilter *   ) 
 

Set calendar filter, which filters events for the events() functions.

The Filter object is owned by the caller.

CalFilter * Calendar::filter (   ) 
 

Return calendar filter.

virtual Alarm::List KCal::Calendar::alarms (  const QDateTime &  from,
const QDateTime &  to
)  [pure virtual]
 

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

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

bool KCal::Calendar::isModified (   )  const [inline]
 

Return whether the calendar was modified since opening / saving.

void Calendar::setLoadedProductId (  const QString &   ) 
 

Set product id returned by loadedProductId().

This function is only useful for the calendar loading code.

QString Calendar::loadedProductId (   ) 
 

Return product id taken from file that has been loaded.

Returns QString::null, if no calendar has been loaded.

Incidence::List Calendar::mergeIncidenceList (  const Event::List &  ,
const Todo::List &  ,
const Journal::List & 
)  [static]
 

Merge lists of events, todos and journals to a list of incidences.

Incidence * Calendar::dissociateOccurrence (  Incidence *  incidence,
QDate  date,
bool  single = true
) 
 

Dissociate an incidence from a recurring incidence.

By default, only one single event for the given date will be dissociated and returned. If single == false, the recurrence will be split at date, the old incidence will have its recurrence ending at date and the new incidence (return value) will have all recurrences past the date.

void Calendar::incidenceUpdated (  IncidenceBase *   )  [protected]
 

The observer interface.

So far not implemented.

Reimplemented in KCal::CalendarNull.

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

Get unfiltered events, which occur on the given date.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

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

Get unfiltered events, which occur on the given date.

Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual Event::List KCal::Calendar::rawEvents (  const QDate &  start,
const QDate &  end,
bool  inclusive = false
)  [pure virtual]
 

Get 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::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.

virtual void KCal::Calendar::doSetTimeZoneId (  const QString &   )  [inline, protected, virtual]
 

let the subclasses of KCal::Calendar set the time zone

Reimplemented in KCal::CalendarResources.


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