Akonadi Calendar

calendarbase.h
1 /*
2  SPDX-FileCopyrightText: 2011 Sérgio Martins <[email protected]>
3  SPDX-FileCopyrightText: 2012 Sérgio Martins <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef _AKONADI_CALENDARBASE_H_
9 #define _AKONADI_CALENDARBASE_H_
10 
11 #include "akonadi-calendar_export.h"
12 
13 #include <item.h>
14 #include <collection.h>
15 #include <KCalendarCore/MemoryCalendar>
16 #include <KCalendarCore/Incidence>
17 
18 namespace Akonadi {
19 class CalendarBasePrivate;
20 class IncidenceChanger;
21 
35 class AKONADI_CALENDAR_EXPORT CalendarBase : public KCalendarCore::MemoryCalendar
36 {
37  Q_OBJECT
38 public:
40 
44  explicit CalendarBase(QObject *parent = nullptr);
45 
49  ~CalendarBase() override;
50 
56  Q_REQUIRED_RESULT Akonadi::Item item(const QString &uid) const;
57 
62  Q_REQUIRED_RESULT Akonadi::Item item(const KCalendarCore::Incidence::Ptr &incidence) const;
63 
67  Q_REQUIRED_RESULT Akonadi::Item item(Akonadi::Item::Id) const;
68 
74  Q_REQUIRED_RESULT Akonadi::Item::List items(Akonadi::Collection::Id = -1) const;
75 
79  Q_REQUIRED_RESULT Akonadi::Item::List itemList(const KCalendarCore::Incidence::List &incidenceList) const;
80 //TODO: unit-test
86  Q_REQUIRED_RESULT KCalendarCore::Incidence::List childIncidences(const QString &parentUid) const;
87 
93  Q_REQUIRED_RESULT KCalendarCore::Incidence::List childIncidences(Item::Id parentId) const;
94 
100  Q_REQUIRED_RESULT Akonadi::Item::List childItems(const QString &parentUid) const;
101 
107  Q_REQUIRED_RESULT Akonadi::Item::List childItems(Item::Id parentId) const;
108 
114  bool addEvent(const KCalendarCore::Event::Ptr &event) override;
115 
121  bool deleteEvent(const KCalendarCore::Event::Ptr &event) override;
122 
128  bool addTodo(const KCalendarCore::Todo::Ptr &todo) override;
129 
135  bool deleteTodo(const KCalendarCore::Todo::Ptr &todo) override;
136 
142  bool addJournal(const KCalendarCore::Journal::Ptr &journal) override;
143 
149  bool deleteJournal(const KCalendarCore::Journal::Ptr &journal) override;
150 
156  bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence) override;
157 
163  bool deleteIncidence(const KCalendarCore::Incidence::Ptr &incidence) override;
164 
171  void startBatchAdding() override;
172 
177  void endBatchAdding() override;
178 
183  Q_REQUIRED_RESULT Akonadi::IncidenceChanger *incidenceChanger() const;
184 
190  bool modifyIncidence(const KCalendarCore::Incidence::Ptr &newIncidence);
191 
196  virtual bool isLoaded() const;
197 
198 Q_SIGNALS:
205  void createFinished(bool success, const QString &errorMessage);
206 
213  void deleteFinished(bool success, const QString &errorMessage);
214 
221  void modifyFinished(bool success, const QString &errorMessage);
222 
223 protected:
224  Q_DECLARE_PRIVATE(CalendarBase)
226  CalendarBase(CalendarBasePrivate *const d, QObject *parent);
227 
228  friend class Scheduler;
229 };
230 }
231 
232 #endif
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
FreeBusyManager::Singleton.
The base class for all akonadi aware calendars.
Definition: calendarbase.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Dec 3 2020 23:12:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.