libkcal Library API Documentation

KCal::CalendarLocal Class Reference

This class provides a calendar stored as a local file. More...

#include <calendarlocal.h>

Inheritance diagram for KCal::CalendarLocal:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CalendarLocal ()
 CalendarLocal (const QString &timeZoneId)
bool load (const QString &fileName)
bool save (const QString &fileName, CalFormat *format=0)
void close ()
void save ()
bool addEvent (Event *event)
void deleteEvent (Event *event)
void deleteAllEvents ()
Eventevent (const QString &uid)
Event::List rawEvents ()
bool addTodo (Todo *todo)
void deleteTodo (Todo *)
void deleteAllTodos ()
Todotodo (const QString &uid)
Todo::List rawTodos ()
Todo::List rawTodosForDate (const QDate &date)
bool addJournal (Journal *)
void deleteJournal (Journal *)
void deleteAllJournals ()
Journaljournal (const QDate &)
Journaljournal (const QString &uid)
Journal::List journals ()
Alarm::List alarms (const QDateTime &from, const QDateTime &to)
Alarm::List alarmsTo (const QDateTime &to)
Event::List rawEventsForDate (const QDate &date, bool sorted=false)
Event::List rawEventsForDate (const QDateTime &qdt)
Event::List rawEvents (const QDate &start, const QDate &end, bool inclusive=false)

Protected Member Functions

void incidenceUpdated (IncidenceBase *i)
void insertEvent (Event *event)
void appendAlarms (Alarm::List &alarms, Incidence *incidence, const QDateTime &from, const QDateTime &to)
void appendRecurringAlarms (Alarm::List &alarms, Incidence *incidence, const QDateTime &from, const QDateTime &to)

Detailed Description

This class provides a calendar stored as a local file.

Definition at line 35 of file calendarlocal.h.


Constructor & Destructor Documentation

CalendarLocal::CalendarLocal  ) 
 

Constructs a new calendar, with variables initialized to sane values.

Definition at line 41 of file calendarlocal.cpp.

CalendarLocal::CalendarLocal const QString timeZoneId  ) 
 

Constructs a new calendar, with variables initialized to sane values.

Definition at line 47 of file calendarlocal.cpp.


Member Function Documentation

bool CalendarLocal::load const QString fileName  ) 
 

Loads a calendar on disk in vCalendar or iCalendar format into the current calendar.

Incidences already present are preserved. If an event of the file to be loaded has the same unique id as an incidence already present the new incidence is ignored.

To load a CalendarLocal object from a file without preserving existing incidences call close() before load().

Returns:
true, if successful, false on error.
Parameters:
fileName the name of the calendar on disk.

Definition at line 64 of file calendarlocal.cpp.

References KCal::FileStorage::load().

bool CalendarLocal::save const QString fileName,
CalFormat format = 0
 

Writes out the calendar to disk in the specified format.

CalendarLocal takes ownership of the CalFormat object.

Parameters:
fileName the name of the file
format the format to use
Returns:
true, if successful, false on error.

Definition at line 70 of file calendarlocal.cpp.

References KCal::FileStorage::save().

void CalendarLocal::close  )  [virtual]
 

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

etc.

Implements KCal::Calendar.

Definition at line 76 of file calendarlocal.cpp.

References deleteAllEvents(), deleteAllJournals(), and deleteAllTodos().

Referenced by KCal::ResourceKABC::doLoad().

void KCal::CalendarLocal::save  )  [inline, virtual]
 

Sync changes in memory to persistant storage.

Implements KCal::Calendar.

Definition at line 76 of file calendarlocal.h.

bool CalendarLocal::addEvent Event event  )  [virtual]
 

Add Event to calendar.

Implements KCal::Calendar.

Definition at line 91 of file calendarlocal.cpp.

References insertEvent(), and KCal::IncidenceBase::registerObserver().

Referenced by KCal::ResourceCached::addEvent(), KCal::DndFactory::copyEvent(), and KCal::ResourceKABC::doLoad().

void CalendarLocal::deleteEvent Event event  )  [virtual]
 

Deletes an event from this calendar.

Implements KCal::Calendar.

Definition at line 104 of file calendarlocal.cpp.

References KCal::IncidenceBase::uid().

Referenced by KCal::ResourceCached::deleteEvent().

void CalendarLocal::deleteAllEvents  ) 
 

Deletes all events from this calendar.

Definition at line 117 of file calendarlocal.cpp.

Referenced by close().

Event * CalendarLocal::event const QString uid  )  [virtual]
 

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

Implements KCal::Calendar.

Definition at line 131 of file calendarlocal.cpp.

Referenced by KCal::ResourceKABC::event(), KCal::ResourceCached::event(), rawEvents(), and rawEventsForDate().

Event::List CalendarLocal::rawEvents  )  [virtual]
 

Return unfiltered list of all events in calendar.

Implements KCal::Calendar.

Definition at line 455 of file calendarlocal.cpp.

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

bool CalendarLocal::addTodo Todo todo  )  [virtual]
 

Add a todo to the todolist.

Implements KCal::Calendar.

Definition at line 137 of file calendarlocal.cpp.

References KCal::IncidenceBase::registerObserver(), and KCal::Calendar::setupRelations().

Referenced by KCal::ResourceCached::addTodo(), and KCal::DndFactory::copyTodo().

void CalendarLocal::deleteTodo Todo  )  [virtual]
 

Remove a todo from the todolist.

Implements KCal::Calendar.

Definition at line 153 of file calendarlocal.cpp.

References KCal::ListBase< T >::removeRef(), and KCal::Calendar::removeRelations().

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

void CalendarLocal::deleteAllTodos  ) 
 

Deletes all todos from this calendar.

Definition at line 165 of file calendarlocal.cpp.

References KCal::ListBase< T >::setAutoDelete().

Referenced by close().

Todo * CalendarLocal::todo const QString uid  )  [virtual]
 

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

Implements KCal::Calendar.

Definition at line 183 of file calendarlocal.cpp.

Referenced by rawTodosForDate(), KCal::ResourceKABC::todo(), and KCal::ResourceCached::todo().

Todo::List CalendarLocal::rawTodos  )  [virtual]
 

Return list of all todos.

Implements KCal::Calendar.

Definition at line 178 of file calendarlocal.cpp.

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

Todo::List CalendarLocal::rawTodosForDate const QDate date  )  [virtual]
 

Returns list of todos due on the specified date.

Implements KCal::Calendar.

Definition at line 193 of file calendarlocal.cpp.

References KCal::Todo::dtDue(), KCal::Todo::hasDueDate(), todo(), and KCal::Calendar::todos().

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

bool CalendarLocal::addJournal Journal  )  [virtual]
 

Add a Journal entry to calendar.

Implements KCal::Calendar.

Definition at line 477 of file calendarlocal.cpp.

References KCal::IncidenceBase::dtStart(), and KCal::IncidenceBase::registerObserver().

Referenced by KCal::ResourceCached::addJournal().

void CalendarLocal::deleteJournal Journal  )  [virtual]
 

Remove a Journal from the calendar.

Implements KCal::Calendar.

Definition at line 495 of file calendarlocal.cpp.

References KCal::ListBase< T >::removeRef().

Referenced by KCal::ResourceCached::deleteJournal().

void CalendarLocal::deleteAllJournals  ) 
 

Deletes all journals from this calendar.

Definition at line 504 of file calendarlocal.cpp.

References KCal::ListBase< T >::setAutoDelete().

Referenced by close().

Journal * CalendarLocal::journal const QDate  )  [virtual]
 

Return Journal for given date.

Implements KCal::Calendar.

Definition at line 516 of file calendarlocal.cpp.

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

Journal * CalendarLocal::journal const QString uid  )  [virtual]
 

Return Journal with given UID.

Implements KCal::Calendar.

Definition at line 528 of file calendarlocal.cpp.

Journal::List CalendarLocal::journals  )  [virtual]
 

Return list of all Journals stored in calendar.

Implements KCal::Calendar.

Definition at line 538 of file calendarlocal.cpp.

Referenced by KCal::ICalFormat::fromString(), KCal::ResourceKABC::journals(), and KCal::ResourceCached::journals().

Alarm::List CalendarLocal::alarms const QDateTime from,
const QDateTime to
[virtual]
 

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

Implements KCal::Calendar.

Definition at line 213 of file calendarlocal.cpp.

References appendAlarms(), appendRecurringAlarms(), and KCal::Incidence::doesRecur().

Referenced by KCal::ResourceKABC::alarms(), KCal::ResourceCached::alarms(), and alarmsTo().

Alarm::List CalendarLocal::alarmsTo const QDateTime to  ) 
 

Return all alarms, which ocur before given date.

Definition at line 208 of file calendarlocal.cpp.

References alarms().

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

Event::List CalendarLocal::rawEventsForDate const QDate date,
bool  sorted = false
[virtual]
 

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

useful for dayView, etc. etc.

Implements KCal::Calendar.

Definition at line 332 of file calendarlocal.cpp.

References KCal::Incidence::doesRecur(), KCal::Event::dtEnd(), KCal::IncidenceBase::dtStart(), event(), KCal::Event::isMultiDay(), and KCal::Incidence::recursOn().

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

Event::List CalendarLocal::rawEventsForDate const QDateTime qdt  )  [virtual]
 

Get unfiltered events for date qdt.

Implements KCal::Calendar.

Definition at line 447 of file calendarlocal.cpp.

References rawEventsForDate().

Event::List CalendarLocal::rawEvents const QDate start,
const QDate end,
bool  inclusive = false
[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. If inclusive is set to false, all events which overlap the range are returned. An event's entire time span is considered in evaluating whether it should be returned. For a non-recurring event, its span is from its start to its end date. For a recurring event, its time span is from its first to its last recurrence.

Implements KCal::Calendar.

Definition at line 382 of file calendarlocal.cpp.

References KCal::Incidence::doesRecur(), KCal::IncidenceBase::dtStart(), event(), and KCal::Incidence::recurrence().

void CalendarLocal::incidenceUpdated IncidenceBase i  )  [protected]
 

Notification function of IncidenceBase::Observer.

Definition at line 304 of file calendarlocal.cpp.

void CalendarLocal::insertEvent Event event  )  [protected]
 

inserts an event into its "proper place" in the calendar.

Definition at line 318 of file calendarlocal.cpp.

References KCal::IncidenceBase::uid().

Referenced by addEvent().

void CalendarLocal::appendAlarms Alarm::List alarms,
Incidence incidence,
const QDateTime from,
const QDateTime to
[protected]
 

Append alarms of incidence in interval to list of alarms.

Definition at line 235 of file calendarlocal.cpp.

References KCal::Incidence::alarms().

Referenced by alarms().

void CalendarLocal::appendRecurringAlarms Alarm::List alarms,
Incidence incidence,
const QDateTime from,
const QDateTime to
[protected]
 

Append alarms of recurring events in interval to list of alarms.

Definition at line 254 of file calendarlocal.cpp.

References KCal::Incidence::alarms(), KCal::Incidence::dtEnd(), KCal::IncidenceBase::dtStart(), KCal::Alarm::endOffset(), KCal::Alarm::hasEndOffset(), KCal::Alarm::hasStartOffset(), KCal::Alarm::hasTime(), KCal::Incidence::isException(), KCal::Incidence::recurrence(), KCal::Alarm::startOffset(), KCal::Incidence::summary(), and KCal::Alarm::time().

Referenced by alarms().


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 Wed Jan 31 15:52:22 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003