• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • Calendar
Classes | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
KCal::Calendar Class Reference

#include <calendar.h>

Inheritance diagram for KCal::Calendar:
KCal::CustomProperties KCal::IncidenceBase::IncidenceObserver KCal::CalendarLocal KCal::CalendarNull KCal::CalendarResources

List of all members.

Classes

class  CalendarObserver
 The CalendarObserver class. More...

Signals

void batchAddingBegins ()
void batchAddingEnds ()
void calendarChanged ()
void calendarLoaded ()
void calendarSaved ()

Public Member Functions

 Calendar (const KDateTime::Spec &timeSpec)
 Calendar (const QString &timeZoneId)
virtual ~Calendar ()
virtual bool addEvent (Event *event)=0
virtual bool addIncidence (Incidence *incidence)
virtual bool addJournal (Journal *journal)=0
virtual bool addTodo (Todo *todo)=0
virtual Alarm::List alarms (const KDateTime &from, const KDateTime &to)=0
void beginBatchAdding ()
virtual bool beginChange (Incidence *incidence)
QStringList categories ()
virtual void close ()=0
virtual void deleteAllEvents ()=0
virtual void deleteAllJournals ()=0
virtual void deleteAllTodos ()=0
virtual bool deleteEvent (Event *event)=0
virtual bool deleteIncidence (Incidence *incidence)
virtual bool deleteJournal (Journal *journal)=0
virtual bool deleteTodo (Todo *todo)=0
Incidence * dissociateOccurrence (Incidence *incidence, const QDate &date, const KDateTime::Spec &spec, bool single=true)
void endBatchAdding ()
virtual bool endChange (Incidence *incidence)
virtual Event * event (const QString &uid)=0
virtual Event::List events (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Event::List events (const KDateTime &dt)
Event::List events (const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false)
Event::List events (const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
CalFilter * filter ()
Incidence * incidence (const QString &uid)
Incidence * incidenceFromSchedulingID (const QString &sid)
virtual Incidence::List incidences ()
virtual Incidence::List incidences (const QDate &date)
Incidence::List incidencesFromSchedulingID (const QString &sid)
bool isAncestorOf (Incidence *ancestor, Incidence *incidence)
bool isModified () const
virtual bool isSaving ()
virtual Journal * journal (const QString &uid)=0
virtual Journal::List journals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
virtual Journal::List journals (const QDate &date)
Person owner () const
QString productId () const
virtual Event::List rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
virtual Event::List rawEvents (const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false)=0
virtual Event::List rawEventsForDate (const KDateTime &dt)=0
virtual Event::List rawEventsForDate (const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
virtual Incidence::List rawIncidences ()
virtual Journal::List rawJournals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
virtual Journal::List rawJournalsForDate (const QDate &date)=0
virtual Todo::List rawTodos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
virtual Todo::List rawTodosForDate (const QDate &date)=0
void registerObserver (CalendarObserver *observer)
virtual bool reload ()=0
virtual void removeRelations (Incidence *incidence)
virtual bool save ()=0
void setFilter (CalFilter *filter)
void setModified (bool modified)
void setOwner (const Person &owner)
void setProductId (const QString &id)
void setTimeSpec (const KDateTime::Spec &timeSpec)
void setTimeZoneId (const QString &timeZoneId)
void setTimeZones (const ICalTimeZones &zones)
virtual void setupRelations (Incidence *incidence)
void setViewTimeSpec (const KDateTime::Spec &timeSpec) const
void setViewTimeZoneId (const QString &timeZoneId) const
void shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
KDateTime::Spec timeSpec () const
QString timeZoneId () const
ICalTimeZones * timeZones () const
virtual Todo * todo (const QString &uid)=0
virtual Todo::List todos (TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
virtual Todo::List todos (const QDate &date)
void unregisterObserver (CalendarObserver *observer)
KDateTime::Spec viewTimeSpec () const
QString viewTimeZoneId () const
- Public Member Functions inherited from KCal::CustomProperties
 CustomProperties ()
 CustomProperties (const CustomProperties &other)
virtual ~CustomProperties ()
QMap< QByteArray, QString > customProperties () const
QString customProperty (const QByteArray &app, const QByteArray &key) const
QString nonKDECustomProperty (const QByteArray &name) const
CustomProperties & operator= (const CustomProperties &other)
bool operator== (const CustomProperties &properties) const
void removeCustomProperty (const QByteArray &app, const QByteArray &key)
void removeNonKDECustomProperty (const QByteArray &name)
void setCustomProperties (const QMap< QByteArray, QString > &properties)
void setCustomProperty (const QByteArray &app, const QByteArray &key, const QString &value)
void setNonKDECustomProperty (const QByteArray &name, const QString &value)
- Public Member Functions inherited from KCal::IncidenceBase::IncidenceObserver
virtual ~IncidenceObserver ()

Static Public Member Functions

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 QDate &date, const KDateTime::Spec &timeSpec, EventSortField sortField, SortDirection sortDirection)
static Journal::List sortJournals (Journal::List *journalList, JournalSortField sortField, SortDirection sortDirection)
static Todo::List sortTodos (Todo::List *todoList, TodoSortField sortField, SortDirection sortDirection)
- Static Public Member Functions inherited from KCal::CustomProperties
static QByteArray customPropertyName (const QByteArray &app, const QByteArray &key)

Protected Member Functions

void appendAlarms (Alarm::List &alarms, Incidence *incidence, const KDateTime &from, const KDateTime &to)
void appendRecurringAlarms (Alarm::List &alarms, Incidence *incidence, const KDateTime &from, const KDateTime &to)
virtual void customPropertyUpdated ()
virtual void doSetTimeSpec (const KDateTime::Spec &timeSpec)
void incidenceUpdated (IncidenceBase *incidenceBase)
void notifyIncidenceAdded (Incidence *incidence)
void notifyIncidenceChanged (Incidence *incidence)
void notifyIncidenceDeleted (Incidence *incidence)
void setObserversEnabled (bool enabled)

Detailed Description

Represents the main calendar class.

A calendar contains information like incidences (events, to-dos, journals), alarms, time zones, and other useful information.

This is an abstract base class defining the interface to a calendar. It is implemented by subclasses like CalendarLocal, which use different methods to store and access the data.

Ownership of Incidences:

Incidence ownership is handled by the following policy: as soon as an incidence (or any other subclass of IncidenceBase) is added to the Calendar by an add...() method it is owned by the Calendar object. The Calendar takes care of deleting the incidence using the delete...() methods. All Incidences returned by the query functions are returned as pointers so that changes to the returned Incidences are immediately visible in the Calendar. Do Not attempt to 'delete' any Incidence object you get from Calendar – use the delete...() methods.

Definition at line 119 of file calendar.h.


Constructor & Destructor Documentation

Calendar::Calendar ( const KDateTime::Spec &  timeSpec)
explicit

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

Definition at line 106 of file calendar.cpp.

Calendar::Calendar ( 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:
timeZoneIdis 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 113 of file calendar.cpp.

Calendar::~Calendar ( )
virtual

Destroys the calendar.

Definition at line 119 of file calendar.cpp.


Member Function Documentation

virtual bool KCal::Calendar::addEvent ( Event *  event)
pure virtual

Inserts an Event into the calendar.

Parameters:
eventis a pointer to the Event to insert.
Returns:
true if the Event was successfully inserted; false otherwise.
See also:
deleteEvent()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

bool Calendar::addIncidence ( Incidence *  incidence)
virtual

Inserts an Incidence into the calendar.

Parameters:
incidenceis a pointer to the Incidence to insert.
Returns:
true if the Incidence was successfully inserted; false otherwise.
See also:
deleteIncidence()

Reimplemented in KCal::CalendarResources.

Definition at line 573 of file calendar.cpp.

virtual bool KCal::Calendar::addJournal ( Journal *  journal)
pure virtual

Inserts a Journal into the calendar.

Parameters:
journalis a pointer to the Journal to insert.
Returns:
true if the Journal was successfully inserted; false otherwise.
See also:
deleteJournal()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual bool KCal::Calendar::addTodo ( Todo *  todo)
pure virtual

Inserts a Todo into the calendar.

Parameters:
todois a pointer to the Todo to insert.
Returns:
true if the Todo was successfully inserted; false otherwise.
See also:
deleteTodo()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Alarm::List KCal::Calendar::alarms ( const KDateTime &  from,
const KDateTime &  to 
)
pure virtual

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

Parameters:
fromis the starting timestamp.
tois the ending timestamp.
Returns:
the list of Alarms for the for the specified time range.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

void Calendar::appendAlarms ( Alarm::List &  alarms,
Incidence *  incidence,
const KDateTime &  from,
const KDateTime &  to 
)
protected

Appends alarms of incidence in interval to list of alarms.

Parameters:
alarmsis a List of Alarms to be appended onto.
incidenceis a pointer to an Incidence containing the Alarm to be appended.
fromis the lower range of the next Alarm repitition.
tois the upper range of the next Alarm repitition.

Definition at line 1246 of file calendar.cpp.

void Calendar::appendRecurringAlarms ( Alarm::List &  alarms,
Incidence *  incidence,
const KDateTime &  from,
const KDateTime &  to 
)
protected

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

Parameters:
alarmsis a List of Alarms to be appended onto.
incidenceis a pointer to an Incidence containing the Alarm to be appended.
fromis the lower range of the next Alarm repitition.
tois the upper range of the next Alarm repitition.

Definition at line 1263 of file calendar.cpp.

void KCal::Calendar::batchAddingBegins ( )
signal
See also:
beginBatchAdding()
Since:
4.4
void KCal::Calendar::batchAddingEnds ( )
signal
See also:
endBatchAdding()
Since:
4.4
void Calendar::beginBatchAdding ( )

Emits the beginBatchAdding() signal.

This should be called before adding a batch of incidences with addIncidence( Incidence *), addTodo( Todo *), addEvent( Event *) or addJournal( Journal *). Some Calendars are connected to this signal, e.g: CalendarResources uses it to know a series of incidenceAdds are related so the user isn't prompted multiple times which resource to save the incidence to

Since:
4.4

Definition at line 939 of file calendar.cpp.

bool Calendar::beginChange ( Incidence *  incidence)
virtual

Flag that a change to a Calendar Incidence is starting.

Parameters:
incidenceis a pointer to the Incidence that will be changing.

Reimplemented in KCal::CalendarResources.

Definition at line 1229 of file calendar.cpp.

void KCal::Calendar::calendarChanged ( )
signal

Signals that the calendar has been modified.

void KCal::Calendar::calendarLoaded ( )
signal

Signals that the calendar has been loaded into memory.

void KCal::Calendar::calendarSaved ( )
signal

Signals that the calendar has been saved.

QStringList Calendar::categories ( )

Returns a list of all categories used by Incidences in this Calendar.

Returns:
a QStringList containing all the categories.

Definition at line 258 of file calendar.cpp.

virtual void KCal::Calendar::close ( )
pure virtual

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

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

void Calendar::customPropertyUpdated ( )
protectedvirtual

The default implementation does nothing: override in derived classes to perform change processing.

Reimplemented from KCal::CustomProperties.

Definition at line 1192 of file calendar.cpp.

virtual void KCal::Calendar::deleteAllEvents ( )
pure virtual

Removes all Events from the calendar.

See also:
deleteEvent()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual void KCal::Calendar::deleteAllJournals ( )
pure virtual

Removes all Journals from the calendar.

See also:
deleteJournal()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual void KCal::Calendar::deleteAllTodos ( )
pure virtual

Removes all To-dos from the calendar.

See also:
deleteTodo()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual bool KCal::Calendar::deleteEvent ( Event *  event)
pure virtual

Removes an Event from the calendar.

Parameters:
eventis a pointer to the Event to remove.
Returns:
true if the Event was successfully remove; false otherwise.
See also:
addEvent(), deleteAllEvents()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

bool Calendar::deleteIncidence ( Incidence *  incidence)
virtual

Removes an Incidence from the calendar.

Parameters:
incidenceis a pointer to the Incidence to remove.
Returns:
true if the Incidence was successfully removed; false otherwise.
See also:
addIncidence()

Definition at line 580 of file calendar.cpp.

virtual bool KCal::Calendar::deleteJournal ( Journal *  journal)
pure virtual

Removes a Journal from the calendar.

Parameters:
journalis a pointer to the Journal to remove.
Returns:
true if the Journal was successfully removed; false otherwise.
See also:
addJournal(), deleteAllJournals()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual bool KCal::Calendar::deleteTodo ( Todo *  todo)
pure virtual

Removes a Todo from the calendar.

Parameters:
todois a pointer to the Todo to remove.
Returns:
true if the Todo was successfully removed; false otherwise.
See also:
addTodo(), deleteAllTodos()

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

Incidence * Calendar::dissociateOccurrence ( Incidence *  incidence,
const QDate &  date,
const KDateTime::Spec &  spec,
bool  single = true 
)

Dissociate an Incidence from a recurring Incidence.

By default, only one single Incidence for the specified date will be dissociated and returned. If single is false, then the recurrence will be split at date, the old Incidence will have its recurrence ending at date and the new Incidence will have all recurrences past the date.

Parameters:
incidenceis a pointer to a recurring Incidence.
dateis the QDate within the recurring Incidence on which the dissociation will be performed.
specis the spec in which the date is formulated.
singleis a flag meaning that a new Incidence should be created from the recurring Incidences after date.
Returns:
a pointer to a new recurring Incidence if single is false.

Definition at line 595 of file calendar.cpp.

void Calendar::doSetTimeSpec ( const KDateTime::Spec &  timeSpec)
protectedvirtual

Let Calendar subclasses set the time specification.

Parameters:
timeSpecis the time specification (time zone, etc.) for viewing Incidence dates.

Reimplemented in KCal::CalendarResources.

Definition at line 1154 of file calendar.cpp.

void Calendar::endBatchAdding ( )

Emits the endBatchAdding() signal.

Used with beginBatchAdding(). Should be called after adding all incidences.

Since:
4.4

Definition at line 944 of file calendar.cpp.

bool Calendar::endChange ( Incidence *  incidence)
virtual

Flag that a change to a Calendar Incidence has completed.

Parameters:
incidenceis a pointer to the Incidence that was changed.

Reimplemented in KCal::CalendarResources.

Definition at line 1235 of file calendar.cpp.

virtual Event* KCal::Calendar::event ( const QString &  uid)
pure virtual

Returns the Event associated with the given unique identifier.

Parameters:
uidis a unique identifier string.
Returns:
a pointer to the Event. A null pointer is returned if no such Event exists.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

Event::List Calendar::events ( EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
virtual

Returns a sorted, filtered list of all Events for this Calendar.

Parameters:
sortFieldspecifies the EventSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all filtered Events sorted as specified.

Definition at line 565 of file calendar.cpp.

Event::List Calendar::events ( const KDateTime &  dt)

Returns a filtered list of all Events which occur on the given timestamp.

Parameters:
dtrequest filtered Event list for this KDateTime only.
Returns:
the list of filtered Events occurring on the specified timestamp.

Definition at line 549 of file calendar.cpp.

Event::List Calendar::events ( const QDate &  start,
const QDate &  end,
const KDateTime::Spec &  timeSpec = KDateTime::Spec(),
bool  inclusive = false 
)

Returns a filtered list of all Events occurring within a date range.

Parameters:
startis the starting date.
endis the ending date.
timeSpectime zone etc. to interpret start and end, or the calendar's default time spec if none is specified
inclusiveif true only Events which are completely included within the date range are returned.
Returns:
the list of filtered Events occurring within the specified date range.

Definition at line 556 of file calendar.cpp.

Event::List Calendar::events ( const QDate &  date,
const KDateTime::Spec &  timeSpec = KDateTime::Spec(),
EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)

Returns a sorted, filtered list of all Events which occur on the given date.

The Events are sorted according to sortField and sortDirection.

Parameters:
daterequest filtered Event list for this QDate only.
timeSpectime zone etc. to interpret start and end, or the calendar's default time spec if none is specified
sortFieldspecifies the EventSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of sorted, filtered Events occurring on date.

Definition at line 539 of file calendar.cpp.

CalFilter * Calendar::filter ( )

Returns the calendar filter.

Returns:
a pointer to the calendar CalFilter. A null pointer is returned if no such CalFilter exists.
See also:
setFilter()

Definition at line 253 of file calendar.cpp.

Incidence * Calendar::incidence ( const QString &  uid)

Returns the Incidence associated with the given unique identifier.

Parameters:
uidis a unique identifier string.
Returns:
a pointer to the Incidence. A null pointer is returned if no such Incidence exists.

Definition at line 669 of file calendar.cpp.

Incidence * Calendar::incidenceFromSchedulingID ( const QString &  sid)

Returns the Incidence associated with the given scheduling identifier.

Parameters:
sidis a unique scheduling identifier string.
Returns:
a pointer to the Incidence. A null pointer is returned if no such Incidence exists.

Definition at line 698 of file calendar.cpp.

Incidence::List Calendar::incidences ( )
virtual

Returns a filtered list of all Incidences for this Calendar.

Returns:
the list of all filtered Incidences.

Definition at line 282 of file calendar.cpp.

Incidence::List Calendar::incidences ( const QDate &  date)
virtual

Returns a filtered list of all Incidences which occur on the given date.

Parameters:
daterequest filtered Incidence list for this QDate only.
Returns:
the list of filtered Incidences occurring on the specified date.

Definition at line 277 of file calendar.cpp.

Incidence::List Calendar::incidencesFromSchedulingID ( const QString &  sid)

Searches all events and todos for an incidence with this scheduling identifiere.

Returns a list of matching results.

 @param sid is a unique scheduling identifier string.

Definition at line 685 of file calendar.cpp.

void Calendar::incidenceUpdated ( IncidenceBase *  incidenceBase)
protectedvirtual

The Observer interface.

So far not implemented.

 @param incidenceBase is a pointer an IncidenceBase object.

Implements KCal::IncidenceBase::IncidenceObserver.

Reimplemented in KCal::CalendarLocal, and KCal::CalendarNull.

Definition at line 1141 of file calendar.cpp.

bool Calendar::isAncestorOf ( Incidence *  ancestor,
Incidence *  incidence 
)

Checks if ancestor is an ancestor of incidence.

Parameters:
ancestorthe incidence we are testing to be an ancestor
incidencethe incidence we are testing to be descended from ancestor

Definition at line 1075 of file calendar.cpp.

bool Calendar::isModified ( ) const

Determine the calendar's modification status.

Returns:
true if the calendar has been modified since open or last save.
See also:
setModified()

Definition at line 1136 of file calendar.cpp.

bool Calendar::isSaving ( )
virtual

Determine if the calendar is currently being saved.

Returns:
true if the calendar is currently being saved; false otherwise.

Reimplemented in KCal::CalendarResources.

Definition at line 1120 of file calendar.cpp.

virtual Journal* KCal::Calendar::journal ( const QString &  uid)
pure virtual

Returns the Journal associated with the given unique identifier.

Parameters:
uidis a unique identifier string.
Returns:
a pointer to the Journal. A null pointer is returned if no such Journal exists.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

Journal::List Calendar::journals ( JournalSortField  sortField = JournalSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
virtual

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

Parameters:
sortFieldspecifies the JournalSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all filtered Journals sorted as specified.

Definition at line 924 of file calendar.cpp.

Journal::List Calendar::journals ( const QDate &  date)
virtual

Returns a filtered list of all Journals for on the specified date.

Parameters:
daterequest filtered Journals for this QDate only.
Returns:
the list of filtered Journals for the specified date.

Definition at line 932 of file calendar.cpp.

Incidence::List Calendar::mergeIncidenceList ( const Event::List &  events,
const Todo::List &  todos,
const Journal::List &  journals 
)
static

Create a merged list of Events, Todos, and Journals.

Parameters:
eventsis an Event list to merge.
todosis a Todo list to merge.
journalsis a Journal list to merge.
Returns:
a list of merged Incidences.

Definition at line 1207 of file calendar.cpp.

void Calendar::notifyIncidenceAdded ( Incidence *  incidence)
protected

Let Calendar subclasses notify that they inserted an Incidence.

Parameters:
incidenceis a pointer to the Incidence object that was inserted.

Definition at line 1159 of file calendar.cpp.

void Calendar::notifyIncidenceChanged ( Incidence *  incidence)
protected

Let Calendar subclasses notify that they modified an Incidence.

Parameters:
incidenceis a pointer to the Incidence object that was modified.

Definition at line 1170 of file calendar.cpp.

void Calendar::notifyIncidenceDeleted ( Incidence *  incidence)
protected

Let Calendar subclasses notify that they removed an Incidence.

Parameters:
incidenceis a pointer to the Incidence object that was removed.

Definition at line 1181 of file calendar.cpp.

Person Calendar::owner ( ) const

Returns the owner of the calendar.

Returns:
the owner Person object.
See also:
setOwner()

Definition at line 124 of file calendar.cpp.

QString Calendar::productId ( ) const

Returns the calendar's Product ID.

See also:
setProductId()

Definition at line 1202 of file calendar.cpp.

virtual Event::List KCal::Calendar::rawEvents ( EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
pure virtual

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

Parameters:
sortFieldspecifies the EventSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all unfiltered Events sorted as specified.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Event::List KCal::Calendar::rawEvents ( const QDate &  start,
const QDate &  end,
const KDateTime::Spec &  timeSpec = KDateTime::Spec(),
bool  inclusive = false 
)
pure virtual

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

Parameters:
startis the starting date
endis the ending date
timeSpectime zone etc. to interpret start and end, or the calendar's default time spec if none is specified
inclusiveif 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.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Event::List KCal::Calendar::rawEventsForDate ( const KDateTime &  dt)
pure virtual

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

Parameters:
dtrequest unfiltered Event list for this KDateTime only.
Returns:
the list of unfiltered Events occurring on the specified timestamp.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Event::List KCal::Calendar::rawEventsForDate ( const QDate &  date,
const KDateTime::Spec &  timeSpec = KDateTime::Spec(),
EventSortField  sortField = EventSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
pure virtual

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

The Events are sorted according to sortField and sortDirection.

Parameters:
daterequest unfiltered Event list for this QDate only
timeSpectime zone etc. to interpret date, or the calendar's default time spec if none is specified
sortFieldspecifies the EventSortField
sortDirectionspecifies the SortDirection
Returns:
the list of sorted, unfiltered Events occurring on date

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

Incidence::List Calendar::rawIncidences ( )
virtual

Returns an unfiltered list of all Incidences for this Calendar.

Returns:
the list of all unfiltered Incidences.

Definition at line 287 of file calendar.cpp.

virtual Journal::List KCal::Calendar::rawJournals ( JournalSortField  sortField = JournalSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
pure virtual

Returns a sorted, unfiltered list of all Journals for this Calendar.

Parameters:
sortFieldspecifies the JournalSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all unfiltered Journals sorted as specified.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Journal::List KCal::Calendar::rawJournalsForDate ( const QDate &  date)
pure virtual

Returns an unfiltered list of all Journals for on the specified date.

Parameters:
daterequest unfiltered Journals for this QDate only.
Returns:
the list of unfiltered Journals for the specified date.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Todo::List KCal::Calendar::rawTodos ( TodoSortField  sortField = TodoSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
pure virtual

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

Parameters:
sortFieldspecifies the TodoSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all unfiltered Todos sorted as specified.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

virtual Todo::List KCal::Calendar::rawTodosForDate ( const QDate &  date)
pure virtual

Returns an unfiltered list of all Todos which due on the specified date.

Parameters:
daterequest unfiltered Todos due on this QDate.
Returns:
the list of unfiltered Todos due on the specified date.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

void Calendar::registerObserver ( CalendarObserver *  observer)

Registers an Observer for this Calendar.

Parameters:
observeris a pointer to an Observer object that will be watching this Calendar.
See also:
unregisterObserver()

Definition at line 1107 of file calendar.cpp.

virtual bool KCal::Calendar::reload ( )
pure virtual

Loads the calendar contents from storage.

This requires that the calendar has been previously loaded (initialized).

Returns:
true if the reload was successful; otherwise false.

Implemented in KCal::CalendarResources, KCal::CalendarNull, and KCal::CalendarLocal.

void Calendar::removeRelations ( Incidence *  incidence)
virtual

Removes all Relations from an Incidence.

Parameters:
incidenceis a pointer to the Incidence to have a Relation removed.

Definition at line 997 of file calendar.cpp.

virtual bool KCal::Calendar::save ( )
pure virtual

Syncs changes in memory to persistent storage.

Returns:
true if the save was successful; false otherwise.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

void Calendar::setFilter ( CalFilter *  filter)

Sets the calendar filter.

Parameters:
filtera pointer to a CalFilter object which will be used to filter Calendar Incidences. The Calendar takes ownership of filter.
See also:
filter()

Definition at line 244 of file calendar.cpp.

void Calendar::setModified ( bool  modified)

Sets if the calendar has been modified.

Parameters:
modifiedis true if the calendar has been modified since open or last save.
See also:
isModified()

Definition at line 1125 of file calendar.cpp.

void Calendar::setObserversEnabled ( bool  enabled)
protected

Let Calendar subclasses notify that they enabled an Observer.

Parameters:
enabledif true tells the calendar that a subclass has enabled an Observer.

Definition at line 1241 of file calendar.cpp.

void Calendar::setOwner ( const Person &  owner)

Sets the owner of the calendar to owner.

Parameters:
owneris a Person object.
See also:
owner()

Definition at line 129 of file calendar.cpp.

void Calendar::setProductId ( const QString &  id)

Sets the calendar Product ID to id.

Parameters:
idis a string containing the Product ID.
See also:
productId() const

Definition at line 1197 of file calendar.cpp.

void Calendar::setTimeSpec ( const KDateTime::Spec &  timeSpec)

Sets the default time specification (time zone, etc.) used for creating or modifying incidences in the Calendar.

The method also calls setViewTimeSpec(timeSpec).

Parameters:
timeSpectime specification

Definition at line 136 of file calendar.cpp.

void Calendar::setTimeZoneId ( const QString &  timeZoneId)

Sets the time zone ID used for creating or modifying incidences in the Calendar.

This method has no effect on existing incidences.

 The method also calls setViewTimeZoneId(@p timeZoneId).

 @param timeZoneId is a string containing a time zone ID, which is
 assumed to be valid. The time zone ID is used to set the time zone
 for viewing Incidence date/times. If no time zone is found, the
 viewing time specification is set to local clock time.
 @e Example: "Europe/Berlin"
 @see setTimeSpec()

Definition at line 150 of file calendar.cpp.

void KCal::Calendar::setTimeZones ( const ICalTimeZones &  zones)

Set the time zone collection used by the calendar.

Parameters:
zonestime zones collection. Important: all time zones references in the calendar must be included in the collection.
void Calendar::setupRelations ( Incidence *  incidence)
virtual

Setup Relations for an Incidence.

Parameters:
incidenceis a pointer to the Incidence to have a Relation setup.

Definition at line 951 of file calendar.cpp.

void Calendar::setViewTimeSpec ( const KDateTime::Spec &  timeSpec) const

Notes the time specification which the client application intends to use for viewing the incidences in this calendar.

This is simply a convenience method which makes a note of the new time zone so that it can be read back by viewTimeSpec(). The client application must convert date/time values to the desired time zone itself.

The time specification is not used in any way by the Calendar or its incidences; it is solely for use by the client application.

Parameters:
timeSpectime specification
See also:
viewTimeSpec()

Definition at line 195 of file calendar.cpp.

void Calendar::setViewTimeZoneId ( const QString &  timeZoneId) const

Notes the time zone Id which the client application intends to use for viewing the incidences in this calendar.

This is simply a convenience method which makes a note of the new time zone so that it can be read back by viewTimeId(). The client application must convert date/time values to the desired time zone itself.

The Id is not used in any way by the Calendar or its incidences. It is solely for use by the client application.

Parameters:
timeZoneIdis a string containing a time zone ID, which is assumed to be valid. The time zone ID is used to set the time zone for viewing Incidence date/times. If no time zone is found, the viewing time specification is set to local clock time. Example: "Europe/Berlin"
See also:
viewTimeZoneId()

Definition at line 201 of file calendar.cpp.

void Calendar::shiftTimes ( const KDateTime::Spec &  oldSpec,
const KDateTime::Spec &  newSpec 
)

Shifts the times of all incidences so that they appear at the same clock time as before but in a new time zone.

The shift is done from a viewing time zone rather than from the actual incidence time zone.

For example, shifting an incidence whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec) of Europe/London, to a new time zone (newSpec) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the incidence start) to 14:00 Paris time.

Parameters:
oldSpecthe time specification which provides the clock times
newSpecthe new time specification
See also:
isLocalTime()

Definition at line 222 of file calendar.cpp.

Event::List Calendar::sortEvents ( Event::List *  eventList,
EventSortField  sortField,
SortDirection  sortDirection 
)
static

Sort a list of Events.

Parameters:
eventListis a pointer to a list of Events.
sortFieldspecifies the EventSortField.
sortDirectionspecifies the SortDirection.
Returns:
a list of Events sorted as specified.

Definition at line 292 of file calendar.cpp.

Event::List Calendar::sortEventsForDate ( Event::List *  eventList,
const QDate &  date,
const KDateTime::Spec &  timeSpec,
EventSortField  sortField,
SortDirection  sortDirection 
)
static

Sort a list of Events that occur on a specified date.

Parameters:
eventListis a pointer to a list of Events occurring on date.
dateis the date.
timeSpectime specification for date.
sortFieldspecifies the EventSortField.
sortDirectionspecifies the SortDirection.
Returns:
a list of Events sorted as specified.
Since:
4.5

Definition at line 395 of file calendar.cpp.

Journal::List Calendar::sortJournals ( Journal::List *  journalList,
JournalSortField  sortField,
SortDirection  sortDirection 
)
static

Sort a list of Journals.

Parameters:
journalListis a pointer to a list of Journals.
sortFieldspecifies the JournalSortField.
sortDirectionspecifies the SortDirection.
Returns:
a list of Journals sorted as specified.

Definition at line 871 of file calendar.cpp.

Todo::List Calendar::sortTodos ( Todo::List *  todoList,
TodoSortField  sortField,
SortDirection  sortDirection 
)
static

Sort a list of Todos.

Parameters:
todoListis a pointer to a list of Todos.
sortFieldspecifies the TodoSortField.
sortDirectionspecifies the SortDirection.
Returns:
a list of Todos sorted as specified.

Definition at line 712 of file calendar.cpp.

KDateTime::Spec Calendar::timeSpec ( ) const

Get the time specification (time zone etc.) used for creating or modifying incidences in the Calendar.

Returns:
time specification

Definition at line 145 of file calendar.cpp.

QString Calendar::timeZoneId ( ) const

Returns the time zone ID used for creating or modifying incidences in the calendar.

Returns:
the string containing the time zone ID, or empty string if the creation/modification time specification is not a time zone.

Definition at line 189 of file calendar.cpp.

ICalTimeZones * Calendar::timeZones ( ) const

Returns the time zone collection used by the calendar.

Returns:
the time zones collection.
See also:
setLocalTime()

Definition at line 217 of file calendar.cpp.

virtual Todo* KCal::Calendar::todo ( const QString &  uid)
pure virtual

Returns the Todo associated with the given unique identifier.

Parameters:
uidis a unique identifier string.
Returns:
a pointer to the Todo. A null pointer is returned if no such Todo exists.

Implemented in KCal::CalendarResources, KCal::CalendarLocal, and KCal::CalendarNull.

Todo::List Calendar::todos ( TodoSortField  sortField = TodoSortUnsorted,
SortDirection  sortDirection = SortDirectionAscending 
)
virtual

Returns a sorted, filtered list of all Todos for this Calendar.

Parameters:
sortFieldspecifies the TodoSortField.
sortDirectionspecifies the SortDirection.
Returns:
the list of all filtered Todos sorted as specified.

Definition at line 856 of file calendar.cpp.

Todo::List Calendar::todos ( const QDate &  date)
virtual

Returns a filtered list of all Todos which are due on the specified date.

Parameters:
daterequest filtered Todos due on this QDate.
Returns:
the list of filtered Todos due on the specified date.

Definition at line 864 of file calendar.cpp.

void Calendar::unregisterObserver ( CalendarObserver *  observer)

Unregisters an Observer for this Calendar.

Parameters:
observeris a pointer to an Observer object that has been watching this Calendar.
See also:
registerObserver()

Definition at line 1115 of file calendar.cpp.

KDateTime::Spec Calendar::viewTimeSpec ( ) const

Returns the time specification used for viewing the incidences in this calendar.

This simply returns the time specification last set by setViewTimeSpec().

See also:
setViewTimeSpec().

Definition at line 206 of file calendar.cpp.

QString Calendar::viewTimeZoneId ( ) const

Returns the time zone Id used for viewing the incidences in this calendar.

This simply returns the time specification last set by setViewTimeSpec().

See also:
setViewTimeZoneId().

Definition at line 211 of file calendar.cpp.


The documentation for this class was generated from the following files:
  • calendar.h
  • calendar.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 15:06:54 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal