31 #ifndef MKCAL_EXTENDEDSTORAGE_H
32 #define MKCAL_EXTENDEDSTORAGE_H
38 #include <KCalendarCore/CalStorage>
39 #include <KCalendarCore/Calendar>
75 :
public KCalendarCore::CalStorage,
public KCalendarCore::Calendar::CalendarObserver
92 typedef QSharedPointer<ExtendedStorage>
Ptr;
109 explicit ExtendedStorage(
const ExtendedCalendar::Ptr &cal,
bool validateNotebooks =
true);
135 virtual bool load(
const QString &uid,
const QDateTime &recurrenceId = QDateTime()) = 0;
143 virtual bool load(
const QDate &date) = 0;
152 virtual bool load(
const QDate &start,
const QDate &end) = 0;
216 float diffLatitude,
float diffLongitude) = 0;
319 int limit, QDateTime *last) = 0;
366 virtual bool notifyOpened(
const KCalendarCore::Incidence::Ptr &incidence) = 0;
405 virtual void calendarIncidenceDeleted(
const KCalendarCore::Incidence::Ptr &incidence,
const KCalendarCore::Calendar *calendar) = 0;
428 const QDateTime &after = QDateTime(),
429 const QString ¬ebookUid = QString()) = 0;
442 const QDateTime &after = QDateTime(),
443 const QString ¬ebookUid = QString()) = 0;
454 const QDateTime &after = QDateTime(),
455 const QString ¬ebookUid = QString()) = 0;
465 const QString ¬ebookUid = QString()) = 0;
476 const KCalendarCore::Incidence::Ptr &incidence,
477 const QString ¬ebookUid = QString()) = 0;
544 bool addNotebook(
const Notebook::Ptr &nb,
bool signal =
true);
564 bool deleteNotebook(
const Notebook::Ptr &nb,
bool onlyMemory =
false);
612 void setValidateNotebooks(
bool validateNotebooks);
621 bool validateNotebooks();
630 bool isValidNotebook(
const QString ¬ebookUid);
644 KCalendarCore::Incidence::Ptr checkAlarm(
const QString &uid,
const QString &recurrenceId,
645 bool loadAlways =
false);
655 Notebook::Ptr createDefaultNotebook(QString name = QString(),
656 QString color = QString());
671 bool signal =
true) = 0;
673 bool getLoadDates(
const QDate &start,
const QDate &end,
674 QDateTime &loadStart, QDateTime &loadEnd);
676 void setLoadDates(
const QDate &start,
const QDate &end);
678 void setModified(
const QString &info);
679 void setProgress(
const QString &info);
680 void setFinished(
bool error,
const QString &info);
685 void clearAlarms(
const KCalendarCore::Incidence::List &incidences);
686 void clearAlarms(
const QString &nname);
687 void setAlarms(
const KCalendarCore::Incidence::Ptr &incidence);
688 void setAlarms(
const KCalendarCore::Incidence::List &incidences);
689 void resetAlarms(
const KCalendarCore::Incidence::List &incidences);
692 bool isUncompletedTodosLoaded();
693 void setIsUncompletedTodosLoaded(
bool loaded);
695 bool isCompletedTodosDateLoaded();
696 void setIsCompletedTodosDateLoaded(
bool loaded);
697 bool isCompletedTodosCreatedLoaded();
698 void setIsCompletedTodosCreatedLoaded(
bool loaded);
700 bool isJournalsLoaded();
701 void setIsJournalsLoaded(
bool loaded);
704 void setIsDateLoaded(
bool loaded);
705 bool isCreatedLoaded();
706 void setIsCreatedLoaded(
bool loaded);
707 bool isFutureDateLoaded();
708 void setIsFutureDateLoaded(
bool loaded);
710 bool isGeoDateLoaded();
711 void setIsGeoDateLoaded(
bool loaded);
712 bool isGeoCreatedLoaded();
713 void setIsGeoCreatedLoaded(
bool loaded);
715 bool isUnreadIncidencesLoaded();
716 void setIsUnreadIncidencesLoaded(
bool loaded);
718 bool isInvitationIncidencesLoaded();
719 void setIsInvitationIncidencesLoaded(
bool loaded);
730 friend class ::MkcalTool;
This class provides a calendar storage interface.
Definition: extendedstorage.h:76
void setAlarms(const KCalendarCore::Incidence::List &incidences)
QSharedPointer< ExtendedStorage > Ptr
A shared pointer to a ExtendedStorage.
Definition: extendedstorage.h:92
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 int loadOldInvitationIncidences(int limit, QDateTime *last)=0
Load incidences that are related to an invitation.
void resetAlarms(const KCalendarCore::Incidence::List &incidences)
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 modifyNotebook(const Notebook::Ptr &nb, DBOperation dbop, bool signal=true)=0
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 int loadUnreadInvitationIncidences()=0
Load all unread incidences that are related to an invitation.
virtual bool save(DeleteAction deleteAction)=0
This is an overload of save() method.
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:84
@ MarkDeleted
Definition: extendedstorage.h:85
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.
void resetAlarms(const KCalendarCore::Incidence::Ptr &incidence)
virtual bool reloadNotebooks()=0
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
void clearAlarms(const KCalendarCore::Incidence::Ptr &incidence)
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.
void setAlarms(const KCalendarCore::Incidence::Ptr &incidence)
The ExtendedStorageObserver class.
Definition: extendedstorageobserver.h:46
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.
#define MKCAL_EXPORT
Definition: mkcal_export.h:27
#define MKCAL_HIDE
Definition: mkcal_export.h:31
Definition: extendedstorage.h:41
Definition: extendedstorage.h:47
DBOperation
Database operation type.
Definition: extendedstorage.h:52
@ DBUpdate
Definition: extendedstorage.h:55
@ DBSelect
Definition: extendedstorage.h:58
@ DBMarkDeleted
Definition: extendedstorage.h:56
@ DBNone
Definition: extendedstorage.h:53
@ DBInsert
Definition: extendedstorage.h:54
@ DBDelete
Definition: extendedstorage.h:57
const char *const DBusPath
Definition: extendedstorage.h:64
const char *const DBusService
Definition: extendedstorage.h:62
const char *const DBusInterface
Definition: extendedstorage.h:63
const char *const DBusName
Definition: extendedstorage.h:65
This file is part of the API for handling calendar data and defines the Notebook class.