31#ifndef MKCAL_EXTENDEDSTORAGE_H
32#define MKCAL_EXTENDEDSTORAGE_H
39#include <KCalendarCore/CalStorage>
40#include <KCalendarCore/Calendar>
71 :
public KCalendarCore::CalStorage,
public KCalendarCore::Calendar::CalendarObserver
88 typedef QSharedPointer<ExtendedStorage>
Ptr;
105 explicit ExtendedStorage(
const ExtendedCalendar::Ptr &cal,
bool validateNotebooks =
true);
131 virtual bool load(
const QString &uid,
const QDateTime &recurrenceId = QDateTime()) = 0;
146 virtual bool load(
const QDate &date) = 0;
157 virtual bool load(
const QDate &start,
const QDate &end) = 0;
221 float diffLatitude,
float diffLongitude) = 0;
306 int limit, QDateTime *last) = 0;
353 virtual bool notifyOpened(
const KCalendarCore::Incidence::Ptr &incidence) = 0;
366 virtual bool close();
392 virtual void calendarIncidenceDeleted(
const KCalendarCore::Incidence::Ptr &incidence,
const KCalendarCore::Calendar *calendar) = 0;
415 const QDateTime &after = QDateTime(),
416 const QString ¬ebookUid = QString()) = 0;
429 const QDateTime &after = QDateTime(),
430 const QString ¬ebookUid = QString()) = 0;
441 const QDateTime &after = QDateTime(),
442 const QString ¬ebookUid = QString()) = 0;
452 const QString ¬ebookUid = QString()) = 0;
463 const KCalendarCore::Incidence::Ptr &incidence,
464 const QString ¬ebookUid = QString()) = 0;
596 void setValidateNotebooks(
bool validateNotebooks);
605 bool validateNotebooks();
614 bool isValidNotebook(
const QString ¬ebookUid);
628 KCalendarCore::Incidence::Ptr checkAlarm(
const QString &uid,
const QString &recurrenceId,
629 bool loadAlways =
false);
639 Notebook::Ptr createDefaultNotebook(QString name = QString(),
640 QString color = QString());
655 bool getLoadDates(
const QDate &start,
const QDate &end,
656 QDateTime *loadStart, QDateTime *loadEnd)
const;
658 void addLoadedRange(
const QDate &start,
const QDate &end)
const;
659 bool isRecurrenceLoaded()
const;
660 void setIsRecurrenceLoaded(
bool loaded);
662 void setModified(
const QString &info);
663 void setFinished(
bool error,
const QString &info);
664 void setUpdated(
const KCalendarCore::Incidence::List &added,
665 const KCalendarCore::Incidence::List &modified,
666 const KCalendarCore::Incidence::List &deleted);
668 bool isUncompletedTodosLoaded();
669 void setIsUncompletedTodosLoaded(
bool loaded);
671 bool isCompletedTodosDateLoaded();
672 void setIsCompletedTodosDateLoaded(
bool loaded);
673 bool isCompletedTodosCreatedLoaded();
674 void setIsCompletedTodosCreatedLoaded(
bool loaded);
676 bool isJournalsLoaded();
677 void setIsJournalsLoaded(
bool loaded);
680 void setIsDateLoaded(
bool loaded);
681 bool isCreatedLoaded();
682 void setIsCreatedLoaded(
bool loaded);
683 bool isFutureDateLoaded();
684 void setIsFutureDateLoaded(
bool loaded);
686 bool isGeoDateLoaded();
687 void setIsGeoDateLoaded(
bool loaded);
688 bool isGeoCreatedLoaded();
689 void setIsGeoCreatedLoaded(
bool loaded);
700 friend class ::MkcalTool;
701 friend class ::tst_load;
This class provides a calendar storage interface.
Definition: extendedstorage.h:72
QSharedPointer< ExtendedStorage > Ptr
A shared pointer to a ExtendedStorage.
Definition: extendedstorage.h:88
virtual bool loadJournals()=0
Load journal type entries.
virtual int loadGeoIncidences(bool hasDate, int limit, QDateTime *last)=0
Load incidences that have location information based on parameters.
virtual int loadJournals(int limit, QDateTime *last)=0
Load journal entries based on parameters.
virtual bool duplicateIncidences(KCalendarCore::Incidence::List *list, const KCalendarCore::Incidence::Ptr &incidence, const QString ¬ebookUid=QString())=0
Get possible duplicates for given incidence.
virtual bool loadNotebookIncidences(const QString ¬ebookUid)=0
Load incidences of one notebook into the memory.
virtual int loadCompletedTodos(bool hasDate, int limit, QDateTime *last)=0
Load completed todos based on parameters.
virtual void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar)=0
virtual bool loadIncidenceInstance(const QString &instanceIdentifier)=0
Load the incidence matching the given identifier.
virtual bool load(const QDate &start, const QDate &end)=0
Load incidences between given dates into the memory.
virtual int journalCount()=0
Get count of journals.
virtual bool load(const QDate &date)=0
Load incidences at given date into the memory.
virtual bool loadRecurringIncidences()=0
Load recurring incidences.
virtual int loadIncidences(bool hasDate, int limit, QDateTime *last)=0
Load incidences based on start/due date or creation date.
virtual int loadContactIncidences(const KCalendarCore::Person &person, int limit, QDateTime *last)=0
Load all incidences that have the specified attendee.
Notebook::Ptr notebook(Notebook::List &list, const QString &uid)
Search for notebook in a list.
virtual bool load(const QString &uid, const QDateTime &recurrenceId=QDateTime())=0
Load incidence by uid into the memory.
virtual bool cancel()=0
Cancel any ongoing action (load etc.).
virtual bool loadGeoIncidences()=0
Load incidences that have geo parameters.
virtual QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &incidence)=0
Get deletion time of incidence.
virtual int todoCount()=0
Get count of todos.
virtual bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &list)=0
Remove from storage all incidences that have been previously marked as deleted and that matches the U...
virtual void calendarModified(bool modified, KCalendarCore::Calendar *calendar)=0
virtual int eventCount()=0
Get count of events.
virtual bool save(DeleteAction deleteAction)=0
This is an overload of save() method.
virtual bool modifyNotebook(const Notebook::Ptr &nb, DBOperation dbop)=0
virtual bool loadNotebooks()=0
virtual bool loadAttendeeIncidences()=0
Load incidences that have attendee.
DeleteAction
Action to be performed on save for deleted incidences.
Definition: extendedstorage.h:80
@ MarkDeleted
Definition: extendedstorage.h:81
virtual KCalendarCore::Person::List loadContacts()=0
Load all contacts in the database.
virtual bool allIncidences(KCalendarCore::Incidence::List *list, const QString ¬ebookUid=QString())=0
Get all incidences from storage.
virtual bool loadSeries(const QString &uid)=0
Load all incidences sharing the same uid into the memory.
virtual bool modifiedIncidences(KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString ¬ebookUid=QString())=0
Get modified incidences from storage.
virtual bool loadGeoIncidences(float geoLatitude, float geoLongitude, float diffLatitude, float diffLongitude)=0
Load incidences that have geo parameters inside given rectangle.
virtual bool loadPlainIncidences()=0
Load plain incidences (no startdate and no enddate).
virtual void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &incidence)=0
virtual bool notifyOpened(const KCalendarCore::Incidence::Ptr &incidence)=0
Mark if supported by the storage that an incidence has been opened.
virtual void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &incidence)=0
virtual int loadUncompletedTodos()=0
Load all uncompleted todos.
virtual int loadFutureIncidences(int limit, QDateTime *last)=0
Load future incidences based on start/due date.
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.
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:27
#define MKCAL_HIDE
Definition: mkcal_export.h:31
Definition: extendedstorage.h:42
Definition: extendedstorage.h:49
DBOperation
Database operation type.
Definition: extendedstorage.h:54
@ DBUpdate
Definition: extendedstorage.h:57
@ DBSelect
Definition: extendedstorage.h:60
@ DBMarkDeleted
Definition: extendedstorage.h:58
@ DBNone
Definition: extendedstorage.h:55
@ DBInsert
Definition: extendedstorage.h:56
@ DBDelete
Definition: extendedstorage.h:59
This file is part of the API for handling calendar data and defines the Notebook class.