This module provides a simple storage abstraction which contains exactly nothing. More...
#include <dummystorage.h>
Public Member Functions | |
DummyStorage (const mKCal::ExtendedCalendar::Ptr &cal) | |
void | calendarModified (bool, KCalendarCore::Calendar *) |
void | calendarIncidenceAdded (const KCalendarCore::Incidence::Ptr &) |
void | calendarIncidenceChanged (const KCalendarCore::Incidence::Ptr &) |
void | calendarIncidenceDeleted (const KCalendarCore::Incidence::Ptr &, const KCalendarCore::Calendar *) |
void | calendarIncidenceAdditionCanceled (const KCalendarCore::Incidence::Ptr &) |
bool | purgeDeletedIncidences (const KCalendarCore::Incidence::List &) |
Remove from storage all incidences that have been previously marked as deleted and that matches the UID / RecID of the incidences in list. | |
bool | open () |
bool | load () |
bool | save () |
bool | save (DeleteAction) |
This is an overload of save() method. | |
bool | close () |
bool | load (const QString &, const QDateTime &) |
Load incidence by uid into the memory. | |
bool | load (const QDate &) |
Load incidences at given date into the memory. | |
bool | load (const QDate &, const QDate &) |
Load incidences between given dates into the memory. | |
bool | loadSeries (const QString &) |
Load all incidences sharing the same uid into the memory. | |
bool | loadIncidenceInstance (const QString &) |
Load the incidence matching the given identifier. | |
bool | loadNotebookIncidences (const QString &) |
Load incidences of one notebook into the memory. | |
bool | loadJournals () |
Load journal type entries. | |
bool | loadPlainIncidences () |
Load plain incidences (no startdate and no enddate). | |
bool | loadRecurringIncidences () |
Load recurring incidences. | |
bool | loadGeoIncidences () |
Load incidences that have geo parameters. | |
bool | loadGeoIncidences (float, float, float, float) |
Load incidences that have geo parameters inside given rectangle. | |
bool | loadAttendeeIncidences () |
Load incidences that have attendee. | |
int | loadUncompletedTodos () |
Load all uncompleted todos. | |
int | loadCompletedTodos (bool, int, QDateTime *) |
Load completed todos based on parameters. | |
int | loadIncidences (bool, int, QDateTime *) |
Load incidences based on start/due date or creation date. | |
int | loadFutureIncidences (int, QDateTime *) |
Load future incidences based on start/due date. | |
int | loadGeoIncidences (bool, int, QDateTime *) |
Load incidences that have location information based on parameters. | |
int | loadUnreadInvitationIncidences () |
int | loadOldInvitationIncidences (int, QDateTime *) |
KCalendarCore::Person::List | loadContacts () |
Load all contacts in the database. | |
int | loadContactIncidences (const KCalendarCore::Person &, int, QDateTime *) |
Load all incidences that have the specified attendee. | |
int | loadJournals (int, QDateTime *) |
Load journal entries based on parameters. | |
bool | notifyOpened (const KCalendarCore::Incidence::Ptr &) |
Mark if supported by the storage that an incidence has been opened. | |
bool | cancel () |
Cancel any ongoing action (load etc.). | |
void | calendarModified (bool, const KCalendarCore::Calendar *) const |
void | calendarIncidenceAdded (const KCalendarCore::Incidence::Ptr &) const |
void | calendarIncidenceChanged (const KCalendarCore::Incidence::Ptr &) const |
void | calendarIncidenceDeleted (const KCalendarCore::Incidence::Ptr &) const |
void | calendarIncidenceAdditionCanceled (const KCalendarCore::Incidence::Ptr &) const |
bool | insertedIncidences (KCalendarCore::Incidence::List *, const QDateTime &, const QString &) |
Get inserted incidences from storage. | |
bool | modifiedIncidences (KCalendarCore::Incidence::List *, const QDateTime &, const QString &) |
Get modified incidences from storage. | |
bool | deletedIncidences (KCalendarCore::Incidence::List *, const QDateTime &, const QString &) |
Get deleted incidences from storage. | |
bool | allIncidences (KCalendarCore::Incidence::List *, const QString &) |
Get all incidences from storage. | |
bool | duplicateIncidences (KCalendarCore::Incidence::List *, const KCalendarCore::Incidence::Ptr &, const QString &) |
Get possible duplicates for given incidence. | |
bool | loadNotebooks () |
bool | modifyNotebook (const mKCal::Notebook::Ptr &, mKCal::DBOperation) |
QDateTime | incidenceDeletedDate (const KCalendarCore::Incidence::Ptr &) |
Get deletion time of incidence. | |
int | eventCount () |
Get count of events. | |
int | todoCount () |
Get count of todos. | |
int | journalCount () |
Get count of journals. | |
void | virtual_hook (int, void *) |
Standard trick to add virtuals later. | |
![]() | |
ExtendedStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true) | |
Constructs a new ExtendedStorage object. | |
virtual | ~ExtendedStorage () |
Destructor. | |
void | registerObserver (ExtendedStorageObserver *observer) |
Registers an Observer for this Storage. | |
void | unregisterObserver (ExtendedStorageObserver *observer) |
Unregisters an Observer for this Storage. | |
bool | addNotebook (const Notebook::Ptr &nb) |
Add new notebook to the storage. | |
bool | updateNotebook (const Notebook::Ptr &nb) |
Update notebook parameters. | |
bool | deleteNotebook (const Notebook::Ptr &nb) |
Delete notebook from storage. | |
bool | setDefaultNotebook (const Notebook::Ptr &nb) |
setDefaultNotebook to the storage. | |
Notebook::Ptr | defaultNotebook () |
defaultNotebook. | |
Notebook::Ptr | notebook (const QString &uid) |
Search for notebook. | |
Notebook::Ptr | notebook (Notebook::List &list, const QString &uid) |
Search for notebook in a list. | |
Notebook::List | notebooks () |
List all notebooks. | |
void | setValidateNotebooks (bool validateNotebooks) |
Determine if notebooks should be validated in saves and loads. | |
bool | validateNotebooks () |
Returns true if notebooks should be validated in saves and loads. | |
bool | isValidNotebook (const QString ¬ebookUid) |
Returns true if the given notebook is valid for the storage. | |
KCalendarCore::Incidence::Ptr | checkAlarm (const QString &uid, const QString &recurrenceId, bool loadAlways=false) |
Checking if an incidence has active alarms. | |
Notebook::Ptr | createDefaultNotebook (QString name=QString(), QString color=QString()) |
Creates and sets a default notebook. | |
Additional Inherited Members | |
![]() | |
enum | DeleteAction { MarkDeleted , PurgeDeleted } |
Action to be performed on save for deleted incidences. More... | |
typedef QSharedPointer< ExtendedStorage > | Ptr |
A shared pointer to a ExtendedStorage. | |
![]() | |
bool | getLoadDates (const QDate &start, const QDate &end, QDateTime *loadStart, QDateTime *loadEnd) const |
void | addLoadedRange (const QDate &start, const QDate &end) const |
bool | isRecurrenceLoaded () const |
void | setIsRecurrenceLoaded (bool loaded) |
void | setModified (const QString &info) |
void | setFinished (bool error, const QString &info) |
void | setUpdated (const KCalendarCore::Incidence::List &added, const KCalendarCore::Incidence::List &modified, const KCalendarCore::Incidence::List &deleted) |
bool | isUncompletedTodosLoaded () |
void | setIsUncompletedTodosLoaded (bool loaded) |
bool | isCompletedTodosDateLoaded () |
void | setIsCompletedTodosDateLoaded (bool loaded) |
bool | isCompletedTodosCreatedLoaded () |
void | setIsCompletedTodosCreatedLoaded (bool loaded) |
bool | isJournalsLoaded () |
void | setIsJournalsLoaded (bool loaded) |
bool | isDateLoaded () |
void | setIsDateLoaded (bool loaded) |
bool | isCreatedLoaded () |
void | setIsCreatedLoaded (bool loaded) |
bool | isFutureDateLoaded () |
void | setIsFutureDateLoaded (bool loaded) |
bool | isGeoDateLoaded () |
void | setIsGeoDateLoaded (bool loaded) |
bool | isGeoCreatedLoaded () |
void | setIsGeoCreatedLoaded (bool loaded) |
void | clearLoaded () |
This module provides a simple storage abstraction which contains exactly nothing.
It is only inteded to use for testing purposes
|
inline |
|
inlinevirtual |
Get all incidences from storage.
list | notebook's incidences |
notebookUid | list incidences for given notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceAdded()
Implements mKCal::ExtendedStorage.
|
inline |
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceAdditionCanceled()
Implements mKCal::ExtendedStorage.
|
inline |
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceChanged()
Implements mKCal::ExtendedStorage.
|
inline |
|
inline |
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceDeleted()
Implements mKCal::ExtendedStorage.
|
inline |
|
inlinevirtual |
Calendar::CalendarObserver::calendarModified()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Cancel any ongoing action (load etc.).
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
CalStorage::close()
Reimplemented from mKCal::ExtendedStorage.
|
inlinevirtual |
Get deleted incidences from storage.
list | deleted incidences |
after | list only incidences deleted after or at given datetime |
notebookUid | list only incidences for given notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Get possible duplicates for given incidence.
list | duplicate incidences |
incidence | incidence to check |
notebookUid | list incidences for given notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
|
inlinevirtual |
Get deletion time of incidence.
incidence | incidence to check |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Get inserted incidences from storage.
NOTE: time stamps assigned by KCalExtended are created during save(). To obtain a time stamp that is guaranteed to not included recent changes, sleep for a second or increment the current time by a second.
list | inserted incidences |
after | list only incidences inserted after or at given datetime |
notebookUid | list only incidences for given notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
|
inlinevirtual |
ExtendedStorage::load()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences at given date into the memory.
All incidences that happens within date, or starts / ends within date or span during date are loaded into memory. The time zone used to expand date into points in time is the time zone of the associated calendar. In addition, all recurring events are also loaded into memory since there is no way to know in advance if they will have occurrences intersecting date. Internally, recurring incidences and incidences of date are cached to avoid loading them several times.
date | date |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences between given dates into the memory.
start is inclusive, while end is exclusive. The same definitions and restrictions for loading apply as for load(const QDate &) method.
start | is the starting date |
end | is the ending date, exclusive |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidence by uid into the memory.
uid | is uid of incidence |
recurrenceid | is recurrenceid of incidence, default null |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences that have attendee.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load completed todos based on parameters.
Load direction is descending, i.e., starting from most distant upcoming todo.
hasDate | set true to load todos that have due date |
limit | load only that many todos |
last | last loaded todo due/creation date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load all incidences that have the specified attendee.
Also includes all shared notes (in a shared notebook).
person | person in question |
limit | load only that many incidences |
last | last loaded incidence due/creation date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load all contacts in the database.
Doesn't put anything into calendar. Resulting list of persons is ordered by the number of appearances. Use Person::count to get the number of appearances.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load future incidences based on start/due date.
Load direction is ascending, i.e., starting from the oldest event that is still valid at the day of the loadIncidences call. (=end time > 00:00:00 on that day).
limit | load only that many incidences |
last | last loaded incidence start date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences that have geo parameters.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences that have location information based on parameters.
Load direction is descending, i.e., starting from most distant upcoming incidence.
hasDate | set true to load incidences that have start/due date |
limit | load only that many incidences |
last | last loaded incidence due/creation date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences that have geo parameters inside given rectangle.
geoLatitude | latitude |
geoLongitude | longitude |
diffLatitude | maximum latitudinal difference |
diffLongitude | maximum longitudinal difference |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load the incidence matching the given identifier.
This method may be more fragile than load(uid, recid) though since the instanceIdentifier is not saved as is in the database.
instanceIdentifier | is an identifier returned by Incidence::instanceIdentifier() |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences based on start/due date or creation date.
Load direction is descending, i.e., starting from most distant upcoming incidence.
hasDate | set true to load incidences that have start/due date |
limit | load only that many incidences |
last | last loaded incidence due/creation date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load journal type entries.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load journal entries based on parameters.
Load direction is descending, i.e. starting from the most recently modified journal.
limit | load only that many incidences |
last | last loaded incidence due/creation date in return |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences of one notebook into the memory.
notebookUid | is uid of notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Implements mKCal::ExtendedStorage.
|
inline |
|
inlinevirtual |
Load plain incidences (no startdate and no enddate).
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load recurring incidences.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load all incidences sharing the same uid into the memory.
uid | is uid of the series |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load all uncompleted todos.
Implements mKCal::ExtendedStorage.
|
inline |
|
inlinevirtual |
Get modified incidences from storage.
NOTE: if an incidence is both created and modified after the given time, it will be returned in insertedIncidences only, not here!
list | modified incidences |
after | list only incidences modified after or at given datetime |
notebookUid | list only incidences for given notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Mark if supported by the storage that an incidence has been opened.
This should be called only if the Incidence has been opened by the user and displayed all the contents. Being in a list doesn't qualify for it.
incidence | The incidence that has been opened |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
ExtendedStorage::open()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Remove from storage all incidences that have been previously marked as deleted and that matches the UID / RecID of the incidences in list.
The action is performed immediately on database.
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
ExtendedStorage::save()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
This is an overload of save() method.
When @deleteAction is PurgeDeleted, the deleted incidences are not marked as deleted but completely removed from the database and won't appear anymore when calling deletedIncidences().
deleteAction | the action to apply to deleted incidences |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
|
inlinevirtual |
Standard trick to add virtuals later.
id | is any integer unique to this class which we will use to identify the method to be called. |
data | is a pointer to some glob of data, typically a struct. |
Implements mKCal::ExtendedStorage.