libkcal

KCal::CalendarLocal Class Reference

This class provides a calendar stored as a local file. More...

#include <calendarlocal.h>

Inheritance diagram for KCal::CalendarLocal:
KCal::Calendar KCal::CustomProperties

List of all members.

Public Member Functions

 CalendarLocal (const TQString &timeZoneId)
bool load (const TQString &fileName, CalFormat *format=0)
bool reload (const TQString &tz)
bool save (const TQString &fileName, CalFormat *format=0)
void close ()
void closeEvents ()
void closeTodos ()
void closeJournals ()
void save ()
bool addEvent (Event *event)
bool deleteEvent (Event *event)
bool deleteChildEvents (Event *event)
void deleteAllEvents ()
Eventevent (const TQString &uid)
Event::List rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
bool addTodo (Todo *todo)
bool deleteTodo (Todo *)
bool deleteChildTodos (Todo *todo)
void deleteAllTodos ()
Todotodo (const TQString &uid)
Todo::List rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Todo::List rawTodosForDate (const TQDate &date)
bool addJournal (Journal *)
bool deleteJournal (Journal *)
bool deleteChildJournals (Journal *journal)
void deleteAllJournals ()
Journaljournal (const TQString &uid)
Journal::List rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Journal::List rawJournalsForDate (const TQDate &date)
Alarm::List alarms (const TQDateTime &from, const TQDateTime &to)
Alarm::List alarmsTo (const TQDateTime &to)
Event::List rawEventsForDate (const TQDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Event::List rawEventsForDate (const TQDateTime &qdt)
Event::List rawEvents (const TQDate &start, const TQDate &end, bool inclusive=false)
void setTimeZoneIdViewOnly (const TQString &tz)

Protected Member Functions

void incidenceUpdated (IncidenceBase *i)
void insertEvent (Event *event)
void appendAlarms (Alarm::List &alarms, Incidence *incidence, const TQDateTime &from, const TQDateTime &to)
void appendRecurringAlarms (Alarm::List &alarms, Incidence *incidence, const TQDateTime &from, const TQDateTime &to)

Detailed Description

This class provides a calendar stored as a local file.

Definition at line 36 of file calendarlocal.h.


Constructor & Destructor Documentation

CalendarLocal::CalendarLocal ( const TQString &  timeZoneId  ) 

Constructs a new calendar, with variables initialized to sane values.

Definition at line 44 of file calendarlocal.cpp.


Member Function Documentation

bool CalendarLocal::addEvent ( Event event  )  [virtual]

Add Event to calendar.

Implements KCal::Calendar.

Definition at line 147 of file calendarlocal.cpp.

bool CalendarLocal::addJournal ( Journal journal  )  [virtual]

Add a Journal entry to calendar.

Implements KCal::Calendar.

Definition at line 652 of file calendarlocal.cpp.

bool CalendarLocal::addTodo ( Todo todo  )  [virtual]

Add a todo to the todolist.

Implements KCal::Calendar.

Definition at line 214 of file calendarlocal.cpp.

Alarm::List CalendarLocal::alarms ( const TQDateTime &  from,
const TQDateTime &  to 
) [virtual]

Return all alarms, which ocur in the given time interval.

Implements KCal::Calendar.

Definition at line 314 of file calendarlocal.cpp.

Alarm::List CalendarLocal::alarmsTo ( const TQDateTime &  to  ) 

Return all alarms, which ocur before given date.

Definition at line 309 of file calendarlocal.cpp.

void CalendarLocal::appendAlarms ( Alarm::List alarms,
Incidence incidence,
const TQDateTime &  from,
const TQDateTime &  to 
) [protected]

Append alarms of incidence in interval to list of alarms.

Definition at line 341 of file calendarlocal.cpp.

void CalendarLocal::appendRecurringAlarms ( Alarm::List alarms,
Incidence incidence,
const TQDateTime &  from,
const TQDateTime &  to 
) [protected]

Append alarms of recurring events in interval to list of alarms.

Definition at line 361 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 92 of file calendarlocal.cpp.

void CalendarLocal::closeEvents (  )  [virtual]

Clears out the current calendar, freeing all used memory etc.

etc.

Implements KCal::Calendar.

Definition at line 107 of file calendarlocal.cpp.

void CalendarLocal::closeJournals (  )  [virtual]

Clears out the current calendar, freeing all used memory etc.

etc.

Implements KCal::Calendar.

Definition at line 133 of file calendarlocal.cpp.

void CalendarLocal::closeTodos (  )  [virtual]

Clears out the current calendar, freeing all used memory etc.

etc.

Implements KCal::Calendar.

Definition at line 120 of file calendarlocal.cpp.

void CalendarLocal::deleteAllEvents (  ) 

Deletes all events from this calendar.

Definition at line 194 of file calendarlocal.cpp.

void CalendarLocal::deleteAllJournals (  ) 

Deletes all journals from this calendar.

Definition at line 702 of file calendarlocal.cpp.

void CalendarLocal::deleteAllTodos (  ) 

Deletes all todos from this calendar.

Definition at line 265 of file calendarlocal.cpp.

bool CalendarLocal::deleteChildEvents ( Event event  ) 

Deletes a child event from this calendar.

Definition at line 179 of file calendarlocal.cpp.

bool CalendarLocal::deleteChildJournals ( Journal journal  ) 

Delete a child journal from this calendar.

Definition at line 687 of file calendarlocal.cpp.

bool CalendarLocal::deleteChildTodos ( Todo todo  ) 

Deletes a child todo from this calendar.

Definition at line 250 of file calendarlocal.cpp.

bool CalendarLocal::deleteEvent ( Event event  )  [virtual]

Deletes an event from this calendar.

Implements KCal::Calendar.

Definition at line 160 of file calendarlocal.cpp.

bool CalendarLocal::deleteJournal ( Journal journal  )  [virtual]

Remove a Journal from the calendar.

Implements KCal::Calendar.

Definition at line 670 of file calendarlocal.cpp.

bool CalendarLocal::deleteTodo ( Todo todo  )  [virtual]

Remove a todo from the todolist.

Implements KCal::Calendar.

Definition at line 230 of file calendarlocal.cpp.

Event * CalendarLocal::event ( const TQString &  uid  )  [virtual]

Retrieves an event on the basis of the unique string ID.

Implements KCal::Calendar.

Definition at line 208 of file calendarlocal.cpp.

void CalendarLocal::incidenceUpdated ( IncidenceBase i  )  [protected]

Notification function of IncidenceBase::Observer.

Reimplemented from KCal::Calendar.

Definition at line 499 of file calendarlocal.cpp.

void CalendarLocal::insertEvent ( Event event  )  [protected]

inserts an event into its "proper place" in the calendar.

Definition at line 513 of file calendarlocal.cpp.

Journal * CalendarLocal::journal ( const TQString &  uid  )  [virtual]

Return Journal with given UID.

Implements KCal::Calendar.

Definition at line 714 of file calendarlocal.cpp.

bool CalendarLocal::load ( const TQString &  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 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().

Returns:
true, if successful, false on error.
Parameters:
fileName the name of the calendar on disk.
format the format to use. If 0, iCalendar and vCalendar will be used

Definition at line 62 of file calendarlocal.cpp.

Event::List CalendarLocal::rawEvents ( const TQDate &  start,
const TQDate &  end,
bool  inclusive = false 
) [virtual]

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 560 of file calendarlocal.cpp.

Event::List CalendarLocal::rawEvents ( EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
) [virtual]

Return unfiltered list of all events in calendar.

Implements KCal::Calendar.

Definition at line 643 of file calendarlocal.cpp.

Event::List CalendarLocal::rawEventsForDate ( const TQDateTime &  qdt  )  [virtual]

Get unfiltered events for date qdt.

Implements KCal::Calendar.

Definition at line 638 of file calendarlocal.cpp.

Event::List CalendarLocal::rawEventsForDate ( const TQDate &  date,
EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
) [virtual]

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 526 of file calendarlocal.cpp.

Journal::List CalendarLocal::rawJournals ( JournalSortField  sortField = JournalSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
) [virtual]

Return list of all journals.

Implements KCal::Calendar.

Definition at line 724 of file calendarlocal.cpp.

Journal::List CalendarLocal::rawJournalsForDate ( const TQDate &  date  )  [virtual]

Get unfiltered journals for a given date.

Implements KCal::Calendar.

Definition at line 729 of file calendarlocal.cpp.

Todo::List CalendarLocal::rawTodos ( TodoSortField  sortField = TodoSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
) [virtual]

Return list of all todos.

Implements KCal::Calendar.

Definition at line 278 of file calendarlocal.cpp.

Todo::List CalendarLocal::rawTodosForDate ( const TQDate &  date  )  [virtual]

Returns list of todos due on the specified date.

Implements KCal::Calendar.

Definition at line 294 of file calendarlocal.cpp.

bool CalendarLocal::reload ( const TQString &  tz  )  [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:
success or failure

Implements KCal::Calendar.

Definition at line 69 of file calendarlocal.cpp.

void KCal::CalendarLocal::save (  )  [inline, virtual]

Sync changes in memory to persistant storage.

Implements KCal::Calendar.

Definition at line 96 of file calendarlocal.h.

bool CalendarLocal::save ( const TQString &  fileName,
CalFormat format = 0 
)

Writes out 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
Returns:
true, if successful, false on error.

Definition at line 80 of file calendarlocal.cpp.

void CalendarLocal::setTimeZoneIdViewOnly ( const TQString &  tz  )  [virtual]

Set the timezone of the calendar to be used for interpreting the events in the calendar.

This requires that the calendar is saved first, so the user is asked whether he wants to do that, or keep the timezone as is.

Implements KCal::Calendar.

Definition at line 744 of file calendarlocal.cpp.

Todo * CalendarLocal::todo ( const TQString &  uid  )  [virtual]

Searches todolist for an event with this unique string identifier, returns a pointer or null.

Implements KCal::Calendar.

Definition at line 284 of file calendarlocal.cpp.


The documentation for this class was generated from the following files: