#include <calendarlocal.h>

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

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)
 
- Public Member Functions inherited from KCal::Calendar
 Calendar (const TQString &timeZoneId)
 
virtual ~Calendar ()
 
void setProductId (const TQString &productId)
 
TQString productId ()
 
void clearException ()
 
ErrorFormatexception () const
 
void setOwner (const Person &owner)
 
const PersongetOwner () const
 
void setTimeZoneId (const TQString &timeZoneId)
 
TQString timeZoneId () const
 
void setLocalTime ()
 
bool isLocalTime () const
 
void setModified (bool modified)
 
bool isModified () const
 
virtual bool isSaving ()
 
TQStringList categories ()
 
virtual bool addIncidence (Incidence *incidence)
 
virtual bool deleteIncidence (Incidence *incidence)
 
virtual Incidence::List incidences ()
 
virtual Incidence::List incidences (const TQDate &date)
 
virtual Incidence::List rawIncidences ()
 
Incidenceincidence (const TQString &uid)
 
IncidenceincidenceFromSchedulingID (const TQString &sid)
 
Incidence::List incidencesFromSchedulingID (const TQString &UID)
 
virtual bool beginChange (Incidence *incidence)
 
virtual bool endChange (Incidence *incidence)
 
IncidencedissociateOccurrence (Incidence *incidence, TQDate date, bool single=true)
 
virtual Event::List events (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
 
Event::List events (const TQDateTime &qdt)
 
Event::List events (const TQDate &start, const TQDate &end, bool inclusive=false)
 
Event::List events (const TQDate &date, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
 
virtual Todo::List todos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
 
virtual Todo::List todos (const TQDate &date)
 
virtual Journal::List journals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
 
virtual Journal::List journals (const TQDate &date)
 
void beginBatchAdding ()
 
void endBatchAdding ()
 
virtual void setupRelations (Incidence *incidence)
 
virtual void removeRelations (Incidence *incidence)
 
void setFilter (CalFilter *filter)
 
CalFilterfilter ()
 
void registerObserver (Observer *observer)
 
void unregisterObserver (Observer *observer)
 
- Public Member Functions inherited from KCal::CustomProperties
 CustomProperties ()
 
 CustomProperties (const CustomProperties &)
 
bool operator== (const CustomProperties &) const
 
void setCustomProperty (const TQCString &app, const TQCString &key, const TQString &value)
 
void removeCustomProperty (const TQCString &app, const TQCString &key)
 
TQString customProperty (const TQCString &app, const TQCString &key) const
 
void setNonKDECustomProperty (const TQCString &name, const TQString &value)
 
void removeNonKDECustomProperty (const TQCString &name)
 
TQString nonKDECustomProperty (const TQCString &name) const
 
void setCustomProperties (const TQMap< TQCString, TQString > &properties)
 
TQMap< TQCString, TQString > customProperties () const
 

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)
 
- Protected Member Functions inherited from KCal::Calendar
void setException (ErrorFormat *e)
 
void incidenceUpdated (IncidenceBase *incidenceBase)
 
virtual void doSetTimeZoneId (const TQString &)
 
void notifyIncidenceAdded (Incidence *incidence)
 
void notifyIncidenceChanged (Incidence *incidence)
 
void notifyIncidenceDeleted (Incidence *incidence)
 
virtual void customPropertyUpdated ()
 
void setObserversEnabled (bool enabled)
 

Additional Inherited Members

- Signals inherited from KCal::Calendar
void calendarChanged ()
 
void calendarSaved ()
 
void calendarLoaded ()
 
void batchAddingBegins ()
 
void batchAddingEnds ()
 
- Static Public Member Functions inherited from KCal::Calendar
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 Event::List sortEventsForDate (Event::List *eventList, const TQDate &date, 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)
 

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::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

◆ addEvent()

bool CalendarLocal::addEvent ( Event event)
virtual

Add Event to calendar.

Implements KCal::Calendar.

Definition at line 147 of file calendarlocal.cpp.

◆ addJournal()

bool CalendarLocal::addJournal ( Journal journal)
virtual

Add a Journal entry to calendar.

Implements KCal::Calendar.

Definition at line 652 of file calendarlocal.cpp.

◆ addTodo()

bool CalendarLocal::addTodo ( Todo todo)
virtual

Add a todo to the todolist.

Implements KCal::Calendar.

Definition at line 214 of file calendarlocal.cpp.

◆ alarms()

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.

◆ alarmsTo()

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

Return all alarms, which ocur before given date.

Definition at line 309 of file calendarlocal.cpp.

◆ appendAlarms()

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.

◆ appendRecurringAlarms()

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.

◆ close()

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.

◆ closeEvents()

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.

◆ closeJournals()

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.

◆ closeTodos()

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.

◆ deleteAllEvents()

void CalendarLocal::deleteAllEvents ( )

Deletes all events from this calendar.

Definition at line 194 of file calendarlocal.cpp.

◆ deleteAllJournals()

void CalendarLocal::deleteAllJournals ( )

Deletes all journals from this calendar.

Definition at line 702 of file calendarlocal.cpp.

◆ deleteAllTodos()

void CalendarLocal::deleteAllTodos ( )

Deletes all todos from this calendar.

Definition at line 265 of file calendarlocal.cpp.

◆ deleteChildEvents()

bool CalendarLocal::deleteChildEvents ( Event event)

Deletes a child event from this calendar.

Definition at line 179 of file calendarlocal.cpp.

◆ deleteChildJournals()

bool CalendarLocal::deleteChildJournals ( Journal journal)

Delete a child journal from this calendar.

Definition at line 687 of file calendarlocal.cpp.

◆ deleteChildTodos()

bool CalendarLocal::deleteChildTodos ( Todo todo)

Deletes a child todo from this calendar.

Definition at line 250 of file calendarlocal.cpp.

◆ deleteEvent()

bool CalendarLocal::deleteEvent ( Event event)
virtual

Deletes an event from this calendar.

Implements KCal::Calendar.

Definition at line 160 of file calendarlocal.cpp.

◆ deleteJournal()

bool CalendarLocal::deleteJournal ( Journal journal)
virtual

Remove a Journal from the calendar.

Implements KCal::Calendar.

Definition at line 670 of file calendarlocal.cpp.

◆ deleteTodo()

bool CalendarLocal::deleteTodo ( Todo todo)
virtual

Remove a todo from the todolist.

Implements KCal::Calendar.

Definition at line 230 of file calendarlocal.cpp.

◆ event()

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.

◆ incidenceUpdated()

void CalendarLocal::incidenceUpdated ( IncidenceBase i)
protected

Notification function of IncidenceBase::Observer.

Definition at line 499 of file calendarlocal.cpp.

◆ insertEvent()

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()

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

Return Journal with given UID.

Implements KCal::Calendar.

Definition at line 714 of file calendarlocal.cpp.

◆ load()

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
fileNamethe name of the calendar on disk.
formatthe format to use. If 0, iCalendar and vCalendar will be used

Definition at line 62 of file calendarlocal.cpp.

◆ rawEvents() [1/2]

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.

◆ rawEvents() [2/2]

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.

◆ rawEventsForDate() [1/2]

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.

◆ rawEventsForDate() [2/2]

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.

◆ rawJournals()

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.

◆ rawJournalsForDate()

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.

◆ rawTodos()

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.

◆ rawTodosForDate()

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.

◆ reload()

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.

◆ save() [1/2]

void KCal::CalendarLocal::save ( )
inlinevirtual

Sync changes in memory to persistant storage.

Implements KCal::Calendar.

Definition at line 96 of file calendarlocal.h.

◆ save() [2/2]

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
fileNamethe name of the file
formatthe format to use
Returns
true, if successful, false on error.

Definition at line 80 of file calendarlocal.cpp.

◆ setTimeZoneIdViewOnly()

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()

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: