Akonadi::CalendarBase Class
The base class for all akonadi aware calendars. More...
| Header: | #include <Akonadi/CalendarBase> |
| CMake: | find_package(KPim6AkonadiCalendar REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendar) |
| Inherited By: | Akonadi::CollectionCalendar, Akonadi::ETMCalendar, and Akonadi::FetchJobCalendar |
Public Functions
| CalendarBase(QObject *parent = nullptr) | |
| virtual | ~CalendarBase() override |
| KCalendarCore::Incidence::List | childIncidences(Item::Id parentId) const |
| Akonadi::Item::List | childItems(Item::Id parentId) const |
| Akonadi::Item::List | childItems(const QString &parentUid) const |
| Akonadi::IncidenceChanger * | incidenceChanger() const |
| Akonadi::Item | item(Akonadi::Item::Id) const |
| Akonadi::Item | item(const KCalendarCore::Incidence::Ptr &incidence) const |
| Akonadi::Item | item(const QString &uid) const |
| Akonadi::Item::List | itemList(const KCalendarCore::Incidence::List &incidenceList) const |
| Akonadi::Item::List | items(Akonadi::Collection::Id = -1) const |
| bool | modifyIncidence(const KCalendarCore::Incidence::Ptr &newIncidence) |
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 bool | deleteEvent(const KCalendarCore::Event::Ptr &event) override |
| virtual bool | deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence) override |
| virtual bool | deleteJournal(const KCalendarCore::Journal::Ptr &journal) override |
| virtual bool | deleteTodo(const KCalendarCore::Todo::Ptr &todo) override |
| virtual void | endBatchAdding() override |
| virtual void | startBatchAdding() override |
Signals
| void | createFinished(bool success, const QString &errorMessage) |
| void | deleteFinished(bool success, const QString &errorMessage) |
| void | modifyFinished(bool success, const QString &errorMessage) |
Protected Functions
(since 6.9.0) bool | isModificationInProgress() const |
Detailed Description
Because it inherits KCalendarCore::Calendar, it provides seamless integration with KCalendarCore and CalendarSupport libraries eliminating any need for adapter ( akonadi<->KCalendarCore ) classes.
Author: Sérgio Martins <sergio.martins@kdab.com>
See also ETMCalendar and FetchJobCalendar.
Member Function Documentation
[explicit] CalendarBase::CalendarBase(QObject *parent = nullptr)
Constructs a CalendarBase object.
[override virtual noexcept] CalendarBase::~CalendarBase()
Destroys the calendar.
[override virtual] bool CalendarBase::addEvent(const KCalendarCore::Event::Ptr &event)
Adds an Event to the calendar. It's added to akonadi in the background
event the event to be added
See also createFinished().
[override virtual] bool CalendarBase::addIncidence(const KCalendarCore::Incidence::Ptr &incidence)
Adds an incidence to the calendar. It's added to akonadi in the background
incidence the incidence to add
See also createFinished().
[override virtual] bool CalendarBase::addJournal(const KCalendarCore::Journal::Ptr &journal)
Adds a Journal to the calendar. It's added to akonadi in the background
journal the journal to add
See also createFinished().
[override virtual] bool CalendarBase::addTodo(const KCalendarCore::Todo::Ptr &todo)
Adds a Todo to the calendar. It's added to akonadi in the background
todo the todo to add
See also createFinished().
KCalendarCore::Incidence::List CalendarBase::childIncidences(Item::Id parentId) const
Returns the child incidences of the parent identified by parentId. Only the direct children are returned parentId identifier of the parent item
Akonadi::Item::List CalendarBase::childItems(Item::Id parentId) const
Returns the child items of the parent identified by parentId. Only the direct children are returned parentId identifier of the parent item
Akonadi::Item::List CalendarBase::childItems(const QString &parentUid) const
Returns the child items of the parent identified by parentUid. Only the direct children are returned parentUid identifier of the parent incidence
[signal] void CalendarBase::createFinished(bool success, const QString &errorMessage)
This signal is emitted when an incidence is created in akonadi through add{Incidence,Event,Todo,Journal} success the success of the operation errorMessage if success is false, contains the error message
[override virtual] bool CalendarBase::deleteEvent(const KCalendarCore::Event::Ptr &event)
Deletes an Event from the calendar. It's removed from akonadi in the background
event the event to be deleted
See also deleteFinished().
[signal] void CalendarBase::deleteFinished(bool success, const QString &errorMessage)
This signal is emitted when an incidence is deleted in akonadi through delete{Incidence,Event,Todo,Journal} success the success of the operation errorMessage if success is false, contains the error message
[override virtual] bool CalendarBase::deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence)
Deletes an incidence from the calendar. It's removed from akonadi in the background
incidence the incidence to delete
See also deleteFinished().
[override virtual] bool CalendarBase::deleteJournal(const KCalendarCore::Journal::Ptr &journal)
Deletes a Journal from the calendar. It's removed from akonadi in the background
journal the journal to delete
See also deleteFinished().
[override virtual] bool CalendarBase::deleteTodo(const KCalendarCore::Todo::Ptr &todo)
Deletes a Todo from the calendar. It's removed from akonadi in the background
todo the todo to delete
See also deleteFinished().
[override virtual] void CalendarBase::endBatchAdding()
Tells the Calendar that you stopped adding a batch of incidences.
See also startBatchAdding().
Akonadi::IncidenceChanger *CalendarBase::incidenceChanger() const
Returns the IncidenceChanger used by this calendar to make changes in akonadi. Use this if you need the defaults used by CalendarBase.
[protected, since 6.9.0] bool CalendarBase::isModificationInProgress() const
Indicates that an incidence in this calendar is currently being modified with changes coming from Akonadi. This is useful for preventing modification loops, as there is no distinction in the KCalendarCore::Calendar API between "internal" and "external" modifications.
This function was introduced in 6.9.0.
Akonadi::Item CalendarBase::item(Akonadi::Item::Id) const
Returns the Item with id or an invalid Item if not found.
Akonadi::Item CalendarBase::item(const KCalendarCore::Incidence::Ptr &incidence) const
Returns the Item containing incidence or an invalid Item if the incidence isn't found.
Akonadi::Item CalendarBase::item(const QString &uid) const
Returns the Item containing the incidence with uid uid or an invalid Item if the incidence isn't found.
See also Use, item(Incidence::Ptr), instead, where, possible, This, function, doesn't, take, exceptions, (recurrenceId), into, account, and (and thus always returns the main event).
Akonadi::Item::List CalendarBase::itemList(const KCalendarCore::Incidence::List &incidenceList) const
Returns the item list that corresponds to the incidenceList.
Akonadi::Item::List CalendarBase::items(Akonadi::Collection::Id = -1) const
Returns the list of items contained in this calendar that belong to the specified collection.
See also incidences().
[signal] void CalendarBase::modifyFinished(bool success, const QString &errorMessage)
This signal is emitted when an incidence is modified in akonadi through modifyIncidence(). success the success of the operation errorMessage if success is false, contains the error message
bool CalendarBase::modifyIncidence(const KCalendarCore::Incidence::Ptr &newIncidence)
Modifies an incidence. The incidence with the same uid as newIncidence will be updated with the contents of newIncidence the incidence to modify
[override virtual] void CalendarBase::startBatchAdding()
Call this to tell the calendar that you're adding a batch of incidences. So it doesn't, for example, ask the destination for each incidence.
See also endBatchAdding().