KCal Library
#include <calendarlocal.h>

Public Member Functions | |
CalendarLocal (const KDateTime::Spec &timeSpec) | |
CalendarLocal (const QString &timeZoneId) | |
~CalendarLocal () | |
bool | addEvent (Event *event) |
bool | addJournal (Journal *journal) |
bool | addTodo (Todo *todo) |
Alarm::List | alarms (const KDateTime &from, const KDateTime &to) |
Alarm::List | alarmsTo (const KDateTime &to) |
void | close () |
void | deleteAllEvents () |
void | deleteAllJournals () |
void | deleteAllTodos () |
bool | deleteEvent (Event *event) |
bool | deleteJournal (Journal *journal) |
bool | deleteTodo (Todo *todo) |
Event * | event (const QString &uid) |
void | incidenceUpdated (IncidenceBase *incidenceBase) |
Journal * | journal (const QString &uid) |
bool | load (const QString &fileName, CalFormat *format=0) |
Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEvents (const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false) |
Event::List | rawEventsForDate (const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEventsForDate (const KDateTime &dt) |
Journal::List | rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Journal::List | rawJournalsForDate (const QDate &date) |
Todo::List | rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Todo::List | rawTodosForDate (const QDate &date) |
bool | reload () |
bool | save () |
bool | save (const QString &fileName, CalFormat *format=0) |
Todo * | todo (const QString &uid) |
Detailed Description
This class provides a calendar stored as a local file.
Constructor & Destructor Documentation
CalendarLocal::CalendarLocal | ( | const KDateTime::Spec & | timeSpec | ) | [explicit] |
Private class that helps to provide binary compatibility between releases.
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
Definition at line 97 of file calendarlocal.cpp.
CalendarLocal::CalendarLocal | ( | 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 103 of file calendarlocal.cpp.
CalendarLocal::~CalendarLocal | ( | ) |
Destroys the calendar.
Definition at line 109 of file calendarlocal.cpp.
Member Function Documentation
bool CalendarLocal::addEvent | ( | Event * | event | ) | [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()
Implements KCal::Calendar.
Definition at line 172 of file calendarlocal.cpp.
bool CalendarLocal::addJournal | ( | Journal * | journal | ) | [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()
Implements KCal::Calendar.
Definition at line 553 of file calendarlocal.cpp.
bool CalendarLocal::addTodo | ( | Todo * | todo | ) | [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()
Implements KCal::Calendar.
Definition at line 222 of file calendarlocal.cpp.
Alarm::List CalendarLocal::alarms | ( | const KDateTime & | from, |
const KDateTime & | to | ||
) | [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.
Implements KCal::Calendar.
Definition at line 329 of file calendarlocal.cpp.
Alarm::List CalendarLocal::alarmsTo | ( | const KDateTime & | to | ) |
Return a list of Alarms that occur before the specified timestamp.
- Parameters:
-
to is the ending timestamp.
- Returns:
- the list of Alarms occurring before the specified KDateTime.
Definition at line 324 of file calendarlocal.cpp.
void CalendarLocal::close | ( | ) | [virtual] |
Clears out the current calendar, freeing all used memory etc.
etc.
Implements KCal::Calendar.
Definition at line 158 of file calendarlocal.cpp.
void CalendarLocal::deleteAllEvents | ( | ) | [virtual] |
Removes all Events from the calendar.
- See also:
- deleteEvent()
Implements KCal::Calendar.
Definition at line 202 of file calendarlocal.cpp.
void CalendarLocal::deleteAllJournals | ( | ) | [virtual] |
Removes all Journals from the calendar.
- See also:
- deleteJournal()
Implements KCal::Calendar.
Definition at line 597 of file calendarlocal.cpp.
void CalendarLocal::deleteAllTodos | ( | ) | [virtual] |
Removes all To-dos from the calendar.
- See also:
- deleteTodo()
Implements KCal::Calendar.
Definition at line 277 of file calendarlocal.cpp.
bool CalendarLocal::deleteEvent | ( | Event * | event | ) | [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()
Implements KCal::Calendar.
Definition at line 185 of file calendarlocal.cpp.
bool CalendarLocal::deleteJournal | ( | Journal * | journal | ) | [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()
Implements KCal::Calendar.
Definition at line 583 of file calendarlocal.cpp.
bool CalendarLocal::deleteTodo | ( | Todo * | todo | ) | [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()
Implements KCal::Calendar.
Definition at line 258 of file calendarlocal.cpp.
Event * CalendarLocal::event | ( | const QString & | uid | ) | [virtual] |
Returns the Event associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 217 of file calendarlocal.cpp.
void CalendarLocal::incidenceUpdated | ( | IncidenceBase * | incidenceBase | ) | [virtual] |
Notify the IncidenceBase::Observer that the incidence has been updated.
- Parameters:
-
incidenceBase is a pointer to the updated IncidenceBase.
Reimplemented from KCal::Calendar.
Definition at line 380 of file calendarlocal.cpp.
Journal * CalendarLocal::journal | ( | const QString & | uid | ) | [virtual] |
Returns the Journal associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 612 of file calendarlocal.cpp.
bool CalendarLocal::load | ( | const QString & | fileName, |
CalFormat * | format = 0 |
||
) |
Loads a calendar on disk in vCalendar or iCalendar format into the current calendar.
Incidences already present are preserved. If an incidence 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().
- Parameters:
-
fileName the name of the calendar on disk. format the format to use. If 0, an attempt is made to load iCalendar format, and if that fails tries vCalendar format.
- Returns:
- true, if successful, false on error.
- See also:
- save( const QString &, CalFormat *)
Definition at line 115 of file calendarlocal.cpp.
Event::List CalendarLocal::rawEvents | ( | EventSortField | sortField = EventSortUnsorted , |
SortDirection | sortDirection = SortDirectionAscending |
||
) | [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.
Implements KCal::Calendar.
Definition at line 541 of file calendarlocal.cpp.
Event::List CalendarLocal::rawEvents | ( | const QDate & | start, |
const QDate & | end, | ||
const KDateTime::Spec & | timeSpec = KDateTime::Spec() , |
||
bool | inclusive = false |
||
) | [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.
Implements KCal::Calendar.
Definition at line 476 of file calendarlocal.cpp.
Event::List CalendarLocal::rawEventsForDate | ( | const QDate & | date, |
const KDateTime::Spec & | timeSpec = KDateTime::Spec() , |
||
EventSortField | sortField = EventSortUnsorted , |
||
SortDirection | sortDirection = SortDirectionAscending |
||
) | [virtual] |
Returns an unfiltered list of all Events which occur on the given date.
- 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 unfiltered Events occurring on the specified QDate.
Implements KCal::Calendar.
Definition at line 417 of file calendarlocal.cpp.
Event::List CalendarLocal::rawEventsForDate | ( | const KDateTime & | dt | ) | [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.
Implements KCal::Calendar.
Definition at line 536 of file calendarlocal.cpp.
Journal::List CalendarLocal::rawJournals | ( | JournalSortField | sortField = JournalSortUnsorted , |
SortDirection | sortDirection = SortDirectionAscending |
||
) | [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.
Implements KCal::Calendar.
Definition at line 617 of file calendarlocal.cpp.
Journal::List CalendarLocal::rawJournalsForDate | ( | const QDate & | date | ) | [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.
Implements KCal::Calendar.
Definition at line 629 of file calendarlocal.cpp.
Todo::List CalendarLocal::rawTodos | ( | TodoSortField | sortField = TodoSortUnsorted , |
SortDirection | sortDirection = SortDirectionAscending |
||
) | [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.
Implements KCal::Calendar.
Definition at line 297 of file calendarlocal.cpp.
Todo::List CalendarLocal::rawTodosForDate | ( | const QDate & | date | ) | [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.
Implements KCal::Calendar.
Definition at line 309 of file calendarlocal.cpp.
bool CalendarLocal::reload | ( | ) | [virtual] |
Reloads the contents of the storage into memory.
The associated file name must be known, in other words a previous load() must have been executed.
- Returns:
- true if the reload was successful; false otherwise.
Implements KCal::Calendar.
Definition at line 122 of file calendarlocal.cpp.
bool CalendarLocal::save | ( | ) | [virtual] |
Writes the calendar to disk.
The associated file name and format must be known, in other words a previous load() must have been executed.
- Returns:
- true if the save was successful; false otherwise.
- See also:
- save(const QString &, CalFormat *)
Implements KCal::Calendar.
Definition at line 132 of file calendarlocal.cpp.
bool CalendarLocal::save | ( | const QString & | fileName, |
CalFormat * | format = 0 |
||
) |
Writes 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. If 0, iCalendar will be used.
- Returns:
- true if the save was successful; false otherwise.
- See also:
- save(), load( const QString &, CalFormat *)
Definition at line 146 of file calendarlocal.cpp.
Todo * CalendarLocal::todo | ( | const QString & | uid | ) | [virtual] |
Returns the Todo associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 292 of file calendarlocal.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:10:06 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.