#include <calendarresources.h>
Signals | |
void | signalResourceModified (ResourceCalendar *resource) |
void | signalResourceAdded (ResourceCalendar *resource) |
void | signalResourceDeleted (ResourceCalendar *resource) |
void | signalErrorMessage (const TQString &err) |
Signals inherited from KCal::Calendar | |
void | calendarChanged () |
void | calendarSaved () |
void | calendarLoaded () |
void | batchAddingBegins () |
void | batchAddingEnds () |
Protected Slots | |
void | slotLoadError (ResourceCalendar *resource, const TQString &err) |
void | slotSaveError (ResourceCalendar *resource, const TQString &err) |
void | beginAddingIncidences () |
void | endAddingIncidences () |
Protected Member Functions | |
void | connectResource (ResourceCalendar *resource) |
void | resourceModified (ResourceCalendar *resource) |
void | resourceDeleted (ResourceCalendar *resource) |
virtual void | doSetTimeZoneId (const TQString &timeZoneId) |
int | incrementChangeCount (ResourceCalendar *resource) |
int | decrementChangeCount (ResourceCalendar *resource) |
Protected Member Functions inherited from KCal::Calendar | |
void | setException (ErrorFormat *e) |
void | incidenceUpdated (IncidenceBase *incidenceBase) |
void | notifyIncidenceAdded (Incidence *incidence) |
void | notifyIncidenceChanged (Incidence *incidence) |
void | notifyIncidenceDeleted (Incidence *incidence) |
virtual void | customPropertyUpdated () |
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 TQDate &date, EventSortField sortField, SortDirection sortDirection) |
static Todo::List | sortTodos (Todo::List *todoList, TodoSortField sortField, SortDirection sortDirection) |
static Journal::List | sortJournals (Journal::List *journalList, JournalSortField sortField, SortDirection sortDirection) |
Detailed Description
This class provides a Calendar 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 64 of file calendarresources.h.
Constructor & Destructor Documentation
◆ CalendarResources()
CalendarResources::CalendarResources | ( | const TQString & | timeZoneId, |
const TQString & | family = TQString::fromLatin1( "calendar" ) |
||
) |
Construct CalendarResource object using a Time Zone and a Family name.
- Parameters
-
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 dates.
On some systems, /usr/share/zoneinfo/zone.tab may be available for reference.
Example: "Europe/Berlin"
- Warning
- Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar.
- Parameters
-
family is any TQString representing a unique name.
Definition at line 115 of file calendarresources.cpp.
◆ ~CalendarResources()
CalendarResources::~CalendarResources | ( | ) |
Destructor.
Definition at line 138 of file calendarresources.cpp.
Member Function Documentation
◆ addEvent() [1/3]
|
virtual |
Insert an Event into the Calendar.
- Parameters
-
event is a pointer to the Event to insert.
- Returns
- true if the Event was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence ) instead.
Implements KCal::Calendar.
Definition at line 411 of file calendarresources.cpp.
◆ addEvent() [2/3]
bool CalendarResources::addEvent | ( | Event * | event, |
ResourceCalendar * | resource | ||
) |
Insert 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.
Definition at line 417 of file calendarresources.cpp.
◆ addEvent() [3/3]
bool CalendarResources::addEvent | ( | Event * | event, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Insert 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. subresource is the subresource name, which may not be used by some calendar resources.
- Returns
- true if the Event was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence(Incidence *,ResourceCalendar *,const TQString &) instead.
Definition at line 422 of file calendarresources.cpp.
◆ addIncidence() [1/3]
|
virtual |
Insert 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.
Reimplemented from KCal::Calendar.
Definition at line 356 of file calendarresources.cpp.
◆ addIncidence() [2/3]
bool CalendarResources::addIncidence | ( | Incidence * | incidence, |
ResourceCalendar * | resource | ||
) |
Insert 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 350 of file calendarresources.cpp.
◆ addIncidence() [3/3]
bool CalendarResources::addIncidence | ( | Incidence * | incidence, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Insert 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. subresource is the subresource name, which may not be used by some calendar resources.
- Returns
- true if the Incidence was successfully inserted; false otherwise.
Definition at line 312 of file calendarresources.cpp.
◆ addJournal() [1/3]
|
virtual |
Insert a Journal into the Calendar.
- Parameters
-
journal is a pointer to the Journal to insert.
- Returns
- true if the Journal was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence ) instead.
Implements KCal::Calendar.
Definition at line 665 of file calendarresources.cpp.
◆ addJournal() [2/3]
bool CalendarResources::addJournal | ( | Journal * | journal, |
ResourceCalendar * | resource | ||
) |
Insert 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.
Definition at line 671 of file calendarresources.cpp.
◆ addJournal() [3/3]
bool CalendarResources::addJournal | ( | Journal * | journal, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Insert 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. subresource is the subresource name, which may not be used by some calendar resources.
- Returns
- true if the Journal was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence(Incidence *,ResourceCalendar *,const TQString &) instead.
Definition at line 677 of file calendarresources.cpp.
◆ addTodo() [1/3]
|
virtual |
Insert a Todo into a Calendar Resource.
- Parameters
-
todo is a pointer to the Todo to insert.
- Returns
- true if the Todo was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence( Incidence *incidence ) instead.
Implements KCal::Calendar.
Definition at line 468 of file calendarresources.cpp.
◆ addTodo() [2/3]
bool CalendarResources::addTodo | ( | Todo * | todo, |
ResourceCalendar * | resource | ||
) |
Insert an 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.
Definition at line 474 of file calendarresources.cpp.
◆ addTodo() [3/3]
bool CalendarResources::addTodo | ( | Todo * | todo, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Insert an 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. subresource is the subresource name, which may not be used by some calendar resources.
- Returns
- true if the Todo was successfully inserted; false otherwise.
- Note
- In most cases use addIncidence(Incidence *, ResourceCalendar *,const TQString &) instead.
Definition at line 479 of file calendarresources.cpp.
◆ alarms()
|
virtual |
Return a list of Alarms within a time range for this Calendar.
- 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 572 of file calendarresources.cpp.
◆ alarmsTo()
Alarm::List CalendarResources::alarmsTo | ( | const TQDateTime & | 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 TQDateTime.
Definition at line 557 of file calendarresources.cpp.
◆ beginAddingIncidences
|
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 943 of file calendarresources.cpp.
◆ beginChange() [1/2]
|
virtual |
Flag that a change to a Calendar Incidence is starting.
- Parameters
-
incidence is a pointer to the Incidence that will be changing.
- Returns
- false if the resource could not be computed or if a ticket request fails; true otherwise.
Reimplemented from KCal::Calendar.
Definition at line 863 of file calendarresources.cpp.
◆ beginChange() [2/2]
bool CalendarResources::beginChange | ( | Incidence * | incidence, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Flag that a change to a Calendar Incidence is starting.
- Parameters
-
incidence is a pointer to the Incidence that will be changing. resource is a pointer to the ResourceCalendar that incidence
belongs to; if this is 0 then the resource is queried via the DestinationPolicy.subresource is the Incidence
subresource name, which may not be used by some calendar resources.
- Returns
- false if the resource could not be computed or if a ticket request fails; true otherwise.
Definition at line 868 of file calendarresources.cpp.
◆ close()
|
virtual |
Clear out the current Calendar, freeing all used memory etc.
Implements KCal::Calendar.
Definition at line 226 of file calendarresources.cpp.
◆ closeEvents()
|
virtual |
Clear out the current Calendar, freeing all used memory etc.
Implements KCal::Calendar.
Definition at line 241 of file calendarresources.cpp.
◆ closeJournals()
|
virtual |
Clear out the current Calendar, freeing all used memory etc.
Implements KCal::Calendar.
Definition at line 271 of file calendarresources.cpp.
◆ closeTodos()
|
virtual |
Clear out the current Calendar, freeing all used memory etc.
Implements KCal::Calendar.
Definition at line 256 of file calendarresources.cpp.
◆ decrementChangeCount()
|
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.
Definition at line 974 of file calendarresources.cpp.
◆ deleteEvent()
|
virtual |
Remove an Event from the Calendar.
- Parameters
-
event is a pointer to the Event to remove.
- Returns
- true if the Event was successfully removed; false otherwise.
- Note
- In most cases use deleteIncidence( Incidence *incidence) instead.
Implements KCal::Calendar.
Definition at line 428 of file calendarresources.cpp.
◆ deleteJournal()
|
virtual |
Remove a Journal from the Calendar.
- Parameters
-
journal is a pointer to the Journal to remove.
- Returns
- true if the Journal was successfully removed; false otherwise.
- Note
- In most cases use deleteIncidence( Incidence *incidence ) instead.
Implements KCal::Calendar.
Definition at line 684 of file calendarresources.cpp.
◆ deleteTodo()
|
virtual |
Remove an Todo from the Calendar.
- Parameters
-
todo is a pointer to the Todo to remove.
- Returns
- true if the Todo was successfully removed; false otherwise.
- Note
- In most cases use deleteIncidence( Incidence *incidence ) instead.
Implements KCal::Calendar.
Definition at line 485 of file calendarresources.cpp.
◆ dialogParentWidget()
TQWidget * 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
Definition at line 216 of file calendarresources.cpp.
◆ doSetTimeZoneId()
|
protectedvirtual |
Let CalendarResource subclasses set the Time Zone ID.
First parameter is a string containing a Time Zone ID, which is assumed to be valid. On some systems, /usr/share/zoneinfo/zone.tab may be available for reference.
Example: "Europe/Berlin"
- Warning
- Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar.
Reimplemented from KCal::Calendar.
Definition at line 810 of file calendarresources.cpp.
◆ endAddingIncidences
|
protectedslot |
◆ endChange() [1/2]
|
virtual |
Flag that a change to a Calendar Incidence has completed.
- Parameters
-
incidence is a pointer to the Incidence that was changed.
- Returns
- false if the resource could not be computed or if a ticket save fails; true otherwise.
Reimplemented from KCal::Calendar.
Definition at line 905 of file calendarresources.cpp.
◆ endChange() [2/2]
bool CalendarResources::endChange | ( | Incidence * | incidence, |
ResourceCalendar * | resource, | ||
const TQString & | subresource | ||
) |
Flag that a change to a Calendar Incidence has completed.
- Parameters
-
incidence is a pointer to the Incidence that was changed. resource is a pointer to the ResourceCalendar that incidence
belongs to; if this is 0 then the resource is queried via the DestinationPolicy.subresource is the Incidence
subresource name, which may not be used by some calendar resources.
- Returns
- false if the resource could not be computed or if a ticket save fails; true otherwise.
Definition at line 910 of file calendarresources.cpp.
◆ event()
|
virtual |
Returns the Event associated with the given unique identifier.
- Parameters
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 453 of file calendarresources.cpp.
◆ incrementChangeCount()
|
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.
Definition at line 961 of file calendarresources.cpp.
◆ isSaving()
|
virtual |
Determine if the Calendar is currently being saved.
- Returns
- true if the Calendar is currently being saved; false otherwise.
Reimplemented from KCal::Calendar.
Definition at line 300 of file calendarresources.cpp.
◆ journal()
|
virtual |
Returns the Journal associated with the given unique identifier.
- Parameters
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 705 of file calendarresources.cpp.
◆ load()
void CalendarResources::load | ( | ) |
Loads all Incidences from the Resources.
The Resources must be added first using either readConfig(TDEConfig *config), which adds the system Resources, or manually using resourceAdded(ResourceCalendar *resource).
Definition at line 156 of file calendarresources.cpp.
◆ rawEvents() [1/2]
|
virtual |
Return an unfiltered list of all Events occurring within a date range.
- Parameters
-
start is the starting date. end is the ending date. inclusive 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 610 of file calendarresources.cpp.
◆ rawEvents() [2/2]
|
virtual |
Return a sorted, unfiltered list of all Events.
- 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 646 of file calendarresources.cpp.
◆ rawEventsForDate() [1/2]
|
virtual |
Return a sorted, unfiltered list of all Events which occur on the given date.
The Events are sorted according to sortField and sortDirection.
- Parameters
-
date request unfiltered Event list for this TQDate only. sortField specifies the EventSortField. sortDirection specifies the SortDirection.
- Returns
- the list of sorted, unfiltered Events occurring on date.
Implements KCal::Calendar.
Definition at line 593 of file calendarresources.cpp.
◆ rawEventsForDate() [2/2]
|
virtual |
Return an unfiltered list of all Events which occur on the given timestamp.
- Parameters
-
qdt request unfiltered Event list for this TQDateTime only.
- Returns
- the list of unfiltered Events occurring on the specified timestamp.
Implements KCal::Calendar.
Definition at line 628 of file calendarresources.cpp.
◆ rawJournals()
|
virtual |
Return a sorted, unfiltered list of all Journals for this Calendar.
- 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 722 of file calendarresources.cpp.
◆ rawJournalsForDate()
|
virtual |
Return an unfiltered list of all Journals for on the specifed date.
- Parameters
-
date request unfiltered Journals for this TQDate only.
- Returns
- the list of unfiltered Journals for the specified date.
Implements KCal::Calendar.
Definition at line 740 of file calendarresources.cpp.
◆ rawTodos()
|
virtual |
Return a sorted, unfiltered list of all Todos for this Calendar.
- 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 506 of file calendarresources.cpp.
◆ rawTodosForDate()
|
virtual |
Return an unfiltered list of all Todos which are due on the specified date.
- Parameters
-
date request unfiltered Todos due on this TQDate.
- Returns
- the list of unfiltered Todos due on the specified date.
Implements KCal::Calendar.
Definition at line 540 of file calendarresources.cpp.
◆ readConfig()
void CalendarResources::readConfig | ( | TDEConfig * | config = 0 | ) |
Read the Resources settings from a config file.
- Parameters
-
config The TDEConfig object which points to the config file. If no object is given (null pointer) the standard config file is used.
- Note
- Call this method before load().
Definition at line 146 of file calendarresources.cpp.
◆ releaseSaveTicket()
|
virtual |
Release the save Ticket.
The Calendar is unlocked without saving.
- Parameters
-
ticket is a pointer to a Ticket object.
Definition at line 857 of file calendarresources.cpp.
◆ reload()
|
virtual |
Reloads all incidences from all resources.
- Parameters
-
tz The timezone to set.
- Returns
- success or failure
Implements KCal::Calendar.
Definition at line 197 of file calendarresources.cpp.
◆ requestSaveTicket()
CalendarResources::Ticket * CalendarResources::requestSaveTicket | ( | ResourceCalendar * | resource | ) |
Request 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.
Definition at line 826 of file calendarresources.cpp.
◆ resource()
ResourceCalendar * CalendarResources::resource | ( | Incidence * | incidence | ) |
Get the Resource associated with a specified Incidence.
- Parameters
-
incidence is a pointer to an Incidence whose Resource is to be located.
- Returns
- a pointer to the Resource containing the Incidence.
Definition at line 772 of file calendarresources.cpp.
◆ resourceAdded()
void CalendarResources::resourceAdded | ( | ResourceCalendar * | resource | ) |
Add a Resource to the Calendar.
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.
Definition at line 780 of file calendarresources.cpp.
◆ resourceManager()
|
inline |
Get the CalendarResourceManager used by this calendar.
- Returns
- a pointer to the CalendarResourceManage.
Definition at line 241 of file calendarresources.h.
◆ save() [1/2]
|
virtual |
Sync changes in memory to persistant storage.
Implements KCal::Calendar.
Definition at line 286 of file calendarresources.cpp.
◆ save() [2/2]
|
virtual |
Save this Calendar.
If the save is successfull, 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 839 of file calendarresources.cpp.
◆ setAskDestinationPolicy()
void CalendarResources::setAskDestinationPolicy | ( | ) |
Set the destination policy such that Incidences are added to a Resource which is queried.
Definition at line 211 of file calendarresources.cpp.
◆ setDialogParentWidget()
void CalendarResources::setDialogParentWidget | ( | TQWidget * | 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).
Definition at line 221 of file calendarresources.cpp.
◆ setStandardDestinationPolicy()
void CalendarResources::setStandardDestinationPolicy | ( | ) |
Set the destination policy such that Incidences are always added to the standard Resource.
Definition at line 206 of file calendarresources.cpp.
◆ setTimeZoneIdViewOnly()
|
virtual |
Set the viewing time zone, which requires that all resources are saved, and then reloaded such that the event times are re-interpreted in the new timezone.
Note that the absolute times of events do not change with this. If you want to change the times of the contents of the resources, use setTimeZoneId
Implements KCal::Calendar.
Definition at line 820 of file calendarresources.cpp.
◆ signalErrorMessage
|
signal |
Signal an error message.
◆ signalResourceAdded
|
signal |
Signal that an Incidence has been inserted to the Resource.
◆ signalResourceDeleted
|
signal |
Signal that an Incidence has been removed from the Resource.
◆ signalResourceModified
|
signal |
Signal that the Resource has been modified.
◆ todo()
|
virtual |
Returns the Todo associated with the given unique identifier.
- Parameters
-
uid is a unique identifier string.
Implements KCal::Calendar.
Definition at line 523 of file calendarresources.cpp.
The documentation for this class was generated from the following files: