Public Member Functions

DummyStorage Class Reference

This module provides a simple storage abstraction which contains exactly nothing. More...

#include <dummystorage.h>

Inheritance diagram for DummyStorage:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

This module provides a simple storage abstraction which contains exactly nothing.

It is only inteded to use for testing pouposes


Constructor & Destructor Documentation

DummyStorage::DummyStorage ( const mKCal::ExtendedCalendar::Ptr &  cal  )  [inline]

Member Function Documentation

bool DummyStorage::allIncidences ( KCalCore::Incidence::List *  list,
const QString &  notebookUid 
) [inline, virtual]

Get all incidences from storage.

Parameters:
list notebook's incidences
notebookUid list incidences for given notebook
Returns:
true if execution was scheduled; false otherwise

Implements mKCal::ExtendedStorage.

void DummyStorage::calendarIncidenceAdded ( const KCalCore::Incidence::Ptr &  incidence  )  [inline, virtual]
void DummyStorage::calendarIncidenceAdded ( const KCalCore::Incidence::Ptr &   )  const [inline]
void DummyStorage::calendarIncidenceAdditionCanceled ( const KCalCore::Incidence::Ptr &  incidence  )  [inline, virtual]
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]
void DummyStorage::calendarIncidenceDeleted ( const KCalCore::Incidence::Ptr &   )  const [inline]
void DummyStorage::calendarIncidenceDeleted ( const KCalCore::Incidence::Ptr &  incidence  )  [inline, virtual]
void DummyStorage::calendarModified ( bool  ,
const KCalCore::Calendar *   
) const [inline]
void DummyStorage::calendarModified ( bool  modified,
KCalCore::Calendar *  calendar 
) [inline, virtual]
bool DummyStorage::cancel (  )  [inline, virtual]

Cancel any ongoing action (load etc.

).

Returns:
true cancel was successful; false otherwise

Implements mKCal::ExtendedStorage.

bool DummyStorage::close (  )  [inline, virtual]
bool DummyStorage::deletedIncidences ( KCalCore::Incidence::List *  list,
const KDateTime &  after,
const QString &  notebookUid 
) [inline, virtual]

Get deleted incidences from storage.

Parameters:
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
Returns:
true if execution was scheduled; false otherwise

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.

Parameters:
list deleted incidences
after list only incidences deleted after or at given datetime
notebookUid list only incidences for given notebook
Returns:
true if execution was scheduled; false otherwise

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.

Parameters:
list duplicate incidences
incidence incidence to check
notebookUid list incidences for given notebook
Returns:
true if execution was scheduled; false otherwise

Implements mKCal::ExtendedStorage.

int DummyStorage::eventCount (  )  [inline, virtual]

Get count of events.

Returns:
count of events

Implements mKCal::ExtendedStorage.

KDateTime DummyStorage::incidenceDeletedDate ( const KCalCore::Incidence::Ptr &  incidence  )  [inline, virtual]

Get deletion time of incidence.

Parameters:
incidence incidence to check
Returns:
valid deletion time of incidence in UTC if incidence has been deleted otherwise KDateTime()

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.

Parameters:
list inserted incidences
after list only incidences inserted after or at given datetime
notebookUid list only incidences for given notebook
Returns:
true if execution was scheduled; false otherwise

Implements mKCal::ExtendedStorage.

int DummyStorage::journalCount (  )  [inline, virtual]

Get count of journals.

Returns:
count of journals

Implements mKCal::ExtendedStorage.

bool DummyStorage::load ( const QDate &  date  )  [inline, virtual]

Load incidences at given date into the memory.

Parameters:
date date
Returns:
true if the load was successful and specific date wasn't already loaded; false otherwise.

Implements mKCal::ExtendedStorage.

bool DummyStorage::load ( const QString &  uid,
const KDateTime &  recurrenceId 
) [inline, virtual]

Load incidence by uid into the memory.

Parameters:
uid is uid of incidence
recurrenceid is recurrenceid of incidence, default null
Returns:
true if the load was successful; false otherwise.

Implements mKCal::ExtendedStorage.

bool DummyStorage::load ( const QDate &  start,
const QDate &  end 
) [inline, virtual]

Load incidences between given dates into the memory.

Parameters:
start is the starting date
end is the ending date
Returns:
true if the load was successful and specific dates wasn't already loaded; false otherwise.

Implements mKCal::ExtendedStorage.

bool DummyStorage::load (  )  [inline, virtual]
bool DummyStorage::loadAttendeeIncidences (  )  [inline, virtual]

Load incidences that have attendee.

Returns:
true if the load was successful; false otherwise.

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.

Parameters:
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
Returns:
number of loaded todos, or -1 on error

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).

Parameters:
person person in question
limit load only that many incidences
last last loaded incidence due/creation date in return
Returns:
number of loaded incidences, or -1 on error

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.

Returns:
ordered list of persons

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).

Parameters:
limit load only that many incidences
last last loaded incidence start date in return
Returns:
number of loaded incidences, or -1 on error

Implements mKCal::ExtendedStorage.

bool DummyStorage::loadGeoIncidences (  )  [inline, virtual]

Load incidences that have geo parameters.

Returns:
true if the load was successful; false otherwise.

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.

Parameters:
geoLatitude latitude
geoLongitude longitude
diffLatitude maximum latitudinal difference
diffLongitude maximum longitudinal difference
Returns:
true if the load was successful; false otherwise.

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.

Parameters:
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
Returns:
number of loaded incidences, or -1 on error

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.

Parameters:
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
Returns:
number of loaded incidences, or -1 on error

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.

Parameters:
limit load only that many incidences
last last loaded incidence due/creation date in return
Returns:
number of loaded incidences, or -1 on error

Implements mKCal::ExtendedStorage.

bool DummyStorage::loadNotebookIncidences ( const QString &  notebookUid  )  [inline, virtual]

Load incidences of one notebook into the memory.

Parameters:
notebookUid is uid of notebook
Returns:
true if the load was successful; false otherwise.

Implements mKCal::ExtendedStorage.

bool DummyStorage::loadNotebooks (  )  [inline, virtual]
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.

Parameters:
limit load only that many incidences
last last loaded incidence due/creation date in return
Returns:
number of loaded incidences, or -1 on error

Implements mKCal::ExtendedStorage.

bool DummyStorage::loadPlainIncidences (  )  [inline, virtual]

Load plain incidences (no startdate and no enddate).

Returns:
true if the load was successful; false otherwise.

Implements mKCal::ExtendedStorage.

bool DummyStorage::loadRecurringIncidences (  )  [inline, virtual]

Load recurring incidences.

Returns:
true if the load was successful; false otherwise.

Implements mKCal::ExtendedStorage.

int DummyStorage::loadUncompletedTodos (  )  [inline, virtual]

Load all uncompleted todos.

Returns:
number of loaded todos, or -1 on error

Implements mKCal::ExtendedStorage.

int DummyStorage::loadUnreadInvitationIncidences (  )  [inline, virtual]

Load all unread incidences that are related to an invitation.

Returns:
number of loaded incidences, or -1 on error

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!

Parameters:
list modified incidences
after list only incidences modified after or at given datetime
notebookUid list only incidences for given notebook
Returns:
true if execution was scheduled; false otherwise

Implements mKCal::ExtendedStorage.

bool DummyStorage::modifyNotebook ( const mKCal::Notebook::Ptr ,
mKCal::DBOperation  ,
bool   
) [inline, virtual]
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.

Parameters:
incidence The incidence that has been opened
Returns:
True if sucessful; false otherwise

Implements mKCal::ExtendedStorage.

bool DummyStorage::open (  )  [inline, virtual]
bool DummyStorage::reloadNotebooks (  )  [inline, virtual]
bool DummyStorage::save (  )  [inline, virtual]
int DummyStorage::todoCount (  )  [inline, virtual]

Get count of todos.

Returns:
count of todos

Implements mKCal::ExtendedStorage.

void DummyStorage::virtual_hook ( int  id,
void *  data 
) [inline, virtual]

Standard trick to add virtuals later.

Parameters:
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.


The documentation for this class was generated from the following file:

Generated on Tue Jul 5 2011 16:40:27 for libmkcal by doxygen 1.7.1