21 #ifndef _AKONADI_CALENDARBASE_H_
22 #define _AKONADI_CALENDARBASE_H_
24 #include "akonadi-calendar_export.h"
26 #include <akonadi/item.h>
27 #include <kcalcore/memorycalendar.h>
28 #include <kcalcore/incidence.h>
29 #include <KDE/KDateTime>
33 class CalendarBasePrivate;
34 class IncidenceChanger;
49 class AKONADI_CALENDAR_EXPORT
CalendarBase :
public KCalCore::MemoryCalendar
53 typedef QSharedPointer<CalendarBase> Ptr;
70 Akonadi::Item item(
const QString &uid )
const;
76 Akonadi::Item item(
const KCalCore::Incidence::Ptr &incidence )
const;
81 Akonadi::Item item( Akonadi::Item::Id )
const;
87 Akonadi::Item::List items()
const;
92 Akonadi::Item::List itemList(
const KCalCore::Incidence::List &incidenceList )
const;
99 KCalCore::Incidence::List childIncidences(
const QString &parentUid )
const;
106 KCalCore::Incidence::List childIncidences(
const Akonadi::Item::Id &parentId )
const;
113 Akonadi::Item::List childItems(
const QString &parentUid )
const;
120 Akonadi::Item::List childItems(
const Akonadi::Item::Id &parentId )
const;
133 void setWeakPointer(
const QWeakPointer<Akonadi::CalendarBase> &pointer );
140 QWeakPointer<CalendarBase> weakPointer()
const;
141 bool addEvent(
const KCalCore::Event::Ptr &event );
148 bool deleteEvent(
const KCalCore::Event::Ptr &event );
155 void deleteAllEvents();
166 bool addTodo(
const KCalCore::Todo::Ptr &todo );
173 bool deleteTodo(
const KCalCore::Todo::Ptr &todo );
180 void deleteAllTodos();
191 bool addJournal(
const KCalCore::Journal::Ptr &journal );
198 bool deleteJournal(
const KCalCore::Journal::Ptr &journal );
205 void deleteAllJournals();
216 bool addIncidence(
const KCalCore::Incidence::Ptr &incidence );
223 bool deleteIncidence(
const KCalCore::Incidence::Ptr & );
230 void startBatchAdding();
238 void endBatchAdding();
249 Akonadi::IncidenceChanger *incidenceChanger()
const;
256 bool modifyIncidence(
const KCalCore::Incidence::Ptr &newIncidence );
265 void createFinished(
bool success,
const QString &errorMessage );
273 void deleteFinished(
bool success,
const QString &errorMessage );
281 void modifyFinished(
bool success,
const QString &errorMessage );
285 QScopedPointer<CalendarBasePrivate> d_ptr;
286 CalendarBase( CalendarBasePrivate *
const d, QObject *parent );
The base class for all akonadi aware calendars.