31 #ifndef MKCAL_EXTENDEDSTORAGE_H
32 #define MKCAL_EXTENDEDSTORAGE_H
38 #include <calstorage.h>
41 #include <kdatetime.h>
77 :
public KCalCore::CalStorage,
public KCalCore::Calendar::CalendarObserver
94 typedef QSharedPointer<ExtendedStorage>
Ptr;
111 explicit ExtendedStorage(
const ExtendedCalendar::Ptr &cal,
bool validateNotebooks =
false);
122 virtual bool open() = 0;
128 virtual bool load() = 0;
137 virtual bool load(
const QString &uid,
const KDateTime &recurrenceId = KDateTime()) = 0;
145 virtual bool load(
const QDate &date) = 0;
154 virtual bool load(
const QDate &start,
const QDate &end) = 0;
162 virtual bool loadSeries(
const QString &uid) = 0;
170 virtual bool loadNotebookIncidences(
const QString ¬ebookUid) = 0;
175 virtual bool loadJournals() = 0;
182 virtual bool loadPlainIncidences() = 0;
189 virtual bool loadRecurringIncidences() = 0;
196 virtual bool loadGeoIncidences() = 0;
207 virtual bool loadGeoIncidences(
float geoLatitude,
float geoLongitude,
208 float diffLatitude,
float diffLongitude) = 0;
215 virtual bool loadAttendeeIncidences() = 0;
224 virtual int loadUncompletedTodos() = 0;
235 virtual int loadCompletedTodos(
bool hasDate,
int limit, KDateTime *last) = 0;
247 virtual int loadIncidences(
bool hasDate,
int limit, KDateTime *last) = 0;
260 virtual int loadFutureIncidences(
int limit, KDateTime *last) = 0;
272 virtual int loadGeoIncidences(
bool hasDate,
int limit, KDateTime *last) = 0;
279 virtual int loadUnreadInvitationIncidences() = 0;
290 virtual int loadOldInvitationIncidences(
int limit, KDateTime *last) = 0;
299 virtual KCalCore::Person::List loadContacts() = 0;
310 virtual int loadContactIncidences(
const KCalCore::Person::Ptr &person,
311 int limit, KDateTime *last) = 0;
322 virtual int loadJournals(
int limit, KDateTime *last) = 0;
331 virtual bool purgeDeletedIncidences(
const KCalCore::Incidence::List &list) = 0;
337 virtual bool save() = 0;
358 virtual bool notifyOpened(
const KCalCore::Incidence::Ptr &incidence) = 0;
365 virtual bool cancel() = 0;
371 virtual bool close() = 0;
379 virtual void calendarModified(
bool modified, KCalCore::Calendar *calendar) = 0;
385 virtual void calendarIncidenceAdded(
const KCalCore::Incidence::Ptr &incidence) = 0;
391 virtual void calendarIncidenceChanged(
const KCalCore::Incidence::Ptr &incidence) = 0;
397 virtual void calendarIncidenceDeleted(
const KCalCore::Incidence::Ptr &incidence) = 0;
403 virtual void calendarIncidenceAdditionCanceled(
const KCalCore::Incidence::Ptr &incidence) = 0;
419 virtual bool insertedIncidences(KCalCore::Incidence::List *list,
420 const KDateTime &after = KDateTime(),
421 const QString ¬ebookUid = QString()) = 0;
433 virtual bool modifiedIncidences(KCalCore::Incidence::List *list,
434 const KDateTime &after = KDateTime(),
435 const QString ¬ebookUid = QString()) = 0;
445 virtual bool deletedIncidences(KCalCore::Incidence::List *list,
446 const KDateTime &after = KDateTime(),
447 const QString ¬ebookUid = QString()) = 0;
456 virtual bool allIncidences(KCalCore::Incidence::List *list,
457 const QString ¬ebookUid = QString()) = 0;
467 virtual bool duplicateIncidences(KCalCore::Incidence::List *list,
468 const KCalCore::Incidence::Ptr &incidence,
469 const QString ¬ebookUid = QString()) = 0;
477 virtual KDateTime incidenceDeletedDate(
const KCalCore::Incidence::Ptr &incidence) = 0;
484 virtual int eventCount() = 0;
491 virtual int todoCount() = 0;
498 virtual int journalCount() = 0;
536 bool addNotebook(
const Notebook::Ptr &nb,
bool signal =
true);
556 bool deleteNotebook(
const Notebook::Ptr &nb,
bool onlyMemory =
false);
604 void setValidateNotebooks(
bool validateNotebooks);
613 bool validateNotebooks();
622 bool isValidNotebook(
const QString ¬ebookUid);
636 KCalCore::Incidence::Ptr checkAlarm(
const QString &uid,
const QString &recurrenceId,
637 bool loadAlways =
false);
647 Notebook::Ptr createDefaultNotebook(QString name = QString(),
648 QString color = QString());
657 virtual void virtual_hook(
int id,
void *data) = 0;
660 virtual bool loadNotebooks() = 0;
661 virtual bool reloadNotebooks() = 0;
663 bool signal =
true) = 0;
665 bool getLoadDates(
const QDate &start,
const QDate &end,
666 KDateTime &loadStart, KDateTime &loadEnd);
668 void setLoadDates(
const QDate &start,
const QDate &end);
670 void setModified(
const QString &info);
671 void setProgress(
const QString &info);
672 void setFinished(
bool error,
const QString &info);
676 void clearAlarms(
const KCalCore::Incidence::Ptr &incidence);
677 void clearAlarms(
const KCalCore::Incidence::List &incidences);
678 void clearAlarms(
const QString &nname);
679 void setAlarms(
const KCalCore::Incidence::Ptr &incidence);
680 void setAlarms(
const KCalCore::Incidence::List &incidences);
681 void resetAlarms(
const KCalCore::Incidence::List &incidences);
682 void resetAlarms(
const KCalCore::Incidence::Ptr &incidence);
684 bool isUncompletedTodosLoaded();
685 void setIsUncompletedTodosLoaded(
bool loaded);
687 bool isCompletedTodosDateLoaded();
688 void setIsCompletedTodosDateLoaded(
bool loaded);
689 bool isCompletedTodosCreatedLoaded();
690 void setIsCompletedTodosCreatedLoaded(
bool loaded);
692 bool isJournalsLoaded();
693 void setIsJournalsLoaded(
bool loaded);
696 void setIsDateLoaded(
bool loaded);
697 bool isCreatedLoaded();
698 void setIsCreatedLoaded(
bool loaded);
699 bool isFutureDateLoaded();
700 void setIsFutureDateLoaded(
bool loaded);
702 bool isGeoDateLoaded();
703 void setIsGeoDateLoaded(
bool loaded);
704 bool isGeoCreatedLoaded();
705 void setIsGeoCreatedLoaded(
bool loaded);
707 bool isUnreadIncidencesLoaded();
708 void setIsUnreadIncidencesLoaded(
bool loaded);
710 bool isInvitationIncidencesLoaded();
711 void setIsInvitationIncidencesLoaded(
bool loaded);
722 friend class ::MkcalTool;