31#ifndef MKCAL_EXTENDEDSTORAGE_H
32#define MKCAL_EXTENDEDSTORAGE_H
39#include <KCalendarCore/CalStorage>
40#include <KCalendarCore/Calendar>
62 :
public KCalendarCore::CalStorage,
public KCalendarCore::Calendar::CalendarObserver
79 typedef QSharedPointer<ExtendedStorage>
Ptr;
96 explicit ExtendedStorage(
const ExtendedCalendar::Ptr &cal,
bool validateNotebooks =
true);
121 virtual bool load(
const QString &uid) = 0;
131 bool loadSeries(
const QString &uid);
147 bool load(
const QString &uid,
const QDateTime &recurrenceId);
162 virtual bool load(
const QDate &date);
173 virtual bool load(
const QDate &start,
const QDate &end) = 0;
183 virtual bool loadIncidenceInstance(
const QString &instanceIdentifier);
205 const QString ¬ebook = QString()) = 0;
228 virtual bool close();
254 virtual void calendarIncidenceDeleted(
const KCalendarCore::Incidence::Ptr &incidence,
const KCalendarCore::Calendar *calendar) = 0;
277 const QDateTime &after = QDateTime(),
278 const QString ¬ebookUid = QString()) = 0;
291 const QDateTime &after = QDateTime(),
292 const QString ¬ebookUid = QString()) = 0;
303 const QDateTime &after = QDateTime(),
304 const QString ¬ebookUid = QString()) = 0;
314 const QString ¬ebookUid = QString()) = 0;
337 virtual bool search(
const QString &key, QStringList *identifiers,
int limit = 0) = 0;
439 void setValidateNotebooks(
bool validateNotebooks);
448 bool validateNotebooks()
const;
457 bool isValidNotebook(
const QString ¬ebookUid)
const;
470 Notebook::Ptr createDefaultNotebook(QString name = QString(),
471 QString color = QString());
488 bool getLoadDates(
const QDate &start,
const QDate &end,
489 QDateTime *loadStart, QDateTime *loadEnd)
const;
491 void addLoadedRange(
const QDate &start,
const QDate &end)
const;
492 bool isRecurrenceLoaded()
const;
493 void setIsRecurrenceLoaded(
bool loaded);
495 void emitStorageModified(
const QString &info);
496 void emitStorageFinished(
bool error,
const QString &info);
497 void emitStorageUpdated(
const KCalendarCore::Incidence::List &added,
498 const KCalendarCore::Incidence::List &modified,
499 const KCalendarCore::Incidence::List &deleted);
508 friend class ::MkcalTool;
509 friend class ::tst_load;
This class provides a calendar storage interface.
Definition extendedstorage.h:63
virtual bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &list, const QString ¬ebook=QString())=0
Remove from storage all incidences that have been previously marked as deleted and that matches the U...
virtual bool load(const QString &uid)=0
Load all incidences sharing the same uid into the memory.
virtual bool loadNotebookIncidences(const QString ¬ebookUid)=0
Load incidences of one notebook into the memory.
virtual void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar)=0
virtual bool load(const QDate &start, const QDate &end)=0
Load incidences between given dates into the memory.
virtual bool search(const QString &key, QStringList *identifiers, int limit=0)=0
Get all incidences from storage that match key.
virtual QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &incidence)=0
Get deletion time of incidence.
QSharedPointer< ExtendedStorage > Ptr
A shared pointer to a ExtendedStorage.
Definition extendedstorage.h:79
virtual void calendarModified(bool modified, KCalendarCore::Calendar *calendar)=0
virtual bool save(DeleteAction deleteAction)=0
This is an overload of save() method.
virtual bool loadNotebooks()=0
DeleteAction
Action to be performed on save for deleted incidences.
Definition extendedstorage.h:71
@ MarkDeleted
Definition extendedstorage.h:72
virtual bool allIncidences(KCalendarCore::Incidence::List *list, const QString ¬ebookUid=QString())=0
Get all incidences from storage.
virtual bool modifiedIncidences(KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString ¬ebookUid=QString())=0
Get modified incidences from storage.
virtual void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &incidence)=0
virtual bool modifyNotebook(const Notebook::Ptr &nb)=0
virtual void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &incidence)=0
virtual bool eraseNotebook(const Notebook::Ptr &nb)=0
virtual void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &incidence)=0
virtual void virtual_hook(int id, void *data)=0
Standard trick to add virtuals later.
virtual bool insertedIncidences(KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString ¬ebookUid=QString())=0
Get inserted incidences from storage.
virtual bool deletedIncidences(KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString ¬ebookUid=QString())=0
Get deleted incidences from storage.
virtual bool insertNotebook(const Notebook::Ptr &nb)=0
The ExtendedStorageObserver class.
Definition extendedstorageobserver.h:47
QSharedPointer< Notebook > Ptr
A shared pointer to a Notebook object.
Definition notebook.h:51
QList< Ptr > List
List of notebooks.
Definition notebook.h:61
This file is part of the API for handling calendar data and defines the ExtendedCalendar class.
This file is part of the API for handling calendar data and defines the ExtendedStorageObserver to be...
#define MKCAL_EXPORT
Definition mkcal_export.h:29
Definition extendedstorage.h:42
Definition extendedstorage.h:49
This file is part of the API for handling calendar data and defines the Notebook class.