KCal::CalendarLocal Class Reference
This class provides a calendar stored as a local file. More...
#include <calendarlocal.h>
Inheritance diagram for KCal::CalendarLocal:

Public Methods | |
CalendarLocal () | |
CalendarLocal (const QString &timeZoneId) | |
~CalendarLocal () | |
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 () |
Event * | event (const QString &uid) |
Event::List | rawEvents () |
bool | addTodo (Todo *todo) |
void | deleteTodo (Todo *) |
void | deleteAllTodos () |
Todo * | todo (const QString &uid) |
Todo::List | rawTodos () |
Todo::List | todos (const QDate &date) |
Todo::List | todos () |
bool | addJournal (Journal *) |
void | deleteJournal (Journal *) |
void | deleteAllJournals () |
Journal * | journal (const QDate &) |
Journal * | journal (const QString &uid) |
Journal::List | journals () |
Alarm::List | alarms (const QDateTime &from, const QDateTime &to) |
Alarm::List | alarmsTo (const QDateTime &to) |
void | update (IncidenceBase *incidence) |
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 Methods | |
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
|
Constructs a new calendar, with variables initialized to sane values.
Definition at line 41 of file calendarlocal.cpp. |
|
Constructs a new calendar, with variables initialized to sane values.
Definition at line 47 of file calendarlocal.cpp. |
Member Function Documentation
|
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().
Definition at line 63 of file calendarlocal.cpp. References KCal::FileStorage::load(). Referenced by KCal::ResourceRemote::load(), and KCal::ResourceLocal::load(). |
|
Writes out the calendar to disk in the specified format. CalendarLocal takes ownership of the CalFormat object.
Definition at line 69 of file calendarlocal.cpp. References KCal::FileStorage::save(). Referenced by KCal::ResourceRemote::save(), and KCal::ResourceLocal::save(). |
|
Clears out the current calendar, freeing all used memory etc. etc. Implements KCal::Calendar. Definition at line 75 of file calendarlocal.cpp. References deleteAllEvents(), deleteAllJournals(), and deleteAllTodos(). Referenced by KCal::ResourceRemote::doClose(), KCal::ResourceLocal::doClose(), KCal::ResourceKABC::doClose(), KCal::ResourceRemote::load(), and KCal::ResourceKABC::load(). |
|
Sync changes in memory to persistant storage.
Implements KCal::Calendar. Definition at line 76 of file calendarlocal.h. |
|
Add Event to calendar.
Implements KCal::Calendar. Definition at line 85 of file calendarlocal.cpp. References insertEvent(), and KCal::IncidenceBase::registerObserver(). Referenced by KCal::ResourceIMAP::addEvent(), KCal::ResourceCached::addEvent(), KCal::DndFactory::copyEvent(), and KCal::ResourceKABC::load(). |
|
Deletes an event from this calendar.
Implements KCal::Calendar. Definition at line 96 of file calendarlocal.cpp. References QDict< Event >::remove(), and KCal::IncidenceBase::uid(). Referenced by KCal::ResourceIMAP::deleteEvent(), and KCal::ResourceCached::deleteEvent(). |
|
Deletes all events from this calendar.
Definition at line 107 of file calendarlocal.cpp. References QDict< Event >::clear(), and QDict< Event >::setAutoDelete(). Referenced by close(). |
|
Retrieves an event on the basis of the unique string ID.
Implements KCal::Calendar. Definition at line 115 of file calendarlocal.cpp. Referenced by KCal::ResourceKABC::event(), KCal::ResourceIMAP::event(), KCal::ResourceCached::event(), rawEvents(), and rawEventsForDate(). |
|
Return unfiltered list of all events in calendar.
Implements KCal::Calendar. Definition at line 425 of file calendarlocal.cpp. References QDictIterator::current(). Referenced by KCal::ResourceKABC::rawEvents(), KCal::ResourceIMAP::rawEvents(), and KCal::ResourceCached::rawEvents(). |
|
Add a todo to the todolist.
Implements KCal::Calendar. Definition at line 121 of file calendarlocal.cpp. References KCal::IncidenceBase::registerObserver(), and KCal::Calendar::setupRelations(). Referenced by KCal::ResourceIMAP::addTodo(), KCal::ResourceCached::addTodo(), and KCal::DndFactory::copyTodo(). |
|
Remove a todo from the todolist.
Implements KCal::Calendar. Definition at line 135 of file calendarlocal.cpp. References KCal::Calendar::removeRelations(). Referenced by KCal::ResourceIMAP::deleteTodo(), and KCal::ResourceCached::deleteTodo(). |
|
Deletes all todos from this calendar.
Definition at line 145 of file calendarlocal.cpp. Referenced by close(). |
|
Searches todolist for an event with this unique string identifier, returns a pointer or null.
Implements KCal::Calendar. Definition at line 158 of file calendarlocal.cpp. Referenced by KCal::ResourceKABC::todo(), KCal::ResourceIMAP::todo(), KCal::ResourceCached::todo(), and todos(). |
|
Return list of all todos.
Implements KCal::Calendar. Definition at line 153 of file calendarlocal.cpp. Referenced by KCal::ResourceKABC::rawTodos(), KCal::ResourceIMAP::rawTodos(), and KCal::ResourceCached::rawTodos(). |
|
Returns list of todos due on the specified date.
Implements KCal::Calendar. Definition at line 168 of file calendarlocal.cpp. References QDateTime::date(), KCal::Todo::dtDue(), KCal::Todo::hasDueDate(), todo(), and todos(). Referenced by KCal::DndFactory::createDropTodo(), KCal::ICalFormat::fromString(), KCal::DndFactory::pasteIncidence(), KCal::ResourceKABC::todos(), KCal::ResourceIMAP::todos(), KCal::ResourceCached::todos(), and todos(). |
|
Return list of all todos. Workaround because compiler does not recognize function of base class. Reimplemented from KCal::Calendar. Definition at line 130 of file calendarlocal.h. |
|
Add a Journal entry to calendar.
Implements KCal::Calendar. Definition at line 434 of file calendarlocal.cpp. References KCal::IncidenceBase::dtStart(), QDateTime::isValid(), KCal::IncidenceBase::registerObserver(), and QDateTime::toString(). Referenced by KCal::ResourceIMAP::addJournal(), and KCal::ResourceCached::addJournal(). |
|
Remove a Journal from the calendar.
Implements KCal::Calendar. Definition at line 450 of file calendarlocal.cpp. Referenced by KCal::ResourceIMAP::deleteJournal(), and KCal::ResourceCached::deleteJournal(). |
|
Deletes all journals from this calendar.
Definition at line 457 of file calendarlocal.cpp. Referenced by close(). |
|
Return Journal for given date.
Implements KCal::Calendar. Definition at line 464 of file calendarlocal.cpp. Referenced by KCal::ResourceKABC::journal(), KCal::ResourceIMAP::journal(), and KCal::ResourceCached::journal(). |
|
Return Journal with given UID.
Implements KCal::Calendar. Definition at line 476 of file calendarlocal.cpp. |
|
Return list of all Journals stored in calendar.
Implements KCal::Calendar. Definition at line 486 of file calendarlocal.cpp. Referenced by KCal::ICalFormat::fromString(), KCal::ResourceKABC::journals(), KCal::ResourceIMAP::journals(), and KCal::ResourceCached::journals(). |
|
Return all alarms, which ocur in the given time interval.
Implements KCal::Calendar. Definition at line 188 of file calendarlocal.cpp. References alarms(), appendAlarms(), appendRecurringAlarms(), QDictIterator::current(), and KCal::Incidence::doesRecur(). Referenced by KCal::ResourceKABC::alarms(), KCal::ResourceIMAP::alarms(), KCal::ResourceCached::alarms(), alarms(), alarmsTo(), appendAlarms(), and appendRecurringAlarms(). |
|
Return all alarms, which ocur before given date.
Definition at line 183 of file calendarlocal.cpp. References alarms(). Referenced by KCal::ResourceKABC::alarmsTo(), KCal::ResourceIMAP::alarmsTo(), and KCal::ResourceCached::alarmsTo(). |
|
This method should be called whenever a Event is modified directly via it's pointer. It makes sure that the calendar is internally consistent. Definition at line 280 of file calendarlocal.cpp. References QDateTime::currentDateTime(), KCal::IncidenceBase::setLastModified(), and KCal::IncidenceBase::setSyncStatus(). Referenced by incidenceUpdated(). |
|
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 305 of file calendarlocal.cpp. References QDate::addDays(), QDictIterator::current(), QDateTime::date(), KCal::Incidence::doesRecur(), KCal::Event::dtEnd(), KCal::IncidenceBase::dtStart(), event(), KCal::Event::isMultiDay(), and KCal::Incidence::recursOn(). Referenced by KCal::ResourceKABC::rawEventsForDate(), KCal::ResourceIMAP::rawEventsForDate(), KCal::ResourceCached::rawEventsForDate(), and rawEventsForDate(). |
|
Get unfiltered events for date qdt.
Implements KCal::Calendar. Definition at line 420 of file calendarlocal.cpp. References QDateTime::date(), and rawEventsForDate(). |
|
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 355 of file calendarlocal.cpp. References QDictIterator::current(), QDateTime::date(), KCal::Incidence::doesRecur(), KCal::Event::dtEnd(), KCal::IncidenceBase::dtStart(), KCal::Recurrence::duration(), KCal::Recurrence::endDate(), event(), and KCal::Incidence::recurrence(). |
|
Notification function of IncidenceBase::Observer.
Definition at line 198 of file calendarlocal.h. References update(). |
|
inserts an event into its "proper place" in the calendar.
Definition at line 291 of file calendarlocal.cpp. References QDict< Event >::insert(), and KCal::IncidenceBase::uid(). Referenced by addEvent(). |
|
Append alarms of incidence in interval to list of alarms.
Definition at line 210 of file calendarlocal.cpp. References alarms(), KCal::Incidence::alarms(), KCal::Incidence::summary(), and QDateTime::time(). Referenced by alarms(). |
|
Append alarms of recurring events in interval to list of alarms.
Definition at line 229 of file calendarlocal.cpp. References QDateTime::addSecs(), alarms(), KCal::Incidence::alarms(), KCal::Duration::asSeconds(), QDateTime::date(), KCal::Incidence::dtEnd(), KCal::IncidenceBase::dtStart(), KCal::Alarm::endOffset(), KCal::Recurrence::getNextDateTime(), KCal::Alarm::hasEndOffset(), KCal::Alarm::hasStartOffset(), KCal::Alarm::hasTime(), KCal::Incidence::isException(), QDateTime::isValid(), KCal::Incidence::recurrence(), QDateTime::secsTo(), KCal::Alarm::startOffset(), KCal::Incidence::summary(), KCal::Alarm::time(), and QDateTime::toString(). Referenced by alarms(). |
The documentation for this class was generated from the following files: