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 | open () |
bool | load () |
bool | save () |
bool | save (DeleteAction) |
This is an overload of save() method. | |
bool | close () |
bool | load (const QString &) |
Load all incidences sharing the same uid into the memory. | |
bool | load (const QDate &, const QDate &) |
Load incidences between given dates into the memory. | |
bool | loadNotebookIncidences (const QString &) |
Load incidences of one notebook into the memory. | |
bool | purgeDeletedIncidences (const KCalendarCore::Incidence::List &, const QString &) |
Remove from storage all incidences that have been previously marked as deleted and that matches the UID / RecID of the incidences in list. | |
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 | search (const QString &, QStringList *, int) |
Get all incidences from storage that match key. | |
bool | loadNotebooks () |
bool | insertNotebook (const mKCal::Notebook::Ptr &) |
bool | modifyNotebook (const mKCal::Notebook::Ptr &) |
bool | eraseNotebook (const mKCal::Notebook::Ptr &) |
QDateTime | incidenceDeletedDate (const KCalendarCore::Incidence::Ptr &) |
Get deletion time of incidence. | |
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. | |
bool | loadSeries (const QString &uid) |
Load all incidences sharing the same uid into the memory. | |
bool | load (const QString &uid, const QDateTime &recurrenceId) |
Load incidence by uid/recid into the memory. | |
virtual bool | load (const QDate &date) |
Load incidences at given date into the memory. | |
virtual bool | loadIncidenceInstance (const QString &instanceIdentifier) |
Load the incidence matching the given identifier. | |
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) const |
Search for notebook. | |
Notebook::List | notebooks () |
List all notebooks. | |
void | setValidateNotebooks (bool validateNotebooks) |
Determine if notebooks should be validated in saves and loads. | |
bool | validateNotebooks () const |
Returns true if notebooks should be validated in saves and loads. | |
bool | isValidNotebook (const QString ¬ebookUid) const |
Returns true if the given notebook is valid for the storage. | |
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 | emitStorageModified (const QString &info) |
void | emitStorageFinished (bool error, const QString &info) |
void | emitStorageUpdated (const KCalendarCore::Incidence::List &added, const KCalendarCore::Incidence::List &modified, const KCalendarCore::Incidence::List &deleted) |
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.
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceAdditionCanceled()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceChanged()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Calendar::CalendarObserver::calendarIncidenceDeleted()
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Calendar::CalendarObserver::calendarModified()
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 |
Implements mKCal::ExtendedStorage.
|
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 |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
CalStorage::load()
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 all incidences sharing the same uid into the memory.
uid | is uid of the series |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Load incidences of one notebook into the memory.
notebookUid | is uid of notebook |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
Implements mKCal::ExtendedStorage.
|
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 |
CalStorage::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.
list | is the incidences to remove from the DB |
notebook | is the notebook they belong to, using an empty notebook uid is deprecated, but kept for backward backward compatibility. |
Implements mKCal::ExtendedStorage.
|
inlinevirtual |
CalStorage::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 |
Get all incidences from storage that match key.
Incidences are loaded into the associated ExtendedCalendar. More incidences than the listed ones in
identifiers | may be loaded into memory to ensure calendar consistency with respect to exceptions of recurring incidences. |
Matching is done on summary, description and location fields.
The matching incidences are sorted by start dates before applying the
limit. | Since recurring incidences have occurrences later than their start date, they are not taken into account when counting the limit and all matching recurring events are always loaded. |
key | can be any substring from the summary, the description or the location. |
identifiers | optional, stores the instance identifiers of matching incidences. |
limit | the maximum number of non-recurring incidences, unlimited by default |
Implements mKCal::ExtendedStorage.
|
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.