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, KCalCore::Calendar *) |
void | calendarIncidenceAdded (const KCalCore::Incidence::Ptr &) |
void | calendarIncidenceChanged (const KCalCore::Incidence::Ptr &) |
void | calendarIncidenceDeleted (const KCalCore::Incidence::Ptr &) |
void | calendarIncidenceAdditionCanceled (const KCalCore::Incidence::Ptr &) |
bool | open () |
bool | load () |
bool | save () |
bool | close () |
bool | load (const QString &, const KDateTime &) |
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 | 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, KDateTime *) |
Load completed todos based on parameters. | |
int | loadIncidences (bool, int, KDateTime *) |
Load incidences based on start/due date or creation date. | |
int | loadFutureIncidences (int, KDateTime *) |
Load future incidences based on start/due date. | |
int | loadGeoIncidences (bool, int, KDateTime *) |
Load incidences that have location information based on parameters. | |
int | loadUnreadInvitationIncidences () |
Load all unread incidences that are related to an invitation. | |
int | loadOldInvitationIncidences (int, KDateTime *) |
Load incidences that are related to an invitation. | |
KCalCore::Person::List | loadContacts () |
Load all contacts in the database. | |
int | loadContactIncidences (const KCalCore::Person::Ptr &, int, KDateTime *) |
Load all incidences that have the specified attendee. | |
int | loadJournals (int, KDateTime *) |
Load journal entries based on parameters. | |
bool | notifyOpened (const KCalCore::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 KCalCore::Calendar *) const |
void | calendarIncidenceAdded (const KCalCore::Incidence::Ptr &) const |
void | calendarIncidenceChanged (const KCalCore::Incidence::Ptr &) const |
void | calendarIncidenceDeleted (const KCalCore::Incidence::Ptr &) const |
void | calendarIncidenceAdditionCanceled (const KCalCore::Incidence::Ptr &) const |
bool | insertedIncidences (KCalCore::Incidence::List *, const KDateTime &, const QString &) |
Get inserted incidences from storage. | |
bool | modifiedIncidences (KCalCore::Incidence::List *, const KDateTime &, const QString &) |
Get modified incidences from storage. | |
bool | deletedIncidences (KCalCore::Incidence::List *, const KDateTime &, const QString &) |
Get deleted incidences from storage. | |
bool | deletedIncidencesCreatedAfter (KCalCore::Incidence::List *, const KDateTime &, const QString &) |
Get deleted incidences from storage, that are created and deleted after given datetime. | |
bool | allIncidences (KCalCore::Incidence::List *, const QString &) |
Get all incidences from storage. | |
bool | duplicateIncidences (KCalCore::Incidence::List *, const KCalCore::Incidence::Ptr &, const QString &) |
Get possible duplicates for given incidence. | |
bool | loadNotebooks () |
bool | reloadNotebooks () |
bool | modifyNotebook (const mKCal::Notebook::Ptr &, mKCal::DBOperation, bool) |
KDateTime | incidenceDeletedDate (const KCalCore::Incidence::Ptr &incidence) |
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. |
This module provides a simple storage abstraction which contains exactly nothing.
It is only inteded to use for testing pouposes
DummyStorage::DummyStorage | ( | const mKCal::ExtendedCalendar::Ptr & | cal | ) | [inline] |
bool DummyStorage::allIncidences | ( | KCalCore::Incidence::List * | list, | |
const QString & | notebookUid | |||
) | [inline, virtual] |
Get all incidences from storage.
list | notebook's incidences | |
notebookUid | list incidences for given notebook |
Implements mKCal::ExtendedStorage.
void DummyStorage::calendarIncidenceAdded | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
void DummyStorage::calendarIncidenceAdded | ( | const KCalCore::Incidence::Ptr & | ) | const [inline] |
void DummyStorage::calendarIncidenceAdditionCanceled | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
void DummyStorage::calendarIncidenceAdditionCanceled | ( | const KCalCore::Incidence::Ptr & | ) | const [inline] |
void DummyStorage::calendarIncidenceChanged | ( | const KCalCore::Incidence::Ptr & | ) | const [inline] |
void DummyStorage::calendarIncidenceChanged | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
void DummyStorage::calendarIncidenceDeleted | ( | const KCalCore::Incidence::Ptr & | ) | const [inline] |
void DummyStorage::calendarIncidenceDeleted | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
void DummyStorage::calendarModified | ( | bool | , | |
const KCalCore::Calendar * | ||||
) | const [inline] |
void DummyStorage::calendarModified | ( | bool | modified, | |
KCalCore::Calendar * | calendar | |||
) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::cancel | ( | ) | [inline, virtual] |
Cancel any ongoing action (load etc.
).
Implements mKCal::ExtendedStorage.
bool DummyStorage::close | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::deletedIncidences | ( | KCalCore::Incidence::List * | list, | |
const KDateTime & | after, | |||
const QString & | notebookUid | |||
) | [inline, virtual] |
Get deleted incidences from storage.
list | deleted incidences | |
after | list only incidences deleted after or at given datetime and created before given datetime | |
notebookUid | list only incidences for given notebook |
Implements mKCal::ExtendedStorage.
bool DummyStorage::deletedIncidencesCreatedAfter | ( | KCalCore::Incidence::List * | list, | |
const KDateTime & | after, | |||
const QString & | notebookUid | |||
) | [inline, virtual] |
Get deleted incidences from storage, that are created and deleted after given datetime.
list | deleted incidences | |
after | list only incidences deleted after or at given datetime | |
notebookUid | list only incidences for given notebook |
Implements mKCal::ExtendedStorage.
bool DummyStorage::duplicateIncidences | ( | KCalCore::Incidence::List * | list, | |
const KCalCore::Incidence::Ptr & | incidence, | |||
const QString & | notebookUid | |||
) | [inline, virtual] |
Get possible duplicates for given incidence.
list | duplicate incidences | |
incidence | incidence to check | |
notebookUid | list incidences for given notebook |
Implements mKCal::ExtendedStorage.
int DummyStorage::eventCount | ( | ) | [inline, virtual] |
KDateTime DummyStorage::incidenceDeletedDate | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
Get deletion time of incidence.
incidence | incidence to check |
Implements mKCal::ExtendedStorage.
bool DummyStorage::insertedIncidences | ( | KCalCore::Incidence::List * | list, | |
const KDateTime & | after, | |||
const QString & | notebookUid | |||
) | [inline, virtual] |
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.
int DummyStorage::journalCount | ( | ) | [inline, virtual] |
bool DummyStorage::load | ( | const QDate & | date | ) | [inline, virtual] |
Load incidences at given date into the memory.
date | date |
Implements mKCal::ExtendedStorage.
bool DummyStorage::load | ( | const QString & | uid, | |
const KDateTime & | recurrenceId | |||
) | [inline, virtual] |
Load incidence by uid into the memory.
uid | is uid of incidence | |
recurrenceid | is recurrenceid of incidence, default null |
Implements mKCal::ExtendedStorage.
bool DummyStorage::load | ( | const QDate & | start, | |
const QDate & | end | |||
) | [inline, virtual] |
Load incidences between given dates into the memory.
start | is the starting date | |
end | is the ending date |
Implements mKCal::ExtendedStorage.
bool DummyStorage::load | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::loadAttendeeIncidences | ( | ) | [inline, virtual] |
Load incidences that have attendee.
Implements mKCal::ExtendedStorage.
int DummyStorage::loadCompletedTodos | ( | bool | hasDate, | |
int | limit, | |||
KDateTime * | last | |||
) | [inline, virtual] |
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.
int DummyStorage::loadContactIncidences | ( | const KCalCore::Person::Ptr & | person, | |
int | limit, | |||
KDateTime * | last | |||
) | [inline, virtual] |
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.
KCalCore::Person::List DummyStorage::loadContacts | ( | ) | [inline, virtual] |
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.
int DummyStorage::loadFutureIncidences | ( | int | limit, | |
KDateTime * | last | |||
) | [inline, virtual] |
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.
bool DummyStorage::loadGeoIncidences | ( | ) | [inline, virtual] |
Load incidences that have geo parameters.
Implements mKCal::ExtendedStorage.
bool DummyStorage::loadGeoIncidences | ( | float | geoLatitude, | |
float | geoLongitude, | |||
float | diffLatitude, | |||
float | diffLongitude | |||
) | [inline, virtual] |
Load incidences that have geo parameters inside given rectangle.
geoLatitude | latitude | |
geoLongitude | longitude | |
diffLatitude | maximum latitudinal difference | |
diffLongitude | maximum longitudinal difference |
Implements mKCal::ExtendedStorage.
int DummyStorage::loadGeoIncidences | ( | bool | hasDate, | |
int | limit, | |||
KDateTime * | last | |||
) | [inline, virtual] |
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.
int DummyStorage::loadIncidences | ( | bool | hasDate, | |
int | limit, | |||
KDateTime * | last | |||
) | [inline, virtual] |
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.
bool DummyStorage::loadJournals | ( | ) | [inline, virtual] |
Load journal type entries.
Implements mKCal::ExtendedStorage.
int DummyStorage::loadJournals | ( | int | limit, | |
KDateTime * | last | |||
) | [inline, virtual] |
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.
bool DummyStorage::loadNotebookIncidences | ( | const QString & | notebookUid | ) | [inline, virtual] |
Load incidences of one notebook into the memory.
notebookUid | is uid of notebook |
Implements mKCal::ExtendedStorage.
bool DummyStorage::loadNotebooks | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
int DummyStorage::loadOldInvitationIncidences | ( | int | limit, | |
KDateTime * | last | |||
) | [inline, virtual] |
Load incidences that are related to an invitation.
Load direction is descending, i.e., starting from most distant upcoming incidence.
limit | load only that many incidences | |
last | last loaded incidence due/creation date in return |
Implements mKCal::ExtendedStorage.
bool DummyStorage::loadPlainIncidences | ( | ) | [inline, virtual] |
Load plain incidences (no startdate and no enddate).
Implements mKCal::ExtendedStorage.
bool DummyStorage::loadRecurringIncidences | ( | ) | [inline, virtual] |
Load recurring incidences.
Implements mKCal::ExtendedStorage.
int DummyStorage::loadUncompletedTodos | ( | ) | [inline, virtual] |
Load all uncompleted todos.
Implements mKCal::ExtendedStorage.
int DummyStorage::loadUnreadInvitationIncidences | ( | ) | [inline, virtual] |
Load all unread incidences that are related to an invitation.
Implements mKCal::ExtendedStorage.
bool DummyStorage::modifiedIncidences | ( | KCalCore::Incidence::List * | list, | |
const KDateTime & | after, | |||
const QString & | notebookUid | |||
) | [inline, virtual] |
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.
bool DummyStorage::modifyNotebook | ( | const mKCal::Notebook::Ptr & | , | |
mKCal::DBOperation | , | |||
bool | ||||
) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::notifyOpened | ( | const KCalCore::Incidence::Ptr & | incidence | ) | [inline, virtual] |
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.
bool DummyStorage::open | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::reloadNotebooks | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
bool DummyStorage::save | ( | ) | [inline, virtual] |
Implements mKCal::ExtendedStorage.
int DummyStorage::todoCount | ( | ) | [inline, virtual] |
void DummyStorage::virtual_hook | ( | int | id, | |
void * | data | |||
) | [inline, virtual] |
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.