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:

KCal::CalendarLocal List of all members.

Public Member Functions

 Calendar (const QString &timeZoneId)
virtual void close ()=0
 Clears out the current calendar, freeing all used memory etc.

const QStringgetOwner () const
 Return the owner of the calendar's full name.

void setOwner (const QString &os)
 Set the owner of the calendar.

const QStringgetEmail ()
 Return the email address of the calendar owner.

void setEmail (const QString &)
 Set the email address of the calendar owner.

void setTimeZone (const QString &tz)
 Set time zone from a timezone string (e.g.

void setTimeZone (int tz)
 Set time zone from a minutes value (e.g.

int getTimeZone () const
 Return time zone as offest in minutes.

QString getTimeZoneStr () const
 Compute an ISO 8601 format string from the time zone.

void setTimeZoneId (const QString &)
 Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal values).

QString timeZoneId () const
 Return time zone id.

void setLocalTime ()
 Use local time, not UTC or a time zone.

bool isLocalTime () const
 Return whether local time is being used.

virtual void addEvent (Event *anEvent)=0
 Adds a Event to this calendar object.

virtual void deleteEvent (Event *)=0
 Delete event from calendar.

virtual Eventevent (const QString &UniqueStr)=0
 Retrieves an event on the basis of the unique string ID.

QPtrList< Eventevents (const QDate &date, bool sorted=false)
 Builds and then returns a list of all events that match for the date specified.

QPtrList< Eventevents (const QDateTime &qdt)
 Get events, which occur on the given date.

QPtrList< Eventevents (const QDate &start, const QDate &end, bool inclusive=false)
 Get events in a range of dates.

virtual QPtrList< Eventevents ()
 Return filtered list of all events in calendar.

virtual QPtrList< EventrawEvents ()=0
 Return unfiltered list of all events in calendar.

virtual int numEvents (const QDate &qd)=0
 Returns the number of events that are present on the specified date.

virtual void addTodo (Todo *todo)=0
 Add a todo to the todolist.

virtual void deleteTodo (Todo *)=0
 Remove a todo from the todolist.

virtual QPtrList< Todotodos ()
 Return filterd list of todos.

virtual Todotodo (const QString &uid)=0
 Searches todolist for an event with this unique string identifier, returns a pointer or null.

virtual QPtrList< Todotodos (const QDate &date)=0
 Returns list of todos due on the specified date.

virtual QPtrList< TodorawTodos () const=0
 Return unfiltered list of todos.

virtual void addJournal (Journal *)=0
 Add a Journal entry to calendar.

virtual Journaljournal (const QDate &)=0
 Return Journal for given date.

virtual Journaljournal (const QString &UID)=0
 Return Journal with given UID.

virtual QPtrList< Journaljournals ()=0
 Return list of all Journal entries.

void addIncidence (Incidence *)
 Add an incidence to calendar.

void setFilter (CalFilter *)
 Set calendar filter, which filters events for the events() functions.

CalFilterfilter ()
 Return calendar filter.

virtual Alarm::List alarms (const QDateTime &from, const QDateTime &to)=0
 Return all alarms, which ocur in the given time interval.

void registerObserver (Observer *)
void setModified (bool)
void setLoadedProductId (const QString &)
 Set product id returned by loadedProductId().

QString loadedProductId ()
 Return product id taken from file that has been loaded.


Protected Member Functions

virtual QPtrList< EventrawEventsForDate (const QDateTime &qdt)=0
 Get unfiltered events, which occur on the given date.

virtual QPtrList< EventrawEventsForDate (const QDate &date, bool sorted=false)=0
 Get unfiltered events, which occur on the given date.

virtual QPtrList< EventrawEvents (const QDate &start, const QDate &end, bool inclusive=false)=0
 Get events in a range of dates.


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

const QString & Calendar::getOwner  )  const
 

Return the owner of the calendar's full name.

Definition at line 124 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 129 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 218 of file calendar.cpp.

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

void Calendar::setEmail const QString  ) 
 

Set the email address of the calendar owner.

Definition at line 223 of file calendar.cpp.

void Calendar::setTimeZone const QString tz  ) 
 

Set time zone from a timezone string (e.g.

-2:00)

Definition at line 140 of file calendar.cpp.

References QString::left(), QString::length(), QString::remove(), and QString::right().

Referenced by KCal::DndFactory::copyEvent(), KCal::DndFactory::createDrag(), KCal::DndFactory::createDragTodo(), KCal::DndFactory::createDrop(), KCal::DndFactory::createDropTodo(), and KCal::VCalFormat::populate().

void Calendar::setTimeZone int  tz  ) 
 

Set time zone from a minutes value (e.g.

-60)

Definition at line 178 of file calendar.cpp.

int Calendar::getTimeZone  )  const
 

Return time zone as offest in minutes.

Definition at line 186 of file calendar.cpp.

Referenced by KCal::VCalFormat::ISOToQDateTime(), and KCal::VCalFormat::qDateTimeToISO().

QString Calendar::getTimeZoneStr  )  const
 

Compute an ISO 8601 format string from the time zone.

Definition at line 163 of file calendar.cpp.

References QString::sprintf().

Referenced by KCal::DndFactory::copyEvent(), KCal::DndFactory::createDrag(), KCal::DndFactory::createDragTodo(), KCal::DndFactory::createDrop(), KCal::DndFactory::createDropTodo(), KCal::VCalFormat::save(), and KCal::VCalFormat::toString().

void Calendar::setTimeZoneId const QString  ) 
 

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

Definition at line 191 of file calendar.cpp.

QString Calendar::timeZoneId  )  const
 

Return time zone id.

Definition at line 199 of file calendar.cpp.

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

void Calendar::setLocalTime  ) 
 

Use local time, not UTC or a time zone.

Definition at line 204 of file calendar.cpp.

bool Calendar::isLocalTime  )  const
 

Return whether local time is being used.

Definition at line 213 of file calendar.cpp.

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

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

Adds a Event to this calendar object.

Parameters:
anEvent a pointer to the event to add

Implemented in KCal::CalendarLocal.

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

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

Delete event from calendar.

Implemented in KCal::CalendarLocal.

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.

Referenced by KCal::ICalFormat::parseScheduleMessage(), and KCal::VCalFormat::populate().

QPtrList< Event > 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 240 of file calendar.cpp.

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

Referenced by KCal::DndFactory::createDrop(), KCal::DndFactory::pasteEvent(), and KCal::VCalFormat::toString().

QPtrList< Event > Calendar::events const QDateTime qdt  ) 
 

Get events, which occur on the given date.

The calendar filter is applied.

Definition at line 247 of file calendar.cpp.

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

QPtrList< Event > 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 254 of file calendar.cpp.

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

QPtrList< Event > Calendar::events  )  [virtual]
 

Return filtered list of all events in calendar.

Definition at line 262 of file calendar.cpp.

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

virtual QPtrList<Event> KCal::Calendar::rawEvents  )  [pure virtual]
 

Return unfiltered list of all events in calendar.

Implemented in KCal::CalendarLocal.

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

virtual int KCal::Calendar::numEvents const QDate qd  )  [pure virtual]
 

Returns the number of events that are present on the specified date.

Implemented in KCal::CalendarLocal.

virtual void KCal::Calendar::addTodo Todo todo  )  [pure virtual]
 

Add a todo to the todolist.

Implemented in KCal::CalendarLocal.

Referenced by KCal::VCalFormat::populate().

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

Remove a todo from the todolist.

Implemented in KCal::CalendarLocal.

QPtrList< Todo > Calendar::todos  )  [virtual]
 

Return filterd list of todos.

Reimplemented in KCal::CalendarLocal.

Definition at line 277 of file calendar.cpp.

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

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.

Referenced by KCal::VCalFormat::populate().

virtual QPtrList<Todo> KCal::Calendar::todos const QDate date  )  [pure virtual]
 

Returns list of todos due on the specified date.

Implemented in KCal::CalendarLocal.

virtual QPtrList<Todo> KCal::Calendar::rawTodos  )  const [pure virtual]
 

Return unfiltered list of todos.

Implemented in KCal::CalendarLocal.

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

virtual void KCal::Calendar::addJournal Journal  )  [pure virtual]
 

Add a Journal entry to calendar.

Implemented in KCal::CalendarLocal.

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

Return Journal for given date.

Implemented in KCal::CalendarLocal.

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

Return Journal with given UID.

Implemented in KCal::CalendarLocal.

virtual QPtrList<Journal> KCal::Calendar::journals  )  [pure virtual]
 

Return list of all Journal entries.

Implemented in KCal::CalendarLocal.

Referenced by KCal::ICalFormat::toString().

void Calendar::addIncidence Incidence  ) 
 

Add an incidence to calendar.

Definition at line 270 of file calendar.cpp.

References KCal::Incidence::accept().

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

CalFilter * Calendar::filter  ) 
 

Return calendar filter.

Definition at line 235 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.

void Calendar::setLoadedProductId const QString  ) 
 

Set product id returned by loadedProductId().

This function is only useful for the calendar loading code.

Definition at line 299 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 304 of file calendar.cpp.

virtual QPtrList<Event> KCal::Calendar::rawEventsForDate const QDateTime qdt  )  [protected, pure virtual]
 

Get unfiltered events, which occur on the given date.

Implemented in KCal::CalendarLocal.

Referenced by events().

virtual QPtrList<Event> 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.

virtual QPtrList<Event> 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.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:28 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001