libkcal
KCal::Calendar Class Reference
#include <calendar.h>
Inheritance diagram for KCal::Calendar:

Detailed Description
This is the main "calendar" object class.It holds information like Incidences(Events, To-dos, Journals), user information, etc. etc.
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 Incidences:
Incidence ownership is handled by the following policy: As soon as an Incidence (or any other subclass of IncidenceBase) object is added to the Calendar by an add...() method it is owned by the Calendar object. The Calendar takes care of deleting it. All Incidences returned by the query functions are returned as pointers so that changes to the returned Incidences are immediately visible in the Calendar. Do Not delete any Incidence object you get from Calendar.
Time Zone Handling:
- Incidence Storing:
- By default, (when LocalTime is unset) Incidence dates will have the "UTC" time zone when stored into a calendar file.
- To store Incidence dates without a time zone (i.e, "floating time zone") LocalTime must be set using the setLocalTime() method.
- Incidence Viewing:
- By default, Incidence dates will have the "UTC" time zone when read from a calendar.
- To view Incidence dates using another time zone TimeZoneId must be set using the setTimeZoneId() method, or the TimeZoneId can be passed to the Calendar constructor.
- It is permitted to switch viewing time zones using setTimeZoneId() as desired after the Calendar object has been constructed.
- Note that:
- The Calendar class doesn't do anything with TimeZoneId: it simply saves it for later use by the ICalFormat class.
- The ICalFormat class takes TimeZoneId and applies it to loaded Incidences before returning them in ICalFormat::load().
- Each Incidence can have its own time zone (or have a floating time zone).
- Once an Incidence is loaded it is adjusted to use the viewing time zone, TimeZoneId.
- Depending on the LocalTime setting, all loaded Incidences are stored either in UTC or without a time zone (floating time zone).
Definition at line 167 of file calendar.h.
Signals | |
void | calendarChanged () |
void | calendarSaved () |
void | calendarLoaded () |
Public Member Functions | |
Calendar (const QString &timeZoneId) | |
virtual | ~Calendar () |
void | setProductId (const QString &productId) |
QString | productId () |
void | setOwner (const Person &owner) |
const Person & | getOwner () const |
void | setTimeZoneId (const QString &timeZoneId) |
virtual void | setTimeZoneIdViewOnly (const QString &timeZoneId)=0 |
QString | timeZoneId () const |
void | setLocalTime () |
bool | isLocalTime () const |
void | setModified (bool modified) |
bool | isModified () const |
virtual void | close ()=0 |
virtual void | save ()=0 |
virtual bool | reload (const QString &tz)=0 |
virtual bool | isSaving () |
QStringList | categories () |
virtual bool | addIncidence (Incidence *incidence) |
virtual bool | deleteIncidence (Incidence *incidence) |
virtual Incidence::List | incidences () |
virtual Incidence::List | incidences (const QDate &date) |
virtual Incidence::List | rawIncidences () |
Incidence * | incidence (const QString &uid) |
Incidence * | incidenceFromSchedulingID (const QString &sid) |
Incidence::List | incidencesFromSchedulingID (const QString &UID) |
virtual bool | beginChange (Incidence *incidence) |
virtual bool | endChange (Incidence *incidence) |
Incidence * | dissociateOccurrence (Incidence *incidence, QDate date, bool single=true) |
virtual bool | addEvent (Event *event)=0 |
virtual bool | deleteEvent (Event *event)=0 |
virtual Event::List | events (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | events (const QDateTime &qdt) |
Event::List | events (const QDate &start, const QDate &end, bool inclusive=false) |
Event::List | events (const QDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
virtual Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event::List | rawEventsForDate (const QDateTime &qdt)=0 |
virtual Event::List | rawEvents (const QDate &start, const QDate &end, bool inclusive=false)=0 |
virtual Event::List | rawEventsForDate (const QDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event * | event (const QString &uid)=0 |
virtual bool | addTodo (Todo *todo)=0 |
virtual bool | deleteTodo (Todo *todo)=0 |
virtual Todo::List | todos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
virtual Todo::List | todos (const QDate &date) |
virtual Todo::List | rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Todo::List | rawTodosForDate (const QDate &date)=0 |
virtual Todo * | todo (const QString &uid)=0 |
virtual bool | addJournal (Journal *journal)=0 |
virtual bool | deleteJournal (Journal *journal)=0 |
virtual Journal::List | journals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
virtual Journal::List | journals (const QDate &date) |
virtual Journal::List | rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Journal::List | rawJournalsForDate (const QDate &date)=0 |
virtual Journal * | journal (const QString &uid)=0 |
virtual void | setupRelations (Incidence *incidence) |
virtual void | removeRelations (Incidence *incidence) |
void | setFilter (CalFilter *filter) |
CalFilter * | filter () |
virtual Alarm::List | alarms (const QDateTime &from, const QDateTime &to)=0 |
void | registerObserver (Observer *observer) |
void | unregisterObserver (Observer *observer) |
Static Public Member Functions | |
static Incidence::List | mergeIncidenceList (const Event::List &events, const Todo::List &todos, const Journal::List &journals) |
static Event::List | sortEvents (Event::List *eventList, EventSortField sortField, SortDirection sortDirection) |
static Todo::List | sortTodos (Todo::List *todoList, TodoSortField sortField, SortDirection sortDirection) |
static Journal::List | sortJournals (Journal::List *journalList, JournalSortField sortField, SortDirection sortDirection) |
Protected Member Functions | |
void | incidenceUpdated (IncidenceBase *incidenceBase) |
virtual void | doSetTimeZoneId (const QString &) |
void | notifyIncidenceAdded (Incidence *incidence) |
void | notifyIncidenceChanged (Incidence *incidence) |
void | notifyIncidenceDeleted (Incidence *incidence) |
virtual void | customPropertyUpdated () |
void | setObserversEnabled (bool enabled) |
Classes | |
class | Observer |
The Observer class. More... |
Constructor & Destructor Documentation
|
Construct Calendar object using a Time Zone.
Definition at line 43 of file calendar.cpp. |
|
Destructor.
Definition at line 67 of file calendar.cpp. |
Member Function Documentation
|
Insert an Event into the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Insert an Incidence into the Calendar.
Reimplemented in KCal::CalendarResources. Definition at line 283 of file calendar.cpp. |
|
Insert a Journal into the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Insert a Todo into the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a list of Alarms within a time range for this Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Flag that a change to a Calendar Incidence is starting.
Reimplemented in KCal::CalendarResources. Definition at line 843 of file calendar.cpp. |
|
Signal that the Calendar has been modified.
|
|
Signal that the Calendar has been loaded into memory.
|
|
Signal that the Calendar has been saved.
|
|
Return a list of all categories used by Incidences in this Calendar.
Definition at line 125 of file calendar.cpp. |
|
Clears out the current Calendar, freeing all used memory etc.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
The default implementation does nothing: override in derived classes to perform change processing.
Reimplemented from KCal::CustomProperties. Definition at line 807 of file calendar.cpp. |
|
Remove an Event from the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Remove an Incidence from the Calendar.
Definition at line 290 of file calendar.cpp. |
|
Remove a Journal from the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Remove a Todo from the Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Dissociate an Incidence from a recurring Incidence. By default, only one single Incidence for the specified date will be dissociated and returned. If single is false, then the recurrence will be split at date, the old Incidence will have its recurrence ending at date and the new Incidence will have all recurrences past the date.
Definition at line 304 of file calendar.cpp. |
|
Let Calendar subclasses set the Time Zone ID.
First parameter is a string containing a Time Zone ID, which is assumed to be valid. On some systems, /usr/share/zoneinfo/zone.tab may be available for reference.
Reimplemented in KCal::CalendarResources. Definition at line 887 of file calendar.h. |
|
Flag that a change to a Calendar Incidence has completed.
Reimplemented in KCal::CalendarResources. Definition at line 848 of file calendar.cpp. |
|
Returns the Event associated with the given unique identifier.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a sorted, filtered list of all Events which occur on the given date. The Events are sorted according to sortField and sortDirection.
Definition at line 251 of file calendar.cpp. |
|
Return a filtered list of all Events occurring within a date range.
Definition at line 267 of file calendar.cpp. |
|
Return a filtered list of all Events which occur on the given timestamp.
Definition at line 260 of file calendar.cpp. |
|
Return a sorted, filtered list of all Events for this Calendar.
Definition at line 275 of file calendar.cpp. |
|
Return the Calendar filter.
Definition at line 120 of file calendar.cpp. |
|
Get the owner of the Calendar.
Definition at line 72 of file calendar.cpp. |
|
Returns the Incidence associated with the given unique identifier.
Definition at line 370 of file calendar.cpp. |
|
Returns the Incidence associated with the given scheduling identifier.
Definition at line 393 of file calendar.cpp. |
|
Return a filtered list of all Incidences which occur on the given date.
Definition at line 144 of file calendar.cpp. |
|
Return a filtered list of all Incidences for this Calendar.
Definition at line 149 of file calendar.cpp. |
|
Searches all events and todos for (an incidence with this scheduling ID. Returns a list of matching results. Definition at line 382 of file calendar.cpp. |
|
The Observer interface. So far not implemented.
Implements KCal::IncidenceBase::Observer. Reimplemented in KCal::CalendarLocal, and KCal::CalendarNull. Definition at line 757 of file calendar.cpp. |
|
Determine if Calendar Incidences are to be written without a time zone.
Definition at line 106 of file calendar.cpp. |
|
Determine the Calendar's modification status.
Definition at line 280 of file calendar.h. |
|
Determine if the Calendar is currently being saved.
Reimplemented in KCal::CalendarResources. Definition at line 304 of file calendar.h. |
|
Returns the Journal associated with the given unique identifier.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a filtered list of all Journals for on the specifed date.
Definition at line 625 of file calendar.cpp. |
|
Return a sorted, filtered list of all Journals for this Calendar.
Definition at line 617 of file calendar.cpp. |
|
Create a merged list of Events, Todos, and Journals.
Definition at line 822 of file calendar.cpp. |
|
Let Calendar subclasses notify that they inserted an Incidence.
Definition at line 771 of file calendar.cpp. |
|
Let Calendar subclasses notify that they modified an Incidence.
Definition at line 783 of file calendar.cpp. |
|
Let Calendar subclasses notify that they removed an Incidence.
Definition at line 795 of file calendar.cpp. |
|
Get the Calendar's Product ID.
Definition at line 817 of file calendar.cpp. |
|
Return an unfiltered list of all Events occurring within a date range.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a sorted, unfiltered list of all Events for this Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a sorted, unfiltered list of all Events which occur on the given date. The Events are sorted according to sortField and sortDirection.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return an unfiltered list of all Events which occur on the given timestamp.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return an unfiltered list of all Incidences for this Calendar.
Definition at line 154 of file calendar.cpp. |
|
Return a sorted, unfiltered list of all Journals for this Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return an unfiltered list of all Journals for on the specifed date.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a sorted, unfiltered list of all Todos for this Calendar.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return an unfiltered list of all Todos which due on the specified date.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Register an Observer for this Calendar.
Definition at line 732 of file calendar.cpp. |
|
Load the calendar contents from storage. This requires the calendar to have been loaded once before, in other words initialized.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Remove all Relations from an Incidence.
Definition at line 668 of file calendar.cpp. |
|
Sync changes in memory to persistant storage.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Set the Calendar filter.
Definition at line 111 of file calendar.cpp. |
|
Set to store calendar Incidences without a time zone.
Definition at line 98 of file calendar.cpp. |
|
Set if the Calendar had been modified.
Definition at line 744 of file calendar.cpp. |
|
Let Calendar subclasses notify that they enabled an Observer.
Definition at line 853 of file calendar.cpp. |
|
Set the owner of the Calendar.
Definition at line 77 of file calendar.cpp. |
|
Set the Calendar Product ID.
Definition at line 812 of file calendar.cpp. |
|
Set the Time Zone Id for the Calendar.
Definition at line 84 of file calendar.cpp. |
|
Set the timezone used for viewing the incidences in this calendar. In case it differs from the current timezone, shift the events such that they retain their absolute time (in UTC). setTimeZoneId Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Setup Relations for an Incidence.
Definition at line 634 of file calendar.cpp. |
|
Sort a list of Events.
Definition at line 159 of file calendar.cpp. |
|
Sort a list of Journals.
Definition at line 564 of file calendar.cpp. |
|
Sort a list of Todos.
Definition at line 405 of file calendar.cpp. |
|
Get the Time Zone ID for the Calendar.
Definition at line 93 of file calendar.cpp. |
|
Returns the Todo associated with the given unique identifier.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources. |
|
Return a filtered list of all Todos which are due on the specified date.
Definition at line 557 of file calendar.cpp. |
|
Return a sorted, filtered list of all Todos for this Calendar.
Definition at line 549 of file calendar.cpp. |
|
Unregister an Observer for this Calendar.
Definition at line 739 of file calendar.cpp. |
The documentation for this class was generated from the following files: