KCalendarCore
calendar.h
Go to the documentation of this file.
132class KCALENDARCORE_EXPORT Calendar : public QObject, public CustomProperties, public IncidenceBase::IncidenceObserver
135 Q_PROPERTY(QString productId READ productId WRITE setProductId) // clazy:exclude=qproperty-without-notify
140 Q_PROPERTY(KCalendarCore::AccessMode accessMode READ accessMode WRITE setAccessMode NOTIFY accessModeChanged)
477 static Incidence::List mergeIncidenceList(const Event::List &events, const Todo::List &todos, const Journal::List &journals);
505 static Incidence::Ptr createException(const Incidence::Ptr &incidence, const QDateTime &recurrenceId, bool thisAndFuture = false);
542 @param eventList the list of events that should be sorted. The list is sorted in place and returned.
549 static Event::List sortEvents(Event::List &&eventList, EventSortField sortField, SortDirection sortDirection);
559 virtual Event::List events(EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const;
583 Q_REQUIRED_RESULT Event::List events(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const;
611 virtual Event::List rawEvents(EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const = 0;
626 virtual Event::List rawEvents(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const = 0;
667 eventInstances(const Incidence::Ptr &event, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const = 0;
703 @param todoList the list of todos that should be sorted. The list is sorted in place and returned.
711 static Todo::List sortTodos(Todo::List &&todoList, TodoSortField sortField, SortDirection sortDirection);
721 virtual Todo::List todos(TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const;
745 virtual Todo::List todos(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const;
755 virtual Todo::List rawTodos(TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const = 0;
779 virtual Todo::List rawTodos(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const = 0;
802 todoInstances(const Incidence::Ptr &todo, TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const = 0;
839 @param journalList the list of journals that should be sorted. The list is sorted in place and returned.
846 static Journal::List sortJournals(Journal::List &&journalList, JournalSortField sortField, SortDirection sortDirection);
856 virtual Journal::List journals(JournalSortField sortField = JournalSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const;
875 virtual Journal::List rawJournals(JournalSortField sortField = JournalSortUnsorted, SortDirection sortDirection = SortDirectionAscending) const = 0;
944 virtual Alarm::List alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms = false) const = 0;
1004 virtual void calendarIncidenceDeleted(const Incidence::Ptr &incidence, const Calendar *calendar);
1103 void appendAlarms(Alarm::List &alarms, const Incidence::Ptr &incidence, const QDateTime &from, const QDateTime &to) const;
1114 void appendRecurringAlarms(Alarm::List &alarms, const Incidence::Ptr &incidence, const QDateTime &from, const QDateTime &to) const;
virtual void calendarModified(bool modified, Calendar *calendar)
Notify the Observer that a Calendar has been modified.
Definition calendar.cpp:576
virtual void calendarIncidenceDeleted(const Incidence::Ptr &incidence, const Calendar *calendar)
Notify the Observer that an Incidence has been removed.
Definition calendar.cpp:597
virtual void calendarIncidenceAboutToBeDeleted(const Incidence::Ptr &incidence)
Notify the Observer that an Incidence will be removed.
Definition calendar.cpp:592
virtual void calendarIncidenceChanged(const Incidence::Ptr &incidence)
Notify the Observer that an Incidence has been modified.
Definition calendar.cpp:587
virtual void calendarIncidenceAdded(const Incidence::Ptr &incidence)
Notify the Observer that an Incidence has been inserted.
Definition calendar.cpp:582
virtual void calendarIncidenceAdditionCanceled(const Incidence::Ptr &incidence)
Notify the Observer that an addition of Incidence has been canceled.
Definition calendar.cpp:603
QTimeZone timeZone() const
Get the time zone used for creating or modifying incidences in the Calendar.
Definition calendar.cpp:163
virtual Todo::List rawTodosForDate(const QDate &date) const =0
Returns an unfiltered list of all Todos which due on the specified date.
void appendAlarms(Alarm::List &alarms, const Incidence::Ptr &incidence, const QDateTime &from, const QDateTime &to) const
Appends alarms of incidence in interval to list of alarms.
Definition calendar.cpp:808
static Todo::List sortTodos(Todo::List &&todoList, TodoSortField sortField, SortDirection sortDirection)
Sort a list of Todos.
Definition calendar.cpp:444
void setTimeZoneId(const QByteArray &timeZoneId)
Sets the time zone ID used for creating or modifying incidences in the Calendar.
Definition calendar.cpp:168
virtual bool deleteJournalInstances(const Journal::Ptr &journal)=0
Delete all journals that are instances of recurring journal journal.
void notifyIncidenceAboutToBeDeleted(const Incidence::Ptr &incidence)
Let Calendar subclasses notify that they will remove an Incidence.
Definition calendar.cpp:708
virtual Alarm::List alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms=false) const =0
Returns a list of Alarms within a time range for this Calendar.
virtual Incidence::Ptr incidenceFromSchedulingID(const QString &sid) const
Returns the Incidence associated with the given scheduling identifier.
Definition calendar.cpp:433
Calendar(const QTimeZone &timeZone)
Constructs a calendar with a specified time zone timeZone.
Definition calendar.cpp:117
Alarm::List alarmsTo(const QDateTime &to) const
Return a list of Alarms that occur before the specified timestamp.
Definition calendar.cpp:938
virtual bool beginChange(const Incidence::Ptr &incidence)
Flag that a change to a Calendar Incidence is starting.
Definition calendar.cpp:791
virtual Journal::List journalInstances(const Incidence::Ptr &journal, JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all instances for this recurring Journal.
QByteArray timeZoneId() const
Returns the time zone ID used for creating or modifying incidences in the calendar.
Definition calendar.cpp:189
virtual Todo::List todos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, filtered list of all Todos for this Calendar.
Definition calendar.cpp:511
virtual Event::List events(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, filtered list of all Events for this Calendar.
Definition calendar.cpp:339
static Journal::List sortJournals(Journal::List &&journalList, JournalSortField sortField, SortDirection sortDirection)
Sort a list of Journals.
Definition calendar.cpp:532
static Incidence::List mergeIncidenceList(const Event::List &events, const Todo::List &todos, const Journal::List &journals)
Create a merged list of Events, Todos, and Journals.
Definition calendar.cpp:769
void notifyIncidenceDeleted(const Incidence::Ptr &incidence)
Let Calendar subclasses notify that they removed an Incidence.
Definition calendar.cpp:723
void accessModeChanged()
Emitted when the AccessMode changes.
virtual bool deleteEventInstances(const Event::Ptr &event)=0
Delete all events that are instances of recurring event event.
virtual Incidence::List incidencesFromSchedulingID(const QString &sid) const
Searches all events and todos for an incidence with this scheduling identifier.
Definition calendar.cpp:423
void notifyIncidenceAdditionCanceled(const Incidence::Ptr &incidence)
Let Calendar subclasses notify that they canceled addition of an Incidence.
Definition calendar.cpp:738
virtual Incidence::List instances(const Incidence::Ptr &incidence) const
Returns an unfiltered list of all exceptions of this recurring incidence.
Definition calendar.cpp:264
void shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone)
Shifts the times of all incidences so that they appear at the same clock time as before but in a new ...
Definition calendar.cpp:194
virtual Incidence::List rawIncidences() const
Returns an unfiltered list of all Incidences for this Calendar.
Definition calendar.cpp:259
void incidenceUpdated(const QString &uid, const QDateTime &recurrenceId) override
The Observer interface.
Definition calendar.cpp:646
virtual bool addTodo(const Todo::Ptr &todo)=0
Inserts a Todo into the calendar.
virtual Journal::List rawJournals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all Journals for this Calendar.
Incidence::Ptr incidence(const QString &uid, const QDateTime &recurrenceId={}) const
Returns the Incidence associated with the given unique identifier.
Definition calendar.cpp:407
virtual Incidence::List incidences() const
Returns a filtered list of all Incidences for this Calendar.
Definition calendar.cpp:254
virtual bool deleteEvent(const Event::Ptr &event)=0
Removes an Event from the calendar.
void notifyIncidenceAdded(const Incidence::Ptr &incidence)
Let Calendar subclasses notify that they inserted an Incidence.
Definition calendar.cpp:669
virtual Todo::List todoInstances(const Incidence::Ptr &todo, TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all possible instances for this recurring Todo.
virtual bool deleteJournal(const Journal::Ptr &journal)=0
Removes a Journal from the calendar.
virtual void doSetTimeZone(const QTimeZone &timeZone)
Let Calendar subclasses set the time specification.
Definition calendar.cpp:664
virtual Todo::List rawTodos(const QDate &start, const QDate &end, const QTimeZone &timeZone={}, bool inclusive=false) const =0
Returns an unfiltered list of all Todos occurring within a date range.
static Incidence::Ptr createException(const Incidence::Ptr &incidence, const QDateTime &recurrenceId, bool thisAndFuture=false)
Creates an exception for an occurrence from a recurring Incidence.
Definition calendar.cpp:372
static Event::List sortEvents(Event::List &&eventList, EventSortField sortField, SortDirection sortDirection)
Sort a list of Events.
Definition calendar.cpp:284
virtual Journal::List journals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, filtered list of all Journals for this Calendar.
Definition calendar.cpp:558
virtual void virtual_hook(int id, void *data)
Definition calendar.cpp:943
void setOwner(const Person &owner)
Sets the owner of the calendar to owner.
Definition calendar.cpp:143
virtual void startBatchAdding()
Call this to tell the calendar that you're adding a batch of incidences.
Definition calendar.cpp:923
void isLoadingChanged()
Emitted when the loading state changed.
virtual bool deleteTodoInstances(const Todo::Ptr &todo)=0
Delete all to-dos that are instances of recurring to-do todo.
void setObserversEnabled(bool enabled)
Let Calendar subclasses notify that they enabled an Observer.
Definition calendar.cpp:803
virtual Journal::List rawJournalsForDate(const QDate &date) const =0
Returns an unfiltered list of all Journals for on the specified date.
void setIsLoading(bool isLoading)
Sets the loading state of this calendar.
Definition calendar.cpp:1005
virtual Event::List eventInstances(const Incidence::Ptr &event, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all possible instances for this recurring Event.
virtual Todo::Ptr todo(const QString &uid, const QDateTime &recurrenceId={}) const =0
Returns the Todo associated with the given unique identifier.
virtual Event::List rawEvents(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all Events for this Calendar.
virtual Event::Ptr event(const QString &uid, const QDateTime &recurrenceId={}) const =0
Returns the Event associated with the given unique identifier.
virtual Journal::Ptr journal(const QString &uid, const QDateTime &recurrenceId={}) const =0
Returns the Journal associated with the given unique identifier.
virtual bool deleteTodo(const Todo::Ptr &todo)=0
Removes a Todo from the calendar.
virtual bool addIncidence(const Incidence::Ptr &incidence)
Inserts an Incidence into the calendar.
Definition calendar.cpp:346
virtual bool addEvent(const Event::Ptr &event)=0
Inserts an Event into the calendar.
void setTimeZone(const QTimeZone &timeZone)
Sets the default time specification zone used for creating or modifying incidences in the Calendar.
Definition calendar.cpp:152
void registerObserver(CalendarObserver *observer)
Registers an Observer for this Calendar.
Definition calendar.cpp:608
virtual bool deleteIncidenceInstances(const Incidence::Ptr &incidence)=0
Delete all incidences that are instances of recurring incidence incidence.
void appendRecurringAlarms(Alarm::List &alarms, const Incidence::Ptr &incidence, const QDateTime &from, const QDateTime &to) const
Appends alarms of recurring events in interval to list of alarms.
Definition calendar.cpp:824
virtual Event::List rawEventsForDate(const QDate &date, const QTimeZone &timeZone={}, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all Events which occur on the given date.
QStringList categories() const
Returns a list of all categories used by Incidences in this Calendar.
Definition calendar.cpp:231
void customPropertyUpdated() override
Definition calendar.cpp:753
void unregisterObserver(CalendarObserver *observer)
Unregisters an Observer for this Calendar.
Definition calendar.cpp:621
virtual bool endChange(const Incidence::Ptr &incidence)
Flag that a change to a Calendar Incidence has completed.
Definition calendar.cpp:797
void notifyIncidenceChanged(const Incidence::Ptr &incidence)
Let Calendar subclasses notify that they modified an Incidence.
Definition calendar.cpp:693
virtual bool addJournal(const Journal::Ptr &journal)=0
Inserts a Journal into the calendar.
void setAccessMode(const AccessMode mode)
Set this calendar's AccessMode, i.e.
Definition calendar.cpp:992
virtual Event::List rawEvents(const QDate &start, const QDate &end, const QTimeZone &timeZone={}, bool inclusive=false) const =0
Returns an unfiltered list of all Events occurring within a date range.
virtual Todo::List rawTodos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const =0
Returns a sorted, unfiltered list of all Todos for this Calendar.
void setName(const QString &name)
Set the user-visible name for this calendar.
Definition calendar.cpp:968
virtual bool deleteIncidence(const Incidence::Ptr &incidence)
Removes an Incidence from the calendar.
Definition calendar.cpp:356
virtual void endBatchAdding()
Tells the Calendar that you stopped adding a batch of incidences.
Definition calendar.cpp:928
An abstract class that provides a common base for all calendar incidence classes.
Definition incidencebase.h:99
This file is part of the API for handling calendar data and defines the CustomProperties class.
This file is part of the API for handling calendar data and defines the Event class.
Q_SCRIPTABLE QString start(QString train="")
Q_SCRIPTABLE bool setFilter(const QString &filter)
This file is part of the API for handling calendar data and defines the Incidence class.
This file is part of the API for handling calendar data and defines the Journal class.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
virtual bool event(QEvent *e)
This file is part of the API for handling calendar data and defines the Todo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:53 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:53 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.