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:

QObject KCal::CustomProperties KCal::CalendarLocal KCal::CalendarNull KCal::CalendarResources List of all members.

Signals

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

Public Methods

 Calendar ()
 Calendar (const QString &timeZoneId)
virtual ~Calendar ()
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 rawIncidences ()
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)=0
virtual Todo::List rawTodos ()=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)
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 setModified (bool)
void setLoadedProductId (const QString &)
QString loadedProductId ()
virtual bool beginChange (Incidence *)
virtual bool endChange (Incidence *)

Static Public Methods

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

Protected Methods

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
virtual void doSetTimeZoneId (const QString &)

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

References QString::find(), and QString::left().

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(), KCal::ResourceIMAP::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::ICalFormat::parseScheduleMessage(), KCal::DndFactory::pasteIncidence(), KCal::VCalFormat::qDateTimeToISO(), KCal::Scheduler::Scheduler(), 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(), KCal::Scheduler::Scheduler(), 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 222 of file calendar.cpp.

References KCal::Incidence::accept().

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

bool Calendar::deleteIncidence Incidence   [virtual]
 

Delete an incidence from calendar.

Returns:
true on success, false on error.

Definition at line 229 of file calendar.cpp.

References KCal::Incidence::accept().

Incidence::List Calendar::incidences   [virtual]
 

Return filtered list of all incidences of this calendar.

Definition at line 180 of file calendar.cpp.

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

Referenced by mergeIncidenceList().

Incidence::List Calendar::rawIncidences   [virtual]
 

Return unfiltered list of all incidences of this calendar.

Definition at line 185 of file calendar.cpp.

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

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(), KCal::DndFactory::pasteIncidence(), 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(), KCal::ICalFormat::parseScheduleMessage(), 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 190 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 199 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 206 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 214 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.

Reimplemented in KCal::CalendarLocal, and KCal::CalendarResources.

Definition at line 245 of file calendar.cpp.

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

Referenced by incidences().

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().

virtual Todo::List KCal::Calendar::todos const QDate   date [pure virtual]
 

Returns list of todos due on the specified date.

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

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 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 235 of file calendar.cpp.

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

Referenced by setupRelations().

void Calendar::setupRelations Incidence   [virtual]
 

Setup relations for an incidence.

Definition at line 254 of file calendar.cpp.

References KCal::Incidence::addRelation(), incidence(), QDict< Incidence >::insert(), QString::isEmpty(), QObject::parent(), KCal::Incidence::relatedTo(), KCal::Incidence::relatedToUid(), QDict< Incidence >::remove(), KCal::Incidence::setRelatedTo(), and KCal::IncidenceBase::uid().

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

void Calendar::removeRelations Incidence   [virtual]
 

Remove all relations to an incidence.

Definition at line 284 of file calendar.cpp.

References QDictIterator::current(), QDictIterator::currentKey(), QDict< Incidence >::find(), QDict< Incidence >::insert(), KCal::Incidence::relatedTo(), KCal::Incidence::relations(), QDict< Incidence >::remove(), KCal::Incidence::removeRelation(), 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 338 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 343 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 348 of file calendar.cpp.

References incidences().

Referenced by incidences(), and rawIncidences().

virtual Event::List KCal::Calendar::rawEventsForDate const QDateTime   qdt [protected, 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
[protected, 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
[protected, 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 316 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.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:23 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003