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

Public Member Functions | |
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) |
CalendarLocal (const QString &timeZoneId) | |
CalendarLocal (const KDateTime::Spec &timeSpec) | |
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 (const QDate &start, const QDate &end, const KDateTime::Spec ×pec=KDateTime::Spec(), bool inclusive=false) |
Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEventsForDate (const KDateTime &dt) |
Event::List | rawEventsForDate (const QDate &date, const KDateTime::Spec ×pec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
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 (const QString &fileName, CalFormat *format=0) |
bool | save () |
Todo * | todo (const QString &uid) |
~CalendarLocal () |
Detailed Description
This class provides a calendar stored as a local file.Definition at line 43 of file calendarlocal.h.
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
For internal use only.
Definition at line 101 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 107 of file calendarlocal.cpp.
CalendarLocal::~CalendarLocal | ( | ) |
Destroys the calendar.
Definition at line 113 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 177 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 556 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 228 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 336 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 331 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 162 of file calendarlocal.cpp.
void CalendarLocal::deleteAllEvents | ( | ) | [virtual] |
Removes all Events from the calendar.
- See also:
- deleteEvent()
Implements KCal::Calendar.
Definition at line 208 of file calendarlocal.cpp.
void CalendarLocal::deleteAllJournals | ( | ) | [virtual] |
Removes all Journals from the calendar.
- See also:
- deleteJournal()
Implements KCal::Calendar.
Definition at line 601 of file calendarlocal.cpp.
void CalendarLocal::deleteAllTodos | ( | ) | [virtual] |
Removes all To-dos from the calendar.
- See also:
- deleteTodo()
Implements KCal::Calendar.
Definition at line 284 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 190 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 586 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 264 of file calendarlocal.cpp.
Returns the Event associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 223 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 383 of file calendarlocal.cpp.
Returns the Journal associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 616 of file calendarlocal.cpp.
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 119 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 479 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 544 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 539 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 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 420 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 621 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 633 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 304 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 316 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 126 of file calendarlocal.cpp.
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 150 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 136 of file calendarlocal.cpp.
Returns the Todo associated with the given unique identifier.
- Parameters:
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 299 of file calendarlocal.cpp.
The documentation for this class was generated from the following files: