#include <calendarnull.h>

Inheritance diagram for KCal::CalendarNull:
KCal::Calendar KCal::CustomProperties

Public Member Functions

 CalendarNull (const TQString &timeZoneId)
 
 ~CalendarNull ()
 
void close ()
 
void closeEvents ()
 
void closeTodos ()
 
void closeJournals ()
 
void save ()
 
bool reload (const TQString &)
 
bool addEvent (Event *)
 
bool deleteEvent (Event *)
 
Event::List rawEvents (EventSortField, SortDirection)
 
Event::List rawEvents (const TQDate &, const TQDate &, bool)
 
Event::List rawEventsForDate (const TQDateTime &)
 
Event::List rawEventsForDate (const TQDate &, EventSortField, SortDirection)
 
Eventevent (const TQString &)
 
bool addTodo (Todo *)
 
bool deleteTodo (Todo *)
 
Todo::List rawTodos (TodoSortField, SortDirection)
 
Todo::List rawTodosForDate (const TQDate &)
 
Todotodo (const TQString &)
 
bool addJournal (Journal *)
 
bool deleteJournal (Journal *)
 
Journal::List rawJournals (JournalSortField, SortDirection)
 
Journal::List rawJournalsForDate (const TQDate &)
 
Journaljournal (const TQString &)
 
Alarm::List alarms (const TQDateTime &, const TQDateTime &)
 
void incidenceUpdated (IncidenceBase *)
 
void setTimeZoneIdViewOnly (const TQString &)
 
- 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
 

Static Public Member Functions

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

Additional Inherited Members

- Signals inherited from KCal::Calendar
void calendarChanged ()
 
void calendarSaved ()
 
void calendarLoaded ()
 
void batchAddingBegins ()
 
void batchAddingEnds ()
 
- 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)
 

Detailed Description

This is a null calendar class which does nothing.

It can be passed to functions which need a calendar object when there actually isn't a real calendar yet. CalendarNull can be used to implement the null object design pattern. Instead of passing a 0 pointer and checking for 0 with each access a CalendarNull object can be passed.

Definition at line 50 of file calendarnull.h.

Constructor & Destructor Documentation

◆ CalendarNull()

CalendarNull::CalendarNull ( const TQString &  timeZoneId)

Constructor.

Definition at line 31 of file calendarnull.cpp.

◆ ~CalendarNull()

KCal::CalendarNull::~CalendarNull ( )
inline

Destructor.

Definition at line 61 of file calendarnull.h.

Member Function Documentation

◆ addEvent()

bool KCal::CalendarNull::addEvent ( Event )
inlinevirtual

Insert an Evenet into the Calendar.

First parameter is a pointer to the Event to insert.

Returns false.

Implements KCal::Calendar.

Definition at line 105 of file calendarnull.h.

◆ addJournal()

bool KCal::CalendarNull::addJournal ( Journal )
inlinevirtual

Insert a Journal into the Calendar.

First parameter is a pointer to the Journal to insert.

Returns false.

Implements KCal::Calendar.

Definition at line 246 of file calendarnull.h.

◆ addTodo()

bool KCal::CalendarNull::addTodo ( Todo )
inlinevirtual

Insert a Todo into the Calendar.

First parameter is a pointer to the Todo to insert.

Returns false.

Implements KCal::Calendar.

Definition at line 191 of file calendarnull.h.

◆ alarms()

Alarm::List KCal::CalendarNull::alarms ( const TQDateTime &  ,
const TQDateTime &   
)
inlinevirtual

Return a list of Alarms within a time range for this Calendar.

First parameter is the starting timestamp.
Second parameter is the ending timestamp.

Returns an empty Alarm List.

Implements KCal::Calendar.

Definition at line 302 of file calendarnull.h.

◆ close()

void KCal::CalendarNull::close ( )
inlinevirtual

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

Implements KCal::Calendar.

Definition at line 72 of file calendarnull.h.

◆ closeEvents()

void KCal::CalendarNull::closeEvents ( )
inlinevirtual

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

Implements KCal::Calendar.

Definition at line 77 of file calendarnull.h.

◆ closeJournals()

void KCal::CalendarNull::closeJournals ( )
inlinevirtual

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

Implements KCal::Calendar.

Definition at line 87 of file calendarnull.h.

◆ closeTodos()

void KCal::CalendarNull::closeTodos ( )
inlinevirtual

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

Implements KCal::Calendar.

Definition at line 82 of file calendarnull.h.

◆ deleteEvent()

bool KCal::CalendarNull::deleteEvent ( Event )
inlinevirtual

Remove an Event from the Calendar.

First parameter is a pointer to the Event to remove.

Returns false.

Implements KCal::Calendar.

Definition at line 115 of file calendarnull.h.

◆ deleteJournal()

bool KCal::CalendarNull::deleteJournal ( Journal )
inlinevirtual

Remove a Journal from the Calendar.

First parameter is a pointer to the Journal to remove.

Returns false.

Implements KCal::Calendar.

Definition at line 256 of file calendarnull.h.

◆ deleteTodo()

bool KCal::CalendarNull::deleteTodo ( Todo )
inlinevirtual

Remove a Todo from the Calendar.

First parameter is a pointer to the Todo to remove.

Returns false.

Implements KCal::Calendar.

Definition at line 201 of file calendarnull.h.

◆ event()

Event* KCal::CalendarNull::event ( const TQString &  )
inlinevirtual

Returns the Event associated with the given unique identifier.

First parameter is a unique identifier string.

Return a null Event pointer.

Implements KCal::Calendar.

Definition at line 179 of file calendarnull.h.

◆ incidenceUpdated()

void KCal::CalendarNull::incidenceUpdated ( IncidenceBase )
inline

The Observer interface.

So far not implemented. First parameter is a pointer an IncidenceBase object.

Definition at line 311 of file calendarnull.h.

◆ journal()

Journal* KCal::CalendarNull::journal ( const TQString &  )
inlinevirtual

Returns the Journal associated with the given unique identifier.

First parameter is a unique identifier string.

Returns an null Journal pointer.

Implements KCal::Calendar.

Definition at line 288 of file calendarnull.h.

◆ rawEvents() [1/2]

Event::List KCal::CalendarNull::rawEvents ( const TQDate &  ,
const TQDate &  ,
bool   
)
inlinevirtual

Return an unfiltered list of all Events occurring within a date range.

First parameter is the starting date.
Second parameter is the ending date.
Third parameter, if true, specifies that only Events which are completely included within the date range are returned.

Returns an empty Event List.

Implements KCal::Calendar.

Definition at line 140 of file calendarnull.h.

◆ rawEvents() [2/2]

Event::List KCal::CalendarNull::rawEvents ( EventSortField  ,
SortDirection   
)
inlinevirtual

Return a sorted, unfiltered list of all Events for this Calendar.

First parameter specifies the EventSortField.
Second parameter specifies the SortDirection.

Returns an empty Event List.

Implements KCal::Calendar.

Definition at line 126 of file calendarnull.h.

◆ rawEventsForDate() [1/2]

Event::List KCal::CalendarNull::rawEventsForDate ( const TQDate &  ,
EventSortField  ,
SortDirection   
)
inlinevirtual

Return a sorted, unfiltered list of all Events which occur on the given date.

The Events are sorted according to sortField and sortDirection.

First parameter is a TQDate to return unfiltered Events for.
Second parameter specifies the EventSortField.
Third parameter specifies the SortDirection.

Returns an empty Event List.

Implements KCal::Calendar.

Definition at line 166 of file calendarnull.h.

◆ rawEventsForDate() [2/2]

Event::List KCal::CalendarNull::rawEventsForDate ( const TQDateTime &  )
inlinevirtual

Return an unfiltered list of all Events which occur on the given timestamp.

First parameter is a TQDateTime to return unfiltered events for.

Returns an empty Event List.

Implements KCal::Calendar.

Definition at line 152 of file calendarnull.h.

◆ rawJournals()

Journal::List KCal::CalendarNull::rawJournals ( JournalSortField  ,
SortDirection   
)
inlinevirtual

Return a sorted, filtered list of all Journals for this Calendar.

First parameter specifies the JournalSortField.
Second parameterd specifies the SortDirection.

Returns an empty Journal List.

Implements KCal::Calendar.

Definition at line 267 of file calendarnull.h.

◆ rawJournalsForDate()

Journal::List KCal::CalendarNull::rawJournalsForDate ( const TQDate &  )
inlinevirtual

Return an unfiltered list of all Journals for on the specifed date.

First parameter specifies the data to return the unfiltered Journals for.

Returns an empty Journal List.

Implements KCal::Calendar.

Definition at line 278 of file calendarnull.h.

◆ rawTodos()

Todo::List KCal::CalendarNull::rawTodos ( TodoSortField  ,
SortDirection   
)
inlinevirtual

Return a sorted, unfiltered list of all Todos for this Calendar.

First parameter specifies the TodoSortField.
Second parameter specifies the SortDirection.

Returns an empty Todo List.

Implements KCal::Calendar.

Definition at line 212 of file calendarnull.h.

◆ rawTodosForDate()

Todo::List KCal::CalendarNull::rawTodosForDate ( const TQDate &  )
inlinevirtual

Return an unfiltered list of all Todos for this Calendar which are due on the specifed date.

First parameter is the due date to return unfiltered Todos for.

Returns an empty Todo List.

Implements KCal::Calendar.

Definition at line 224 of file calendarnull.h.

◆ reload()

bool KCal::CalendarNull::reload ( const TQString &  tz)
inlinevirtual

Load the calendar contents from storage.

This requires the calendar to have been loaded once before, in other words initialized.

tz The timezone to use for loading.

Implements KCal::Calendar.

Definition at line 94 of file calendarnull.h.

◆ save()

void KCal::CalendarNull::save ( )
inlinevirtual

Sync changes in memory to persistant storage.

Implements KCal::Calendar.

Definition at line 92 of file calendarnull.h.

◆ self()

CalendarNull * CalendarNull::self ( )
static

Returns a pointer to a CalendarNull object, which is constructed if necessary.

Definition at line 37 of file calendarnull.cpp.

◆ setTimeZoneIdViewOnly()

void KCal::CalendarNull::setTimeZoneIdViewOnly ( const TQString &  timeZoneId)
inlinevirtual

Set the timezone used for viewing the incidences in this calendar.

In case it differs from the current timezone, shift the events such that they retain their absolute time (in UTC). setTimeZoneId

Implements KCal::Calendar.

Definition at line 313 of file calendarnull.h.

◆ todo()

Todo* KCal::CalendarNull::todo ( const TQString &  )
inlinevirtual

Returns the Todo associated with the given unique identifier.

First parameter is a unique identifier string.

Returns a null Todo pointer.

Implements KCal::Calendar.

Definition at line 234 of file calendarnull.h.


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