KCal Library
#include <calendarresources.h>

Signals | |
void | signalErrorMessage (const QString &err) |
void | signalResourceAdded (ResourceCalendar *resource) |
void | signalResourceDeleted (ResourceCalendar *resource) |
void | signalResourceModified (ResourceCalendar *resource) |
![]() | |
void | batchAddingBegins () |
void | batchAddingEnds () |
void | calendarChanged () |
void | calendarLoaded () |
void | calendarSaved () |
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) |
![]() | |
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 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) |
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 |
- Parameters
-
event is a pointer to the Event to insert.
- Returns
- true if the Event was successfully inserted; false otherwise.
- See Also
- deleteEvent()
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 |
- Parameters
-
journal is a pointer to the Journal to insert.
- Returns
- true if the Journal was successfully inserted; false otherwise.
- See Also
- deleteJournal()
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 |
- Parameters
-
todo is a pointer to the Todo to insert.
- Returns
- true if the Todo was successfully inserted; false otherwise.
- See Also
- deleteTodo()
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 |
- Parameters
-
from is the starting timestamp. to is the ending timestamp.
- Returns
- the list of Alarms for the for the specified time range.
Implements KCal::Calendar.
Definition at line 608 of file calendarresources.cpp.
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 |
- Parameters
-
incidence is a pointer to the Incidence that will be changing.
Reimplemented from KCal::Calendar.
Definition at line 874 of file calendarresources.cpp.
void CalendarResources::clearException | ( | ) |
|
virtual |
Implements KCal::Calendar.
Definition at line 357 of file calendarresources.cpp.
|
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 |
- See Also
- deleteEvent()
Implements KCal::Calendar.
Definition at line 497 of file calendarresources.cpp.
|
virtual |
- See Also
- deleteJournal()
Implements KCal::Calendar.
Definition at line 706 of file calendarresources.cpp.
|
virtual |
- See Also
- deleteTodo()
Implements KCal::Calendar.
Definition at line 550 of file calendarresources.cpp.
|
virtual |
- Parameters
-
event is a pointer to the Event to remove.
- Returns
- true if the Event was successfully remove; false otherwise.
- See Also
- addEvent(), deleteAllEvents()
Implements KCal::Calendar.
Definition at line 474 of file calendarresources.cpp.
|
virtual |
- Parameters
-
journal is a pointer to the Journal to remove.
- Returns
- true if the Journal was successfully removed; false otherwise.
- See Also
- addJournal(), deleteAllJournals()
Implements KCal::Calendar.
Definition at line 686 of file calendarresources.cpp.
|
virtual |
- Parameters
-
todo is a pointer to the Todo to remove.
- Returns
- true if the Todo was successfully removed; false otherwise.
- See Also
- addTodo(), deleteAllTodos()
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 |
- Parameters
-
timeSpec is the time specification (time zone, etc.) for viewing Incidence dates.
Reimplemented from KCal::Calendar.
Definition at line 815 of file calendarresources.cpp.
|
protectedslot |
|
virtual |
- Parameters
-
incidence is a pointer to the Incidence that was changed.
Reimplemented from KCal::Calendar.
Definition at line 902 of file calendarresources.cpp.
|
virtual |
- Parameters
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 505 of file calendarresources.cpp.
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 |
- Returns
- true if the calendar is currently being saved; false otherwise.
Reimplemented from KCal::Calendar.
Definition at line 385 of file calendarresources.cpp.
|
virtual |
- Parameters
-
uid is a unique identifier string.
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 |
- Parameters
-
sortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns
- the list of all unfiltered Events sorted as specified.
Implements KCal::Calendar.
Definition at line 664 of file calendarresources.cpp.
|
virtual |
- Parameters
-
start is the starting date end is the ending date timeSpec time zone etc. to interpret start
andend
, or the calendar's default time spec if none is specifiedinclusive if 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.
Implements KCal::Calendar.
Definition at line 640 of file calendarresources.cpp.
|
virtual |
- Parameters
-
dt request unfiltered Event list for this KDateTime only.
- Returns
- the list of unfiltered Events occurring on the specified timestamp.
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 |
- Parameters
-
sortField specifies the JournalSortField. sortDirection specifies the SortDirection.
- Returns
- the list of all unfiltered Journals sorted as specified.
Implements KCal::Calendar.
Definition at line 729 of file calendarresources.cpp.
|
virtual |
- Parameters
-
date request unfiltered Journals for this QDate only.
- Returns
- the list of unfiltered Journals for the specified date.
Implements KCal::Calendar.
Definition at line 741 of file calendarresources.cpp.
|
virtual |
- Parameters
-
sortField specifies the TodoSortField. sortDirection specifies the SortDirection.
- Returns
- the list of all unfiltered Todos sorted as specified.
Implements KCal::Calendar.
Definition at line 558 of file calendarresources.cpp.
|
virtual |
- Parameters
-
date request unfiltered Todos due on this QDate.
- Returns
- the list of unfiltered Todos due on the specified date.
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 |
- Returns
- true if the save was successful; false otherwise.
Implements KCal::Calendar.
Definition at line 370 of file calendarresources.cpp.
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 |
- Parameters
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 571 of file calendarresources.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:29:19 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.