libkcal Library API Documentation

KCal::Calendar Class Reference

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

#include <calendar.h>

Inheritance diagram for KCal::Calendar:

Inheritance graph
[legend]
Collaboration diagram for KCal::Calendar:

Collaboration graph
[legend]
List of all members.

Signals

void calendarChanged ()
void calendarSaved ()
void calendarLoaded ()

Public Member Functions

 Calendar (const QString &timeZoneId)
virtual void close ()=0
virtual void save ()=0
virtual bool isSaving ()
const QStringgetOwner () const
void setOwner (const QString &os)
const QStringgetEmail ()
void setEmail (const QString &)
void setTimeZoneId (const QString &)
QString timeZoneId () const
void setLocalTime ()
bool isLocalTime () const
virtual bool addIncidence (Incidence *)
virtual bool deleteIncidence (Incidence *)
virtual Incidence::List incidences ()
virtual Incidence::List incidences (const QDate &qdt)
virtual Incidence::List rawIncidences ()
QStringList incidenceCategories ()
virtual bool addEvent (Event *anEvent)=0
virtual void deleteEvent (Event *)=0
virtual Eventevent (const QString &UniqueStr)=0
Event::List events (const QDate &date, bool sorted=false)
Event::List events (const QDateTime &qdt)
Event::List events (const QDate &start, const QDate &end, bool inclusive=false)
virtual Event::List events ()
virtual Event::List rawEvents ()=0
virtual bool addTodo (Todo *todo)=0
virtual void deleteTodo (Todo *)=0
virtual Todo::List todos ()
virtual Todotodo (const QString &uid)=0
virtual Todo::List todos (const QDate &date)
virtual Todo::List rawTodos ()=0
virtual Todo::List rawTodosForDate (const QDate &date)=0
virtual bool addJournal (Journal *)=0
virtual void deleteJournal (Journal *)=0
virtual Journaljournal (const QDate &)=0
virtual Journaljournal (const QString &UID)=0
virtual Journal::List journals ()=0
Incidenceincidence (const QString &UID)
IncidenceincidenceFromSchedulingID (const QString &UID)
Incidence::List incidencesFromSchedulingID (const QString &UID)
virtual void setupRelations (Incidence *)
virtual void removeRelations (Incidence *)
void setFilter (CalFilter *)
CalFilterfilter ()
virtual Alarm::List alarms (const QDateTime &from, const QDateTime &to)=0
void registerObserver (Observer *)
void unregisterObserver (Observer *)
void setModified (bool)
void setLoadedProductId (const QString &)
QString loadedProductId ()
virtual bool beginChange (Incidence *)
virtual bool endChange (Incidence *)
IncidencedissociateOccurrence (Incidence *incidence, QDate date, bool single=true)
virtual Event::List rawEventsForDate (const QDateTime &qdt)=0
virtual Event::List rawEventsForDate (const QDate &date, bool sorted=false)=0
virtual Event::List rawEvents (const QDate &start, const QDate &end, bool inclusive=false)=0

Static Public Member Functions

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

Protected Member Functions

virtual void doSetTimeZoneId (const QString &)
void notifyIncidenceAdded (Incidence *)
void notifyIncidenceChanged (Incidence *)
void notifyIncidenceDeleted (Incidence *)
void setObserversEnabled (bool enabled)

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.

Definition at line 61 of file calendar.h.


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 QString & Calendar::getOwner  )  const
 

Return the owner of the calendar's full name.

Definition at line 114 of file calendar.cpp.

void Calendar::setOwner const QString os  ) 
 

Set the owner of the calendar.

Should be owner's full name.

Definition at line 119 of file calendar.cpp.

const QString & Calendar::getEmail  ) 
 

Return the email address of the calendar owner.

Definition at line 158 of file calendar.cpp.

Referenced by KCal::VCalFormat::VEventToEvent(), and KCal::VCalFormat::VTodoToEvent().

void Calendar::setEmail const QString  ) 
 

Set the email address of the calendar owner.

Definition at line 163 of file calendar.cpp.

void Calendar::setTimeZoneId const QString  ) 
 

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

Definition at line 130 of file calendar.cpp.

References doSetTimeZoneId().

Referenced by KCal::ResourceKABC::setTimeZoneId(), and KCal::ResourceCached::setTimeZoneId().

QString Calendar::timeZoneId  )  const
 

Return time zone id.

Definition at line 139 of file calendar.cpp.

Referenced by KCal::DndFactory::copyEvent(), KCal::DndFactory::copyTodo(), KCal::DndFactory::createDrag(), KCal::DndFactory::createDrop(), KCal::DndFactory::createDropTodo(), KCal::ICalFormat::fromString(), KCal::VCalFormat::ISOToQDateTime(), KCal::CalendarResources::load(), KCal::ICalFormat::parseScheduleMessage(), KCal::DndFactory::pasteIncidence(), KCal::VCalFormat::qDateTimeToISO(), and KCal::ICalFormat::toString().

void Calendar::setLocalTime  ) 
 

Use local time, not UTC or a time zone.

Definition at line 144 of file calendar.cpp.

bool Calendar::isLocalTime  )  const
 

Return whether local time is being used.

Definition at line 153 of file calendar.cpp.

Referenced by KCal::ICalFormat::fromString(), KCal::ICalFormat::parseScheduleMessage(), and KCal::ICalFormat::toString().

bool Calendar::addIncidence Incidence  )  [virtual]
 

Add an incidence to calendar.

Returns:
true on success, false on error.

Reimplemented in KCal::CalendarResources.

Definition at line 247 of file calendar.cpp.

Referenced by KCal::DndFactory::createDrag(), dissociateOccurrence(), and KCal::ICalFormat::toICalString().

bool Calendar::deleteIncidence Incidence  )  [virtual]
 

Delete an incidence from calendar.

Returns:
true on success, false on error.

Definition at line 254 of file calendar.cpp.

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

Return filtered list of all incidences of this calendar.

Definition at line 205 of file calendar.cpp.

References events(), journals(), mergeIncidenceList(), and todos().

Referenced by incidenceFromSchedulingID(), incidencesFromSchedulingID(), and mergeIncidenceList().

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

Return unfiltered list of all incidences of this calendar.

Definition at line 210 of file calendar.cpp.

References journals(), mergeIncidenceList(), rawEvents(), and rawTodos().

Referenced by incidenceCategories(), incidenceFromSchedulingID(), and incidencesFromSchedulingID().

QStringList Calendar::incidenceCategories  ) 
 

Return a list of all categories used in this calendar.

Definition at line 180 of file calendar.cpp.

References rawIncidences().

virtual bool KCal::Calendar::addEvent Event anEvent  )  [pure virtual]
 

Adds a Event to this calendar object.

Parameters:
anEvent a pointer to the event to add
Returns:
true on success, false on error.

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

Referenced by KCal::VCalFormat::fromString(), and KCal::VCalFormat::populate().

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

Delete event from calendar.

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

Referenced by KCal::DndFactory::cutEvent().

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.

Referenced by incidence(), and KCal::VCalFormat::populate().

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.

Definition at line 215 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawEventsForDate().

Referenced by KCal::DndFactory::createDrop(), KCal::ICalFormat::fromString(), KCal::DndFactory::pasteIncidence(), and KCal::VCalFormat::toString().

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

Get events, which occur on the given date.

The calendar filter is applied.

Definition at line 224 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawEventsForDate().

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.

Definition at line 231 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawEvents().

Event::List Calendar::events  )  [virtual]
 

Return filtered list of all events in calendar.

Definition at line 239 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawEvents().

Referenced by incidences().

virtual Event::List KCal::Calendar::rawEvents  )  [pure virtual]
 

Return unfiltered list of all events in calendar.

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

Referenced by events(), rawIncidences(), KCal::VCalFormat::save(), and KCal::ICalFormat::toString().

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.

Referenced by KCal::DndFactory::pasteIncidence(), and KCal::VCalFormat::populate().

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

Remove a todo from the todolist.

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

Referenced by KCal::DndFactory::cutTodo().

Todo::List Calendar::todos  )  [virtual]
 

Return filterd list of todos.

Definition at line 360 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawTodos().

Referenced by KCal::DndFactory::createDropTodo(), KCal::ICalFormat::fromString(), incidences(), KCal::DndFactory::pasteIncidence(), KCal::CalendarResources::rawTodos(), KCal::CalendarResources::rawTodosForDate(), and KCal::CalendarLocal::rawTodosForDate().

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.

Referenced by incidence(), and KCal::VCalFormat::populate().

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

Returns list of todos due on the specified date.

Definition at line 367 of file calendar.cpp.

References KCal::CalFilter::apply(), and rawTodosForDate().

virtual Todo::List KCal::Calendar::rawTodos  )  [pure virtual]
 

Return unfiltered list of todos.

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

Referenced by rawIncidences(), KCal::VCalFormat::save(), todos(), and KCal::ICalFormat::toString().

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.

Referenced by todos().

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 QDate  )  [pure virtual]
 

Return Journal for given date.

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

Referenced by incidence().

virtual Journal* KCal::Calendar::journal const QString UID  )  [pure virtual]
 

Return Journal with given UID.

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

virtual Journal::List KCal::Calendar::journals  )  [pure virtual]
 

Return list of all Journal entries.

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

Referenced by incidences(), rawIncidences(), and KCal::ICalFormat::toString().

Incidence * Calendar::incidence const QString UID  ) 
 

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

Definition at line 327 of file calendar.cpp.

References event(), journal(), and todo().

Referenced by setupRelations().

Incidence * Calendar::incidenceFromSchedulingID const QString UID  ) 
 

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

Returns a pointer or null.

Definition at line 348 of file calendar.cpp.

References incidences(), and rawIncidences().

Incidence::List Calendar::incidencesFromSchedulingID const QString UID  ) 
 

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

Returns a list of matching results.

Definition at line 337 of file calendar.cpp.

References incidences(), and rawIncidences().

void Calendar::setupRelations Incidence  )  [virtual]
 

Setup relations for an incidence.

Definition at line 379 of file calendar.cpp.

References incidence(), and KCal::Incidence::setRelatedTo().

Referenced by KCal::CalendarLocal::addTodo().

void Calendar::removeRelations Incidence  )  [virtual]
 

Remove all relations to an incidence.

Definition at line 409 of file calendar.cpp.

References KCal::Incidence::setRelatedTo(), KCal::Incidence::setRelatedToUid(), and KCal::IncidenceBase::uid().

Referenced by KCal::CalendarLocal::deleteTodo().

void Calendar::setFilter CalFilter  ) 
 

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

The Filter object is owned by the caller.

Definition at line 170 of file calendar.cpp.

CalFilter * Calendar::filter  ) 
 

Return calendar filter.

Definition at line 175 of file calendar.cpp.

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.

void Calendar::setLoadedProductId const QString  ) 
 

Set product id returned by loadedProductId().

This function is only useful for the calendar loading code.

Definition at line 505 of file calendar.cpp.

QString Calendar::loadedProductId  ) 
 

Return product id taken from file that has been loaded.

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

Definition at line 510 of file calendar.cpp.

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.

Definition at line 515 of file calendar.cpp.

References incidences().

Referenced by incidences(), KCal::ResourceCalendar::rawIncidences(), and rawIncidences().

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.

Definition at line 260 of file calendar.cpp.

References addIncidence(), KCal::Todo::dtDue(), KCal::Event::dtEnd(), KCal::Todo::dtStart(), KCal::IncidenceBase::dtStart(), KCal::Recurrence::duration(), KCal::Recurrence::durationTo(), KCal::Todo::hasDueDate(), KCal::Todo::hasStartDate(), KCal::Incidence::recreate(), KCal::Incidence::recurrence(), KCal::Todo::setDtDue(), KCal::Event::setDtEnd(), KCal::Todo::setDtStart(), KCal::Incidence::setDtStart(), KCal::Recurrence::setDuration(), KCal::Incidence::setRelatedTo(), and KCal::Recurrence::unsetRecurs().

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.

Referenced by events().

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.

Definition at line 357 of file calendar.h.

Referenced by setTimeZoneId().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkcal Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 2 09:52:34 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003