KCal Library
#include <calendarresources.h>
Signals | |
void | signalErrorMessage (const QString &err) |
void | signalResourceAdded (ResourceCalendar *resource) |
void | signalResourceDeleted (ResourceCalendar *resource) |
void | signalResourceModified (ResourceCalendar *resource) |
Signals inherited from KCal::Calendar | |
void | batchAddingBegins () |
void | batchAddingEnds () |
void | calendarChanged () |
void | calendarLoaded () |
void | calendarSaved () |
Public Member Functions | |
CalendarResources (const KDateTime::Spec &timeSpec, const QString &family=QLatin1String("calendar")) | |
CalendarResources (const QString &timeZoneId, const QString &family=QLatin1String("calendar")) | |
~CalendarResources () | |
bool | addEvent (Event *event) |
bool | addEvent (Event *event, ResourceCalendar *resource) |
bool | addIncidence (Incidence *incidence) |
bool | addIncidence (Incidence *incidence, ResourceCalendar *resource) |
bool | addJournal (Journal *journal) |
bool | addJournal (Journal *journal, ResourceCalendar *resource) |
bool | addTodo (Todo *todo) |
bool | addTodo (Todo *todo, ResourceCalendar *resource) |
Alarm::List | alarms (const KDateTime &from, const KDateTime &to) |
Alarm::List | alarmsTo (const KDateTime &to) |
bool | beginChange (Incidence *incidence) |
void | clearException () |
void | close () |
void | deleteAllEvents () |
void | deleteAllJournals () |
void | deleteAllTodos () |
bool | deleteEvent (Event *event) |
bool | deleteJournal (Journal *journal) |
bool | deleteTodo (Todo *todo) |
QWidget * | dialogParentWidget () |
bool | endChange (Incidence *incidence) |
Event * | event (const QString &uid) |
ErrorFormat * | exception () |
bool | hasCalendarResources () |
bool | isSaving () |
Journal * | journal (const QString &uid) |
void | load () |
Event::List | rawEvents (EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
Event::List | rawEvents (const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false) |
Event::List | rawEventsForDate (const KDateTime &dt) |
Event::List | rawEventsForDate (const QDate &date, const KDateTime::Spec &timeSpec=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) |
void | readConfig (KConfig *config=0) |
virtual void | releaseSaveTicket (Ticket *ticket) |
bool | reload () |
Ticket * | requestSaveTicket (ResourceCalendar *resource) |
ResourceCalendar * | resource (Incidence *incidence) |
void | resourceAdded (ResourceCalendar *resource) |
CalendarResourceManager * | resourceManager () const |
virtual bool | save (Ticket *ticket, Incidence *incidence=0) |
bool | save () |
void | setAskDestinationPolicy () |
void | setDialogParentWidget (QWidget *parent) |
void | setStandardDestinationPolicy () |
Todo * | todo (const QString &uid) |
Public Member Functions inherited from KCal::Calendar | |
Calendar (const KDateTime::Spec &timeSpec) | |
Calendar (const QString &timeZoneId) | |
virtual | ~Calendar () |
void | beginBatchAdding () |
QStringList | categories () |
virtual bool | deleteIncidence (Incidence *incidence) |
Incidence * | dissociateOccurrence (Incidence *incidence, const QDate &date, const KDateTime::Spec &spec, bool single=true) |
void | endBatchAdding () |
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 Journal::List | journals (JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) |
virtual Journal::List | journals (const QDate &date) |
Person | owner () const |
QString | productId () const |
virtual Incidence::List | rawIncidences () |
void | registerObserver (CalendarObserver *observer) |
virtual void | removeRelations (Incidence *incidence) |
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::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 () |
Protected Slots | |
void | beginAddingIncidences () |
void | endAddingIncidences () |
void | slotLoadError (ResourceCalendar *resource, const QString &err) |
void | slotSaveError (ResourceCalendar *resource, const QString &err) |
Protected Member Functions | |
void | connectResource (ResourceCalendar *resource) |
int | decrementChangeCount (ResourceCalendar *resource) |
virtual void | doSetTimeSpec (const KDateTime::Spec &timeSpec) |
int | incrementChangeCount (ResourceCalendar *resource) |
void | resourceDeleted (ResourceCalendar *resource) |
void | resourceModified (ResourceCalendar *resource) |
Protected Member Functions inherited from KCal::Calendar | |
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 () |
void | incidenceUpdated (IncidenceBase *incidenceBase) |
void | notifyIncidenceAdded (Incidence *incidence) |
void | notifyIncidenceChanged (Incidence *incidence) |
void | notifyIncidenceDeleted (Incidence *incidence) |
void | setObserversEnabled (bool enabled) |
Additional Inherited Members | |
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 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) |
Detailed Description
This class provides a Calendar which is composed of other Calendars known as "Resources".
Examples of Calendar Resources are:
- Calendars stored as local ICS formatted files
- a set of incidences (one-per-file) within a local directory
- birthdays and anniversaries contained in an addressbook
Definition at line 57 of file calendarresources.h.
Constructor & Destructor Documentation
CalendarResources::CalendarResources | ( | const KDateTime::Spec & | timeSpec, |
const QString & | family = QLatin1String( "calendar" ) |
||
) |
Construct CalendarResource object using a time specification (time zone, etc.) and a Family name.
- Parameters
-
timeSpec is a time specification which is used for creating or modifying incidences in the Calendar. It is also used for viewing incidences (see setViewTimeSpec()). family is any QString representing a unique name.
Definition at line 234 of file calendarresources.cpp.
CalendarResources::CalendarResources | ( | const QString & | timeZoneId, |
const QString & | family = QLatin1String( "calendar" ) |
||
) |
Construct CalendarResource object using a time zone ID and a Family name.
- Parameters
-
timeZoneId is used for creating or modifying incidences in the Calendar. It is also used for viewing incidences. The time zone does not alter existing incidences. family is any QString representing a unique name.
Definition at line 246 of file calendarresources.cpp.
CalendarResources::~CalendarResources | ( | ) |
Destroys the Calendar Resources.
Definition at line 257 of file calendarresources.cpp.
Member Function Documentation
|
virtual |
Implements KCal::Calendar.
Definition at line 464 of file calendarresources.cpp.
bool CalendarResources::addEvent | ( | Event * | event, |
ResourceCalendar * | resource | ||
) |
Inserts an Event into a Calendar Resource.
- Parameters
-
event is a pointer to the Event to insert. resource is a pointer to the ResourceCalendar to be added to.
- Returns
- true if the Event was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence, ResourceCalendar *resource ) instead.
Definition at line 469 of file calendarresources.cpp.
|
virtual |
Inserts an Incidence into the calendar.
- Parameters
-
incidence is a pointer to the Incidence to insert.
- Returns
- true if the Incidence was successfully inserted; false otherwise.
- Will also return false if there are multiple writable resources and the user declines to select one to those resources in which to save the Incidence.
Reimplemented from KCal::Calendar.
Definition at line 432 of file calendarresources.cpp.
bool CalendarResources::addIncidence | ( | Incidence * | incidence, |
ResourceCalendar * | resource | ||
) |
Inserts an Incidence into a Calendar Resource.
- Parameters
-
incidence is a pointer to the Incidence to insert. resource is a pointer to the ResourceCalendar to be added to.
- Returns
- true if the Incidence was successfully inserted; false otherwise.
Definition at line 396 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 676 of file calendarresources.cpp.
bool CalendarResources::addJournal | ( | Journal * | journal, |
ResourceCalendar * | resource | ||
) |
Inserts a Journal into a Calendar Resource.
- Parameters
-
journal is a pointer to the Journal to insert. resource is a pointer to the ResourceCalendar to be added to.
- Returns
- true if the Journal was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence, ResourceCalendar *resource ) instead.
Definition at line 681 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 520 of file calendarresources.cpp.
bool CalendarResources::addTodo | ( | Todo * | todo, |
ResourceCalendar * | resource | ||
) |
Inserts a Todo into a Calendar Resource.
- Parameters
-
todo is a pointer to the Todo to insert. resource is a pointer to the ResourceCalendar to be added to.
- Returns
- true if the Todo was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence, ResourceCalendar *resource ) instead.
Definition at line 525 of file calendarresources.cpp.
|
virtual |
Alarm::List CalendarResources::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 598 of file calendarresources.cpp.
|
protectedslot |
All addIncidence( Incidence * ), addTodo( Todo * ) addEvent( Event * ) and addJournal( Journal * ) calls made between beginAddingIncidences() and endAddingIncidences() will only ask the user to choose a resource once.
- Since
- 4.4
Definition at line 928 of file calendarresources.cpp.
|
virtual |
Reimplemented from KCal::Calendar.
Definition at line 874 of file calendarresources.cpp.
void CalendarResources::clearException | ( | ) |
|
virtual |
|
protected |
Connects all necessary signals and slots to the resource.
- Parameters
-
resource is a pointer to a ResourceCalendar.
Definition at line 769 of file calendarresources.cpp.
|
protected |
Decrement the number of times this Resource has been changed by 1.
- Parameters
-
resource is a pointer to the ResourceCalendar to be counted.
- Returns
- the new number of times this Resource has been changed.
- See also
- incrementChangeCount()
Definition at line 952 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 497 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 706 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 550 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 474 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 686 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 530 of file calendarresources.cpp.
QWidget * CalendarResources::dialogParentWidget | ( | ) |
Returns the current parent for new dialogs.
This is a bad hack, but we need to properly set the parent for the resource selection dialog. Otherwise the dialog will not be modal to the editor dialog in korganizer and the user can still work in the editor dialog (and thus crash korganizer). Afterwards we need to reset it (to avoid pointers to widgets that are already deleted) so we also need the accessor
- Returns
- a pointer to the parent QWidget.
- See also
- setDialogParentWidget()
Definition at line 347 of file calendarresources.cpp.
|
protectedvirtual |
Reimplemented from KCal::Calendar.
Definition at line 815 of file calendarresources.cpp.
|
protectedslot |
|
virtual |
Reimplemented from KCal::Calendar.
Definition at line 902 of file calendarresources.cpp.
|
virtual |
ErrorFormat * CalendarResources::exception | ( | ) |
Returns an exception, if there is any, containing information about the last error that occurred.
- Since
- 4.2
Definition at line 270 of file calendarresources.cpp.
bool CalendarResources::hasCalendarResources | ( | ) |
Return true if we have resources configure.
Otherwise returns false.
- Since
- 4.3
Definition at line 619 of file calendarresources.cpp.
|
protected |
Increment the number of times this Resource has been changed by 1.
- Parameters
-
resource is a pointer to the ResourceCalendar to be counted.
- Returns
- the new number of times this Resource has been changed.
- See also
- decrementChangeCount()
Definition at line 939 of file calendarresources.cpp.
|
virtual |
Reimplemented from KCal::Calendar.
Definition at line 385 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 714 of file calendarresources.cpp.
void CalendarResources::load | ( | ) |
Loads all Incidences from the Resources.
The Resources must be added first using either readConfig(KConfig *config), which adds the system Resources, or manually using resourceAdded(ResourceCalendar *resource).
Definition at line 285 of file calendarresources.cpp.
|
virtual |
Calendar::rawEvents(EventSortField, SortDirection)
Implements KCal::Calendar.
Definition at line 664 of file calendarresources.cpp.
|
virtual |
Calendar::rawEvents(const QDate &, const QDate &, const KDateTime::Spec &, bool)
Implements KCal::Calendar.
Definition at line 640 of file calendarresources.cpp.
|
virtual |
Calendar::rawEventsForDate( const KDateTime &)
Implements KCal::Calendar.
Definition at line 652 of file calendarresources.cpp.
|
virtual |
Returns an unfiltered list of all Events which occur on the given date.
- Parameters
-
date request unfiltered Event list for this QDate only. timeSpec time zone etc. to interpret date
, or the calendar's default time spec if none is specifiedsortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns
- the list of unfiltered Events occurring on the specified QDate.
Implements KCal::Calendar.
Definition at line 626 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 729 of file calendarresources.cpp.
|
virtual |
Calendar::rawJournalsForDate()
Implements KCal::Calendar.
Definition at line 741 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 558 of file calendarresources.cpp.
|
virtual |
Implements KCal::Calendar.
Definition at line 586 of file calendarresources.cpp.
void CalendarResources::readConfig | ( | KConfig * | config = 0 | ) |
Reads the Resources settings from a config file.
- Parameters
-
config The KConfig object which points to the config file. If no object is given ( config
is 0) the standard config file is used.
- Note
- Call this method before load().
Definition at line 275 of file calendarresources.cpp.
|
virtual |
Releases the save Ticket.
The Calendar is unlocked without saving.
- Parameters
-
ticket is a pointer to a Ticket object.
- See also
- requestSaveTicket()
Definition at line 868 of file calendarresources.cpp.
|
virtual |
Reloads all Incidences from all Resources.
- Returns
- true if the reload was successful; otherwise failure.
Implements KCal::Calendar.
Definition at line 324 of file calendarresources.cpp.
CalendarResources::Ticket * CalendarResources::requestSaveTicket | ( | ResourceCalendar * | resource | ) |
Requests a ticket for saving the Calendar.
If a ticket is returned the Calendar is locked for write access until save() or releaseSaveTicket() is called.
- Parameters
-
resource is a pointer to the ResourceCalendar object.
- Returns
- a pointer to a Ticket object indicating that the Calendar is locked for write access; otherwise a null pointer.
- See also
- releaseSaveTicket()
Definition at line 835 of file calendarresources.cpp.
ResourceCalendar * CalendarResources::resource | ( | Incidence * | incidence | ) |
Returns the Resource associated with a specified Incidence.
- Parameters
-
incidence is a pointer to an Incidence whose Resource is to be located.
Definition at line 782 of file calendarresources.cpp.
void CalendarResources::resourceAdded | ( | ResourceCalendar * | resource | ) |
Add an active Resource to the Calendar, and loads that resource if it is open.
Additionally, emits the signalResourceAdded signal.
- Note
- This method must be public, because in-process added Resources do not emit the corresponding signal, so this method has to be called manually!
- Parameters
-
resource is a pointer to the ResourceCalendar to add.
- See also
- signalResourceAdded()
Definition at line 790 of file calendarresources.cpp.
|
protected |
Emits the signalResourceDeleted signal for the specified resource
.
- Parameters
-
resource is a pointer to a ResourceCalendar that was removed.
- See also
- signalResourceModified()
Definition at line 810 of file calendarresources.cpp.
CalendarResourceManager * CalendarResources::resourceManager | ( | ) | const |
Returns the CalendarResourceManager used by this calendar.
Definition at line 332 of file calendarresources.cpp.
|
protected |
Emits the signalResourceModified signal for the specified resource
.
- Parameters
-
resource is a pointer to a ResourceCalendar that was changed.
- See also
- signalResourceDeleted()
Definition at line 805 of file calendarresources.cpp.
|
virtual |
Saves this Calendar.
If the save is successful the Ticket is deleted. Otherwise, the caller must release the Ticket with releaseSaveTicket() to abandon the save operation or call save() to try the save again.
- Parameters
-
ticket is a pointer to the Ticket object. incidence is a pointer to the Incidence object. If incidence is null, save the entire Calendar (all Resources) else only the specified Incidence is saved.
- Returns
- true if the save was successful; false otherwise.
Definition at line 853 of file calendarresources.cpp.
|
virtual |
void CalendarResources::setAskDestinationPolicy | ( | ) |
Set the destination policy such that Incidences are added to a Resource which is queried.
Definition at line 342 of file calendarresources.cpp.
void CalendarResources::setDialogParentWidget | ( | QWidget * | parent | ) |
Set the widget parent for new dialogs.
This is a bad hack, but we need to properly set the parent for the resource selection dialog. Otherwise the dialog will not be modal to the editor dialog in korganizer and the user can still work in the editor dialog (and thus crash korganizer).
- Parameters
-
parent is a pointer to the parent QWidget.
- See also
- dialogparentWidget()
Definition at line 352 of file calendarresources.cpp.
void CalendarResources::setStandardDestinationPolicy | ( | ) |
Set the destination policy such that Incidences are always added to the standard Resource.
Definition at line 337 of file calendarresources.cpp.
|
signal |
Signals an error message.
- Parameters
-
err is the error message.
|
signal |
Signals that an Incidence has been inserted to the Resource.
- Parameters
-
resource is a pointer to a ResourceCalendar that was added.
- See also
- resourceAdded()
|
signal |
Signals that an Incidence has been removed from the Resource.
- Parameters
-
resource is a pointer to a ResourceCalendar that was removed.
- See also
- resourceDeleted()
|
signal |
Signals that the Resource has been modified.
- Parameters
-
resource is a pointer to a ResourceCalendar that was changed.
- See also
- resourceModified()
|
protectedslot |
Emits the signalErrorMessage signal with an error message when an error occurs loading a ResourceCalendar.
- Parameters
-
resource is a pointer to the ResourceCalendar that failed to load. err is the error message.
- See also
- slotSaveError()
Definition at line 970 of file calendarresources.cpp.
|
protectedslot |
Emits the signalErrorMessage signal with an error message when an error occurs saving a ResourceCalendar.
- Parameters
-
resource is a pointer to the ResourceCalendar that failed to save. err is the error message.
- See also
- slotLoadError()
Definition at line 976 of file calendarresources.cpp.
|
virtual |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.