KCal Library
KCal::Calendar Class Reference
#include <calendar.h>

Detailed Description
Represents the main calendar class.A calendar contains information like incidences (events, to-dos, journals), alarms, time zones, and other useful information.
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) is added to the Calendar by an add...() method it is owned by the Calendar object. The Calendar takes care of deleting the incidence using the delete...() methods. 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 attempt to 'delete' any Incidence object you get from Calendar -- use the delete...() methods.
Definition at line 119 of file calendar.h.
Signals | |
void | calendarChanged () |
void | calendarLoaded () |
void | calendarSaved () |
Public Member Functions | |
virtual bool | addEvent (Event *event)=0 |
virtual bool | addIncidence (Incidence *incidence) |
virtual bool | addJournal (Journal *journal)=0 |
virtual bool | addTodo (Todo *todo)=0 |
virtual Alarm::List | alarms (const KDateTime &from, const KDateTime &to)=0 |
virtual bool | beginChange (Incidence *incidence) |
Calendar (const QString &timeZoneId) | |
Calendar (const KDateTime::Spec &timeSpec) | |
QStringList | categories () |
virtual void | close ()=0 |
virtual void | deleteAllEvents ()=0 |
virtual void | deleteAllJournals ()=0 |
virtual void | deleteAllTodos ()=0 |
virtual bool | deleteEvent (Event *event)=0 |
virtual bool | deleteIncidence (Incidence *incidence) |
virtual bool | deleteJournal (Journal *journal)=0 |
virtual bool | deleteTodo (Todo *todo)=0 |
Incidence * | dissociateOccurrence (Incidence *incidence, const QDate &date, const KDateTime::Spec &spec, bool single=true) |
virtual bool | endChange (Incidence *incidence) |
virtual Event * | event (const QString &uid)=0 |
Event::List | events (const QDate &date, const KDateTime::Spec ×pec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | events (const QDate &start, const QDate &end, const KDateTime::Spec ×pec=KDateTime::Spec(), bool inclusive=false) |
Event::List | events (const KDateTime &dt) |
virtual Event::List | events (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
CalFilter * | filter () |
Incidence * | incidence (const QString &uid) |
Incidence * | incidenceFromSchedulingID (const QString &sid) |
virtual Incidence::List | incidences (const QDate &date) |
virtual Incidence::List | incidences () |
Incidence::List | incidencesFromSchedulingID (const QString &sid) |
bool | isModified () const |
virtual bool | isSaving () |
virtual Journal * | journal (const QString &uid)=0 |
virtual Journal::List | journals (const QDate &date) |
virtual Journal::List | journals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Person | owner () const |
QString | productId () const |
virtual Event::List | rawEvents (const QDate &start, const QDate &end, const KDateTime::Spec ×pec=KDateTime::Spec(), bool inclusive=false)=0 |
virtual Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event::List | rawEventsForDate (const QDate &date, const KDateTime::Spec ×pec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Event::List | rawEventsForDate (const KDateTime &dt)=0 |
virtual Incidence::List | rawIncidences () |
virtual Journal::List | rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Journal::List | rawJournalsForDate (const QDate &date)=0 |
virtual Todo::List | rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0 |
virtual Todo::List | rawTodosForDate (const QDate &date)=0 |
void | registerObserver (CalendarObserver *observer) |
virtual bool | reload ()=0 |
virtual void | removeRelations (Incidence *incidence) |
virtual bool | save ()=0 |
void | setFilter (CalFilter *filter) |
void | setModified (bool modified) |
void | setOwner (const Person &owner) |
void | setProductId (const QString &id) |
void | setTimeSpec (const KDateTime::Spec &timeSpec) |
void | setTimeZoneId (const QString &timeZoneId) |
void | setTimeZones (const ICalTimeZones &zones) |
virtual void | setupRelations (Incidence *incidence) |
void | setViewTimeSpec (const KDateTime::Spec &timeSpec) const |
void | setViewTimeZoneId (const QString &timeZoneId) const |
void | shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec) |
KDateTime::Spec | timeSpec () const |
QString | timeZoneId () const |
ICalTimeZones * | timeZones () const |
virtual Todo * | todo (const QString &uid)=0 |
virtual Todo::List | todos (const QDate &date) |
virtual Todo::List | todos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
void | unregisterObserver (CalendarObserver *observer) |
KDateTime::Spec | viewTimeSpec () const |
QString | viewTimeZoneId () const |
virtual | ~Calendar () |
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 Journal::List | sortJournals (Journal::List *journalList, JournalSortField sortField, SortDirection sortDirection) |
static Todo::List | sortTodos (Todo::List *todoList, TodoSortField sortField, SortDirection sortDirection) |
Protected Member Functions | |
void | appendAlarms (Alarm::List &alarms, Incidence *incidence, const KDateTime &from, const KDateTime &to) |
void | appendRecurringAlarms (Alarm::List &alarms, Incidence *incidence, const KDateTime &from, const KDateTime &to) |
virtual void | customPropertyUpdated () |
virtual void | doSetTimeSpec (const KDateTime::Spec &timeSpec) |
void | incidenceUpdated (IncidenceBase *incidenceBase) |
void | notifyIncidenceAdded (Incidence *incidence) |
void | notifyIncidenceChanged (Incidence *incidence) |
void | notifyIncidenceDeleted (Incidence *incidence) |
void | setObserversEnabled (bool enabled) |
Classes | |
class | CalendarObserver |
The CalendarObserver class. More... |
Constructor & Destructor Documentation
Calendar::Calendar | ( | const KDateTime::Spec & | timeSpec | ) | [explicit] |
Constructs a calendar with a specified time zone timeZoneid
.
Private class that helps to provide binary compatibility between releases.
The time specification is used as the default for creating or modifying incidences in the Calendar. The time specification does not alter existing incidences.
The constructor also calls setViewTimeSpec(timeSpec
).
- Parameters:
-
timeSpec time specification
For internal use only.
Definition at line 103 of file calendar.cpp.
Calendar::Calendar | ( | const QString & | timeZoneId | ) | [explicit] |
Construct Calendar object using a time zone ID.
The time zone ID is used as the default for creating or modifying incidences in the Calendar. The time zone does not alter existing incidences.
The constructor also calls setViewTimeZoneId(timeZoneId
).
- Parameters:
-
timeZoneId is a string containing a time zone ID, which is assumed to be valid. If no time zone is found, the viewing time specification is set to local clock time. Example: "Europe/Berlin"
Definition at line 110 of file calendar.cpp.
Calendar::~Calendar | ( | ) | [virtual] |
Member Function Documentation
virtual bool KCal::Calendar::addEvent | ( | Event * | event | ) | [pure virtual] |
Inserts an Event into the calendar.
- Parameters:
-
event is a pointer to the Event to insert.
- Returns:
- true if the Event was successfully inserted; false otherwise.
- See also:
- deleteEvent()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
bool Calendar::addIncidence | ( | Incidence * | incidence | ) | [virtual] |
Inserts an Incidence into the calendar.
- Parameters:
-
incidence is a pointer to the Incidence to insert.
- Returns:
- true if the Incidence was successfully inserted; false otherwise.
- See also:
- deleteIncidence()
Reimplemented in KCal::CalendarResources.
Definition at line 427 of file calendar.cpp.
virtual bool KCal::Calendar::addJournal | ( | Journal * | journal | ) | [pure virtual] |
Inserts a Journal into the calendar.
- Parameters:
-
journal is a pointer to the Journal to insert.
- Returns:
- true if the Journal was successfully inserted; false otherwise.
- See also:
- deleteJournal()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual bool KCal::Calendar::addTodo | ( | Todo * | todo | ) | [pure virtual] |
Inserts a Todo into the calendar.
- Parameters:
-
todo is a pointer to the Todo to insert.
- Returns:
- true if the Todo was successfully inserted; false otherwise.
- See also:
- deleteTodo()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Alarm::List KCal::Calendar::alarms | ( | const KDateTime & | from, | |
const KDateTime & | to | |||
) | [pure virtual] |
Returns a list of Alarms within a time range for this Calendar.
- Parameters:
-
from is the starting timestamp. to is the ending timestamp.
- Returns:
- the list of Alarms for the for the specified time range.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
void Calendar::appendAlarms | ( | Alarm::List & | alarms, | |
Incidence * | incidence, | |||
const KDateTime & | from, | |||
const KDateTime & | to | |||
) | [protected] |
Appends alarms of incidence in interval to list of alarms.
- Parameters:
-
alarms is a List of Alarms to be appended onto. incidence is a pointer to an Incidence containing the Alarm to be appended. from is the lower range of the next Alarm repitition. to is the upper range of the next Alarm repitition.
Definition at line 1055 of file calendar.cpp.
void Calendar::appendRecurringAlarms | ( | Alarm::List & | alarms, | |
Incidence * | incidence, | |||
const KDateTime & | from, | |||
const KDateTime & | to | |||
) | [protected] |
Appends alarms of recurring events in interval to list of alarms.
- Parameters:
-
alarms is a List of Alarms to be appended onto. incidence is a pointer to an Incidence containing the Alarm to be appended. from is the lower range of the next Alarm repitition. to is the upper range of the next Alarm repitition.
Definition at line 1072 of file calendar.cpp.
bool Calendar::beginChange | ( | Incidence * | incidence | ) | [virtual] |
Flag that a change to a Calendar Incidence is starting.
- Parameters:
-
incidence is a pointer to the Incidence that will be changing.
Reimplemented in KCal::CalendarResources.
Definition at line 1038 of file calendar.cpp.
void KCal::Calendar::calendarChanged | ( | ) | [signal] |
Signals that the calendar has been modified.
void KCal::Calendar::calendarLoaded | ( | ) | [signal] |
Signals that the calendar has been loaded into memory.
void KCal::Calendar::calendarSaved | ( | ) | [signal] |
Signals that the calendar has been saved.
QStringList Calendar::categories | ( | ) |
Returns a list of all categories used by Incidences in this Calendar.
- Returns:
- a QStringList containing all the categories.
Definition at line 255 of file calendar.cpp.
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.
void Calendar::customPropertyUpdated | ( | ) | [protected, virtual] |
Called when a custom property has been changed.
The default implementation does nothing: override in derived classes to perform change processing.
Reimplemented from KCal::CustomProperties.
Definition at line 1001 of file calendar.cpp.
virtual void KCal::Calendar::deleteAllEvents | ( | ) | [pure virtual] |
Removes all Events from the calendar.
- See also:
- deleteEvent()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual void KCal::Calendar::deleteAllJournals | ( | ) | [pure virtual] |
Removes all Journals from the calendar.
- See also:
- deleteJournal()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual void KCal::Calendar::deleteAllTodos | ( | ) | [pure virtual] |
Removes all To-dos from the calendar.
- See also:
- deleteTodo()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual bool KCal::Calendar::deleteEvent | ( | Event * | event | ) | [pure virtual] |
Removes an Event from the calendar.
- Parameters:
-
event is a pointer to the Event to remove.
- Returns:
- true if the Event was successfully remove; false otherwise.
- See also:
- addEvent(), deleteAllEvents()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
bool Calendar::deleteIncidence | ( | Incidence * | incidence | ) | [virtual] |
Removes an Incidence from the calendar.
- Parameters:
-
incidence is a pointer to the Incidence to remove.
- Returns:
- true if the Incidence was successfully removed; false otherwise.
- See also:
- addIncidence()
Definition at line 434 of file calendar.cpp.
virtual bool KCal::Calendar::deleteJournal | ( | Journal * | journal | ) | [pure virtual] |
Removes a Journal from the calendar.
- Parameters:
-
journal is a pointer to the Journal to remove.
- Returns:
- true if the Journal was successfully removed; false otherwise.
- See also:
- addJournal(), deleteAllJournals()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual bool KCal::Calendar::deleteTodo | ( | Todo * | todo | ) | [pure virtual] |
Removes a Todo from the calendar.
- Parameters:
-
todo is a pointer to the Todo to remove.
- Returns:
- true if the Todo was successfully removed; false otherwise.
- See also:
- addTodo(), deleteAllTodos()
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
Incidence * Calendar::dissociateOccurrence | ( | Incidence * | incidence, | |
const QDate & | date, | |||
const KDateTime::Spec & | spec, | |||
bool | single = true | |||
) |
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.
- Parameters:
-
incidence is a pointer to a recurring Incidence. date is the QDate within the recurring Incidence on which the dissociation will be performed. spec is the spec in which the date is formulated. single is a flag meaning that a new Incidence should be created from the recurring Incidences after date.
- Returns:
- a pointer to a new recurring Incidence if single is false.
Definition at line 449 of file calendar.cpp.
void Calendar::doSetTimeSpec | ( | const KDateTime::Spec & | timeSpec | ) | [protected, virtual] |
Let Calendar subclasses set the time specification.
- Parameters:
-
timeSpec is the time specification (time zone, etc.) for viewing Incidence dates.
Reimplemented in KCal::CalendarResources.
Definition at line 963 of file calendar.cpp.
bool Calendar::endChange | ( | Incidence * | incidence | ) | [virtual] |
Flag that a change to a Calendar Incidence has completed.
- Parameters:
-
incidence is a pointer to the Incidence that was changed.
Reimplemented in KCal::CalendarResources.
Definition at line 1044 of file calendar.cpp.
virtual Event* KCal::Calendar::event | ( | const QString & | uid | ) | [pure virtual] |
Returns the Event associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
Event::List Calendar::events | ( | const QDate & | date, | |
const KDateTime::Spec & | timespec = KDateTime::Spec() , |
|||
EventSortField | sortField = EventSortUnsorted , |
|||
SortDirection | sortDirection = SortDirectionAscending | |||
) |
Returns a sorted, filtered list of all Events which occur on the given date.
The Events are sorted according to sortField and sortDirection.
- Parameters:
-
date request filtered Event list for this QDate only. timespec time zone etc. to interpret start
andend
, or the calendar's default time spec if none is specifiedsortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of sorted, filtered Events occurring on date.
Definition at line 393 of file calendar.cpp.
Event::List Calendar::events | ( | const QDate & | start, | |
const QDate & | end, | |||
const KDateTime::Spec & | timespec = KDateTime::Spec() , |
|||
bool | inclusive = false | |||
) |
Returns a filtered list of all Events occurring within a date range.
- Parameters:
-
start is the starting date. end is the ending date. timespec time zone etc. to interpret start
andend
, or the calendar's default time spec if none is specifiedinclusive if true only Events which are completely included within the date range are returned.
- Returns:
- the list of filtered Events occurring within the specified date range.
Definition at line 410 of file calendar.cpp.
Event::List Calendar::events | ( | const KDateTime & | dt | ) |
Returns a filtered list of all Events which occur on the given timestamp.
- Parameters:
-
dt request filtered Event list for this KDateTime only.
- Returns:
- the list of filtered Events occurring on the specified timestamp.
Definition at line 403 of file calendar.cpp.
Event::List Calendar::events | ( | EventSortField | sortField = EventSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [virtual] |
Returns a sorted, filtered list of all Events for this Calendar.
- Parameters:
-
sortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all filtered Events sorted as specified.
Definition at line 419 of file calendar.cpp.
CalFilter * Calendar::filter | ( | ) |
Returns the calendar filter.
- Returns:
- a pointer to the calendar CalFilter. A null pointer is returned if no such CalFilter exists.
- See also:
- setFilter()
Definition at line 250 of file calendar.cpp.
Incidence * Calendar::incidence | ( | const QString & | uid | ) |
Returns the Incidence associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Definition at line 519 of file calendar.cpp.
Incidence * Calendar::incidenceFromSchedulingID | ( | const QString & | sid | ) |
Returns the Incidence associated with the given scheduling identifier.
- Parameters:
-
sid is a unique scheduling identifier string.
Definition at line 548 of file calendar.cpp.
Incidence::List Calendar::incidences | ( | const QDate & | date | ) | [virtual] |
Returns a filtered list of all Incidences which occur on the given date.
- Parameters:
-
date request filtered Incidence list for this QDate only.
- Returns:
- the list of filtered Incidences occurring on the specified date.
Definition at line 274 of file calendar.cpp.
Incidence::List Calendar::incidences | ( | ) | [virtual] |
Returns a filtered list of all Incidences for this Calendar.
- Returns:
- the list of all filtered Incidences.
Definition at line 279 of file calendar.cpp.
Incidence::List Calendar::incidencesFromSchedulingID | ( | const QString & | sid | ) |
Searches all events and todos for an incidence with this scheduling identifiere.
Returns a list of matching results.
- Parameters:
-
sid is a unique scheduling identifier string.
Definition at line 535 of file calendar.cpp.
void Calendar::incidenceUpdated | ( | IncidenceBase * | incidenceBase | ) | [protected, virtual] |
The Observer interface.
So far not implemented.
- Parameters:
-
incidenceBase is a pointer an IncidenceBase object.
Implements KCal::IncidenceBase::IncidenceObserver.
Reimplemented in KCal::CalendarLocal, and KCal::CalendarNull.
Definition at line 950 of file calendar.cpp.
bool Calendar::isModified | ( | ) | const |
Determine the calendar's modification status.
- Returns:
- true if the calendar has been modified since open or last save.
- See also:
- setModified()
Definition at line 945 of file calendar.cpp.
bool Calendar::isSaving | ( | ) | [virtual] |
Determine if the calendar is currently being saved.
- Returns:
- true if the calendar is currently being saved; false otherwise.
Reimplemented in KCal::CalendarResources.
Definition at line 929 of file calendar.cpp.
virtual Journal* KCal::Calendar::journal | ( | const QString & | uid | ) | [pure virtual] |
Returns the Journal associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
Journal::List Calendar::journals | ( | const QDate & | date | ) | [virtual] |
Returns a filtered list of all Journals for on the specified date.
- Parameters:
-
date request filtered Journals for this QDate only.
- Returns:
- the list of filtered Journals for the specified date.
Definition at line 782 of file calendar.cpp.
Journal::List Calendar::journals | ( | JournalSortField | sortField = JournalSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [virtual] |
Returns a sorted, filtered list of all Journals for this Calendar.
- Parameters:
-
sortField specifies the JournalSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all filtered Journals sorted as specified.
Definition at line 774 of file calendar.cpp.
Incidence::List Calendar::mergeIncidenceList | ( | const Event::List & | events, | |
const Todo::List & | todos, | |||
const Journal::List & | journals | |||
) | [static] |
Create a merged list of Events, Todos, and Journals.
- Parameters:
-
events is an Event list to merge. todos is a Todo list to merge. journals is a Journal list to merge.
- Returns:
- a list of merged Incidences.
Definition at line 1016 of file calendar.cpp.
void Calendar::notifyIncidenceAdded | ( | Incidence * | incidence | ) | [protected] |
Let Calendar subclasses notify that they inserted an Incidence.
- Parameters:
-
incidence is a pointer to the Incidence object that was inserted.
Definition at line 968 of file calendar.cpp.
void Calendar::notifyIncidenceChanged | ( | Incidence * | incidence | ) | [protected] |
Let Calendar subclasses notify that they modified an Incidence.
- Parameters:
-
incidence is a pointer to the Incidence object that was modified.
Definition at line 979 of file calendar.cpp.
void Calendar::notifyIncidenceDeleted | ( | Incidence * | incidence | ) | [protected] |
Let Calendar subclasses notify that they removed an Incidence.
- Parameters:
-
incidence is a pointer to the Incidence object that was removed.
Definition at line 990 of file calendar.cpp.
Person Calendar::owner | ( | ) | const |
Returns the owner of the calendar.
- Returns:
- the owner Person object.
- See also:
- setOwner()
Definition at line 121 of file calendar.cpp.
QString Calendar::productId | ( | ) | const |
Returns the calendar's Product ID.
- See also:
- setProductId()
Definition at line 1011 of file calendar.cpp.
virtual Event::List KCal::Calendar::rawEvents | ( | const QDate & | start, | |
const QDate & | end, | |||
const KDateTime::Spec & | timespec = KDateTime::Spec() , |
|||
bool | inclusive = false | |||
) | [pure virtual] |
Returns an unfiltered list of all Events occurring within a date range.
- Parameters:
-
start is the starting date end is the ending date timespec time zone etc. to interpret start
andend
, or the calendar's default time spec if none is specifiedinclusive if true only Events which are completely included within the date range are returned.
- Returns:
- the list of unfiltered Events occurring within the specified date range.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Event::List KCal::Calendar::rawEvents | ( | EventSortField | sortField = EventSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [pure virtual] |
Returns a sorted, unfiltered list of all Events for this Calendar.
- Parameters:
-
sortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all unfiltered Events sorted as specified.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Event::List KCal::Calendar::rawEventsForDate | ( | const QDate & | date, | |
const KDateTime::Spec & | timespec = KDateTime::Spec() , |
|||
EventSortField | sortField = EventSortUnsorted , |
|||
SortDirection | sortDirection = SortDirectionAscending | |||
) | [pure virtual] |
Returns a sorted, unfiltered list of all Events which occur on the given date.
The Events are sorted according to sortField and sortDirection.
- Parameters:
-
date request unfiltered Event list for this QDate only timespec time zone etc. to interpret date
, or the calendar's default time spec if none is specifiedsortField specifies the EventSortField sortDirection specifies the SortDirection
- Returns:
- the list of sorted, unfiltered Events occurring on
date
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Event::List KCal::Calendar::rawEventsForDate | ( | const KDateTime & | dt | ) | [pure virtual] |
Returns an unfiltered list of all Events which occur on the given timestamp.
- Parameters:
-
dt request unfiltered Event list for this KDateTime only.
- Returns:
- the list of unfiltered Events occurring on the specified timestamp.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
Incidence::List Calendar::rawIncidences | ( | ) | [virtual] |
Returns an unfiltered list of all Incidences for this Calendar.
- Returns:
- the list of all unfiltered Incidences.
Definition at line 284 of file calendar.cpp.
virtual Journal::List KCal::Calendar::rawJournals | ( | JournalSortField | sortField = JournalSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [pure virtual] |
Returns a sorted, unfiltered list of all Journals for this Calendar.
- Parameters:
-
sortField specifies the JournalSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all unfiltered Journals sorted as specified.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Journal::List KCal::Calendar::rawJournalsForDate | ( | const QDate & | date | ) | [pure virtual] |
Returns an unfiltered list of all Journals for on the specified date.
- Parameters:
-
date request unfiltered Journals for this QDate only.
- Returns:
- the list of unfiltered Journals for the specified date.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Todo::List KCal::Calendar::rawTodos | ( | TodoSortField | sortField = TodoSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [pure virtual] |
Returns a sorted, unfiltered list of all Todos for this Calendar.
- Parameters:
-
sortField specifies the TodoSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all unfiltered Todos sorted as specified.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
virtual Todo::List KCal::Calendar::rawTodosForDate | ( | const QDate & | date | ) | [pure virtual] |
Returns an unfiltered list of all Todos which due on the specified date.
- Parameters:
-
date request unfiltered Todos due on this QDate.
- Returns:
- the list of unfiltered Todos due on the specified date.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
void Calendar::registerObserver | ( | CalendarObserver * | observer | ) |
Registers an Observer for this Calendar.
- Parameters:
-
observer is a pointer to an Observer object that will be watching this Calendar.
- See also:
- unregisterObserver()
Definition at line 916 of file calendar.cpp.
virtual bool KCal::Calendar::reload | ( | ) | [pure virtual] |
Loads the calendar contents from storage.
This requires that the calendar has been previously loaded (initialized).
- Returns:
- true if the reload was successful; otherwise false.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
void Calendar::removeRelations | ( | Incidence * | incidence | ) | [virtual] |
Removes all Relations from an Incidence.
- Parameters:
-
incidence is a pointer to the Incidence to have a Relation removed.
Definition at line 829 of file calendar.cpp.
virtual bool KCal::Calendar::save | ( | ) | [pure virtual] |
Syncs changes in memory to persistent storage.
- Returns:
- true if the save was successful; false otherwise.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
void Calendar::setFilter | ( | CalFilter * | filter | ) |
Sets the calendar filter.
- Parameters:
-
filter a pointer to a CalFilter object which will be used to filter Calendar Incidences.
- See also:
- filter()
Definition at line 241 of file calendar.cpp.
void Calendar::setModified | ( | bool | modified | ) |
Sets if the calendar has been modified.
- Parameters:
-
modified is true if the calendar has been modified since open or last save.
- See also:
- isModified()
Definition at line 934 of file calendar.cpp.
void Calendar::setObserversEnabled | ( | bool | enabled | ) | [protected] |
Let Calendar subclasses notify that they enabled an Observer.
- Parameters:
-
enabled if true tells the calendar that a subclass has enabled an Observer.
Definition at line 1050 of file calendar.cpp.
void Calendar::setOwner | ( | const Person & | owner | ) |
Sets the owner of the calendar to owner
.
- Parameters:
-
owner is a Person object.
- See also:
- owner()
Definition at line 126 of file calendar.cpp.
void Calendar::setProductId | ( | const QString & | id | ) |
Sets the calendar Product ID to id
.
- Parameters:
-
id is a string containing the Product ID.
- See also:
- productId() const
Definition at line 1006 of file calendar.cpp.
void Calendar::setTimeSpec | ( | const KDateTime::Spec & | timeSpec | ) |
Sets the default time specification (time zone, etc.
) used for creating or modifying incidences in the Calendar.
The method also calls setViewTimeSpec(timeSpec
).
- Parameters:
-
timeSpec time specification
Definition at line 133 of file calendar.cpp.
void Calendar::setTimeZoneId | ( | const QString & | timeZoneId | ) |
Sets the time zone ID used for creating or modifying incidences in the Calendar.
This method has no effect on existing incidences.
The method also calls setViewTimeZoneId(timeZoneId
).
- Parameters:
-
timeZoneId is a string containing a time zone ID, which is assumed to be valid. The time zone ID is used to set the time zone for viewing Incidence date/times. If no time zone is found, the viewing time specification is set to local clock time. Example: "Europe/Berlin"
- See also:
- setTimeSpec()
Definition at line 147 of file calendar.cpp.
void KCal::Calendar::setTimeZones | ( | const ICalTimeZones & | zones | ) |
Set the time zone collection used by the calendar.
- Parameters:
-
zones time zones collection. Important: all time zones references in the calendar must be included in the collection.
void Calendar::setupRelations | ( | Incidence * | incidence | ) | [virtual] |
Setup Relations for an Incidence.
- Parameters:
-
incidence is a pointer to the Incidence to have a Relation setup.
Definition at line 791 of file calendar.cpp.
void Calendar::setViewTimeSpec | ( | const KDateTime::Spec & | timeSpec | ) | const |
Notes the time specification which the client application intends to use for viewing the incidences in this calendar.
This is simply a convenience method which makes a note of the new time zone so that it can be read back by viewTimeSpec(). The client application must convert date/time values to the desired time zone itself.
The time specification is not used in any way by the Calendar or its incidences; it is solely for use by the client application.
- Parameters:
-
timeSpec time specification
- See also:
- viewTimeSpec()
Definition at line 192 of file calendar.cpp.
void Calendar::setViewTimeZoneId | ( | const QString & | timeZoneId | ) | const |
Notes the time zone Id which the client application intends to use for viewing the incidences in this calendar.
This is simply a convenience method which makes a note of the new time zone so that it can be read back by viewTimeId(). The client application must convert date/time values to the desired time zone itself.
The Id is not used in any way by the Calendar or its incidences. It is solely for use by the client application.
- Parameters:
-
timeZoneId is a string containing a time zone ID, which is assumed to be valid. The time zone ID is used to set the time zone for viewing Incidence date/times. If no time zone is found, the viewing time specification is set to local clock time. Example: "Europe/Berlin"
- See also:
- viewTimeZoneId()
Definition at line 198 of file calendar.cpp.
void Calendar::shiftTimes | ( | const KDateTime::Spec & | oldSpec, | |
const KDateTime::Spec & | newSpec | |||
) |
Shifts the times of all incidences so that they appear at the same clock time as before but in a new time zone.
The shift is done from a viewing time zone rather than from the actual incidence time zone.
For example, shifting an incidence whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec
) of Europe/London, to a new time zone (newSpec
) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the incidence start) to 14:00 Paris time.
- Parameters:
-
oldSpec the time specification which provides the clock times newSpec the new time specification
- See also:
- isLocalTime()
Definition at line 219 of file calendar.cpp.
Event::List Calendar::sortEvents | ( | Event::List * | eventList, | |
EventSortField | sortField, | |||
SortDirection | sortDirection | |||
) | [static] |
Sort a list of Events.
- Parameters:
-
eventList is a pointer to a list of Events. sortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns:
- a list of Events sorted as specified.
Definition at line 289 of file calendar.cpp.
Journal::List Calendar::sortJournals | ( | Journal::List * | journalList, | |
JournalSortField | sortField, | |||
SortDirection | sortDirection | |||
) | [static] |
Sort a list of Journals.
- Parameters:
-
journalList is a pointer to a list of Journals. sortField specifies the JournalSortField. sortDirection specifies the SortDirection.
- Returns:
- a list of Journals sorted as specified.
Definition at line 721 of file calendar.cpp.
Todo::List Calendar::sortTodos | ( | Todo::List * | todoList, | |
TodoSortField | sortField, | |||
SortDirection | sortDirection | |||
) | [static] |
Sort a list of Todos.
- Parameters:
-
todoList is a pointer to a list of Todos. sortField specifies the TodoSortField. sortDirection specifies the SortDirection.
- Returns:
- a list of Todos sorted as specified.
Definition at line 562 of file calendar.cpp.
KDateTime::Spec Calendar::timeSpec | ( | ) | const |
Get the time specification (time zone etc.
) used for creating or modifying incidences in the Calendar.
- Returns:
- time specification
Definition at line 142 of file calendar.cpp.
QString Calendar::timeZoneId | ( | ) | const |
Returns the time zone ID used for creating or modifying incidences in the calendar.
- Returns:
- the string containing the time zone ID, or empty string if the creation/modification time specification is not a time zone.
Definition at line 186 of file calendar.cpp.
ICalTimeZones * Calendar::timeZones | ( | ) | const |
Returns the time zone collection used by the calendar.
- Returns:
- the time zones collection.
- See also:
- setLocalTime()
Definition at line 214 of file calendar.cpp.
virtual Todo* KCal::Calendar::todo | ( | const QString & | uid | ) | [pure virtual] |
Returns the Todo associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implemented in KCal::CalendarLocal, KCal::CalendarNull, and KCal::CalendarResources.
Todo::List Calendar::todos | ( | const QDate & | date | ) | [virtual] |
Returns a filtered list of all Todos which are due on the specified date.
- Parameters:
-
date request filtered Todos due on this QDate.
- Returns:
- the list of filtered Todos due on the specified date.
Definition at line 714 of file calendar.cpp.
Todo::List Calendar::todos | ( | TodoSortField | sortField = TodoSortUnsorted , |
|
SortDirection | sortDirection = SortDirectionAscending | |||
) | [virtual] |
Returns a sorted, filtered list of all Todos for this Calendar.
- Parameters:
-
sortField specifies the TodoSortField. sortDirection specifies the SortDirection.
- Returns:
- the list of all filtered Todos sorted as specified.
Definition at line 706 of file calendar.cpp.
void Calendar::unregisterObserver | ( | CalendarObserver * | observer | ) |
Unregisters an Observer for this Calendar.
- Parameters:
-
observer is a pointer to an Observer object that has been watching this Calendar.
- See also:
- registerObserver()
Definition at line 924 of file calendar.cpp.
KDateTime::Spec Calendar::viewTimeSpec | ( | ) | const |
Returns the time specification used for viewing the incidences in this calendar.
This simply returns the time specification last set by setViewTimeSpec().
- See also:
- setViewTimeSpec().
Definition at line 203 of file calendar.cpp.
QString Calendar::viewTimeZoneId | ( | ) | const |
Returns the time zone Id used for viewing the incidences in this calendar.
This simply returns the time specification last set by setViewTimeSpec().
- See also:
- setViewTimeZoneId().
Definition at line 208 of file calendar.cpp.
The documentation for this class was generated from the following files: