KCalendarCore::MemoryCalendar Class

class KCalendarCore::MemoryCalendar

This class provides a calendar stored in memory. More...

Header: #include <KCalendarCore/MemoryCalendar>
CMake: find_package(KF6 REQUIRED COMPONENTS CalendarCore)
target_link_libraries(mytarget PRIVATE KF6::CalendarCore)
Inherits: KCalendarCore::Calendar

Public Types

Ptr

Public Functions

MemoryCalendar(const QByteArray &timeZoneId)
MemoryCalendar(const QTimeZone &timeZone)
virtual ~MemoryCalendar() override
(since 4.11) KCalendarCore::Incidence::Ptr instance(const QString &identifier) const
(since 5.80) void setUpdateLastModifiedOnChange(bool update)
(since 5.80) bool updateLastModifiedOnChange() const

Reimplemented Public Functions

virtual bool addEvent(const KCalendarCore::Event::Ptr &event) override
virtual bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence) override
virtual bool addJournal(const KCalendarCore::Journal::Ptr &journal) override
virtual bool addTodo(const KCalendarCore::Todo::Ptr &todo) override
virtual KCalendarCore::Alarm::List alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms = false) const override
virtual bool deleteEvent(const KCalendarCore::Event::Ptr &event) override
virtual bool deleteEventInstances(const KCalendarCore::Event::Ptr &event) override
virtual bool deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence) override
virtual bool deleteIncidenceInstances(const KCalendarCore::Incidence::Ptr &incidence) override
virtual bool deleteJournal(const KCalendarCore::Journal::Ptr &journal) override
virtual bool deleteJournalInstances(const KCalendarCore::Journal::Ptr &journal) override
virtual bool deleteTodo(const KCalendarCore::Todo::Ptr &todo) override
virtual bool deleteTodoInstances(const KCalendarCore::Todo::Ptr &todo) override
virtual void doSetTimeZone(const QTimeZone &timeZone) override
virtual KCalendarCore::Event::Ptr event(const QString &uid, const QDateTime &recurrenceId = {}) const override
virtual KCalendarCore::Event::List eventInstances(const KCalendarCore::Incidence::Ptr &event, KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual void incidenceUpdate(const QString &uid, const QDateTime &recurrenceId) override
virtual void incidenceUpdated(const QString &uid, const QDateTime &recurrenceId) override
virtual KCalendarCore::Journal::Ptr journal(const QString &uid, const QDateTime &recurrenceId = {}) const override
virtual KCalendarCore::Journal::List journalInstances(const KCalendarCore::Incidence::Ptr &journal, KCalendarCore::JournalSortField sortField = JournalSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual KCalendarCore::Event::List rawEvents(KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual KCalendarCore::Event::List rawEvents(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const override
virtual KCalendarCore::Event::List rawEventsForDate(const QDate &date, const QTimeZone &timeZone = {}, KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual KCalendarCore::Journal::List rawJournals(KCalendarCore::JournalSortField sortField = JournalSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual KCalendarCore::Journal::List rawJournalsForDate(const QDate &date) const override
virtual KCalendarCore::Todo::List rawTodos(KCalendarCore::TodoSortField sortField = TodoSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override
virtual KCalendarCore::Todo::List rawTodos(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const override
virtual KCalendarCore::Todo::List rawTodosForDate(const QDate &date) const override
virtual KCalendarCore::Todo::Ptr todo(const QString &uid, const QDateTime &recurrenceId = {}) const override
virtual KCalendarCore::Todo::List todoInstances(const KCalendarCore::Incidence::Ptr &todo, KCalendarCore::TodoSortField sortField = TodoSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const override

Reimplemented Protected Functions

virtual void virtual_hook(int id, void *data) override

Detailed Description

Member Type Documentation

MemoryCalendar::Ptr

A shared pointer to a MemoryCalendar

Member Function Documentation

[explicit] MemoryCalendar::MemoryCalendar(const QByteArray &timeZoneId)

Constructs a MemoryCalendar 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.

timeZoneId is 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 time zone.

Example: "Europe/Berlin"

[explicit] MemoryCalendar::MemoryCalendar(const QTimeZone &timeZone)

Constructs a MemoryCalendar object with a specified time zone timeZone. The time zone is used as the default for creating or modifying incidences in the Calendar. The time zone does not alter existing incidences.

timeZone is the time specification

[override virtual noexcept] MemoryCalendar::~MemoryCalendar()

Destroys the calendar.

[override virtual] bool MemoryCalendar::addEvent(const KCalendarCore::Event::Ptr &event)

Reimplements: Calendar::addEvent(const KCalendarCore::Event::Ptr &event).

[override virtual] bool MemoryCalendar::addIncidence(const KCalendarCore::Incidence::Ptr &incidence)

Reimplements: Calendar::addIncidence(const KCalendarCore::Incidence::Ptr &incidence).

[override virtual] bool MemoryCalendar::addJournal(const KCalendarCore::Journal::Ptr &journal)

Reimplements: Calendar::addJournal(const KCalendarCore::Journal::Ptr &journal).

[override virtual] bool MemoryCalendar::addTodo(const KCalendarCore::Todo::Ptr &todo)

Reimplements: Calendar::addTodo(const KCalendarCore::Todo::Ptr &todo).

[override virtual] KCalendarCore::Alarm::List MemoryCalendar::alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms = false) const

Reimplements: Calendar::alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms) const.

[override virtual] bool MemoryCalendar::deleteEvent(const KCalendarCore::Event::Ptr &event)

Reimplements: Calendar::deleteEvent(const KCalendarCore::Event::Ptr &event).

[override virtual] bool MemoryCalendar::deleteEventInstances(const KCalendarCore::Event::Ptr &event)

Reimplements: Calendar::deleteEventInstances(const KCalendarCore::Event::Ptr &event).

[override virtual] bool MemoryCalendar::deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence)

Reimplements: Calendar::deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence).

[override virtual] bool MemoryCalendar::deleteIncidenceInstances(const KCalendarCore::Incidence::Ptr &incidence)

Reimplements: Calendar::deleteIncidenceInstances(const KCalendarCore::Incidence::Ptr &incidence).

[override virtual] bool MemoryCalendar::deleteJournal(const KCalendarCore::Journal::Ptr &journal)

Reimplements: Calendar::deleteJournal(const KCalendarCore::Journal::Ptr &journal).

[override virtual] bool MemoryCalendar::deleteJournalInstances(const KCalendarCore::Journal::Ptr &journal)

Reimplements: Calendar::deleteJournalInstances(const KCalendarCore::Journal::Ptr &journal).

[override virtual] bool MemoryCalendar::deleteTodo(const KCalendarCore::Todo::Ptr &todo)

Reimplements: Calendar::deleteTodo(const KCalendarCore::Todo::Ptr &todo).

[override virtual] bool MemoryCalendar::deleteTodoInstances(const KCalendarCore::Todo::Ptr &todo)

Reimplements: Calendar::deleteTodoInstances(const KCalendarCore::Todo::Ptr &todo).

[override virtual] void MemoryCalendar::doSetTimeZone(const QTimeZone &timeZone)

Reimplements: Calendar::doSetTimeZone(const QTimeZone &timeZone).

[override virtual] KCalendarCore::Event::Ptr MemoryCalendar::event(const QString &uid, const QDateTime &recurrenceId = {}) const

Reimplements: Calendar::event(const QString &uid, const QDateTime &recurrenceId) const.

[override virtual] KCalendarCore::Event::List MemoryCalendar::eventInstances(const KCalendarCore::Incidence::Ptr &event, KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::eventInstances(const KCalendarCore::Incidence::Ptr &event, KCalendarCore::EventSortField sortField, KCalendarCore::SortDirection sortDirection) const.

[override virtual] void MemoryCalendar::incidenceUpdate(const QString &uid, const QDateTime &recurrenceId)

Reimplements: IncidenceObserver::incidenceUpdate(const QString &uid, const QDateTime &recurrenceId).

[override virtual] void MemoryCalendar::incidenceUpdated(const QString &uid, const QDateTime &recurrenceId)

Reimplements: Calendar::incidenceUpdated(const QString &uid, const QDateTime &recurrenceId).

[since 4.11] KCalendarCore::Incidence::Ptr MemoryCalendar::instance(const QString &identifier) const

Returns an incidence by identifier.

This function was introduced in 4.11.

See also Incidence::instanceIdentifier().

[override virtual] KCalendarCore::Journal::Ptr MemoryCalendar::journal(const QString &uid, const QDateTime &recurrenceId = {}) const

Reimplements: Calendar::journal(const QString &uid, const QDateTime &recurrenceId) const.

[override virtual] KCalendarCore::Journal::List MemoryCalendar::journalInstances(const KCalendarCore::Incidence::Ptr &journal, KCalendarCore::JournalSortField sortField = JournalSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::journalInstances(const KCalendarCore::Incidence::Ptr &journal, KCalendarCore::JournalSortField sortField, KCalendarCore::SortDirection sortDirection) const.

JournalSortField, SortDirection)const

[override virtual] KCalendarCore::Event::List MemoryCalendar::rawEvents(KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::rawEvents(KCalendarCore::EventSortField sortField, KCalendarCore::SortDirection sortDirection) const.

[override virtual] KCalendarCore::Event::List MemoryCalendar::rawEvents(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const

Reimplements: Calendar::rawEvents(const QDate &start, const QDate &end, const QTimeZone &timeZone, bool inclusive) const.

[override virtual] KCalendarCore::Event::List MemoryCalendar::rawEventsForDate(const QDate &date, const QTimeZone &timeZone = {}, KCalendarCore::EventSortField sortField = EventSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::rawEventsForDate(const QDate &date, const QTimeZone &timeZone, KCalendarCore::EventSortField sortField, KCalendarCore::SortDirection sortDirection) const.

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

date request unfiltered Event list for this QDate only.

timeZone time zone to interpret date, or the calendar's default time zone if none is specified

sortField specifies the EventSortField.

sortDirection specifies the SortDirection.

Returns the list of unfiltered Events occurring on the specified QDate.

[override virtual] KCalendarCore::Journal::List MemoryCalendar::rawJournals(KCalendarCore::JournalSortField sortField = JournalSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::rawJournals(KCalendarCore::JournalSortField sortField, KCalendarCore::SortDirection sortDirection) const.

[override virtual] KCalendarCore::Journal::List MemoryCalendar::rawJournalsForDate(const QDate &date) const

Reimplements: Calendar::rawJournalsForDate(const QDate &date) const.

[override virtual] KCalendarCore::Todo::List MemoryCalendar::rawTodos(KCalendarCore::TodoSortField sortField = TodoSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::rawTodos(KCalendarCore::TodoSortField sortField, KCalendarCore::SortDirection sortDirection) const.

[override virtual] KCalendarCore::Todo::List MemoryCalendar::rawTodos(const QDate &start, const QDate &end, const QTimeZone &timeZone = {}, bool inclusive = false) const

Reimplements: Calendar::rawTodos(const QDate &start, const QDate &end, const QTimeZone &timeZone, bool inclusive) const.

[override virtual] KCalendarCore::Todo::List MemoryCalendar::rawTodosForDate(const QDate &date) const

Reimplements: Calendar::rawTodosForDate(const QDate &date) const.

[since 5.80] void MemoryCalendar::setUpdateLastModifiedOnChange(bool update)

Govern if the memory calendar is changing the lastModified field of incidence it owns, on incidence updates.

update, when true, the lastModified field of an incidence owned by the calendar is set to the current date time on any change of the incidence.

This function was introduced in 5.80.

See also updateLastModifiedOnChange().

[override virtual] KCalendarCore::Todo::Ptr MemoryCalendar::todo(const QString &uid, const QDateTime &recurrenceId = {}) const

Reimplements: Calendar::todo(const QString &uid, const QDateTime &recurrenceId) const.

[override virtual] KCalendarCore::Todo::List MemoryCalendar::todoInstances(const KCalendarCore::Incidence::Ptr &todo, KCalendarCore::TodoSortField sortField = TodoSortUnsorted, KCalendarCore::SortDirection sortDirection = SortDirectionAscending) const

Reimplements: Calendar::todoInstances(const KCalendarCore::Incidence::Ptr &todo, KCalendarCore::TodoSortField sortField, KCalendarCore::SortDirection sortDirection) const.

[since 5.80] bool MemoryCalendar::updateLastModifiedOnChange() const

Return true if the memory calendar is updating the lastModified field of incidence owned by the calendar on any incidence change.

This function was introduced in 5.80.

See also setUpdateLastModifiedOnChange().

[override virtual protected] void MemoryCalendar::virtual_hook(int id, void *data)