Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions

mKCal::ExtendedStorage Class Reference

This class provides a calendar storage interface. More...

#include <extendedstorage.h>

Inheritance diagram for mKCal::ExtendedStorage:
Inheritance graph
[legend]

List of all members.

Public Types

typedef QSharedPointer
< ExtendedStorage
Ptr
 A shared pointer to a ExtendedStorage.

Public Member Functions

 ExtendedStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=false)
 Constructs a new ExtendedStorage object.
virtual ~ExtendedStorage ()
 Destructor.
virtual bool open ()=0
virtual bool load ()=0
virtual bool load (const QString &uid, const KDateTime &recurrenceId=KDateTime())=0
 Load incidence by uid into the memory.
virtual bool load (const QDate &date)=0
 Load incidences at given date into the memory.
virtual bool load (const QDate &start, const QDate &end)=0
 Load incidences between given dates into the memory.
virtual bool loadNotebookIncidences (const QString &notebookUid)=0
 Load incidences of one notebook into the memory.
virtual bool loadJournals ()=0
 Load journal type entries.
virtual bool loadPlainIncidences ()=0
 Load plain incidences (no startdate and no enddate).
virtual bool loadRecurringIncidences ()=0
 Load recurring incidences.
virtual bool loadGeoIncidences ()=0
 Load incidences that have geo parameters.
virtual bool loadGeoIncidences (float geoLatitude, float geoLongitude, float diffLatitude, float diffLongitude)=0
 Load incidences that have geo parameters inside given rectangle.
virtual bool loadAttendeeIncidences ()=0
 Load incidences that have attendee.
virtual int loadUncompletedTodos ()=0
 Load all uncompleted todos.
virtual int loadCompletedTodos (bool hasDate, int limit, KDateTime *last)=0
 Load completed todos based on parameters.
virtual int loadIncidences (bool hasDate, int limit, KDateTime *last)=0
 Load incidences based on start/due date or creation date.
virtual int loadFutureIncidences (int limit, KDateTime *last)=0
 Load future incidences based on start/due date.
virtual int loadGeoIncidences (bool hasDate, int limit, KDateTime *last)=0
 Load incidences that have location information based on parameters.
virtual int loadUnreadInvitationIncidences ()=0
 Load all unread incidences that are related to an invitation.
virtual int loadOldInvitationIncidences (int limit, KDateTime *last)=0
 Load incidences that are related to an invitation.
virtual KCalCore::Person::List loadContacts ()=0
 Load all contacts in the database.
virtual int loadContactIncidences (const KCalCore::Person::Ptr &person, int limit, KDateTime *last)=0
 Load all incidences that have the specified attendee.
virtual int loadJournals (int limit, KDateTime *last)=0
 Load journal entries based on parameters.
virtual bool save ()=0
virtual bool notifyOpened (const KCalCore::Incidence::Ptr &incidence)=0
 Mark if supported by the storage that an incidence has been opened.
virtual bool cancel ()=0
 Cancel any ongoing action (load etc.
virtual bool close ()=0
virtual void calendarModified (bool modified, KCalCore::Calendar *calendar)=0
virtual void calendarIncidenceAdded (const KCalCore::Incidence::Ptr &incidence)=0
virtual void calendarIncidenceChanged (const KCalCore::Incidence::Ptr &incidence)=0
virtual void calendarIncidenceDeleted (const KCalCore::Incidence::Ptr &incidence)=0
virtual void calendarIncidenceAdditionCanceled (const KCalCore::Incidence::Ptr &incidence)=0
virtual bool insertedIncidences (KCalCore::Incidence::List *list, const KDateTime &after=KDateTime(), const QString &notebookUid=QString())=0
 Get inserted incidences from storage.
virtual bool modifiedIncidences (KCalCore::Incidence::List *list, const KDateTime &after=KDateTime(), const QString &notebookUid=QString())=0
 Get modified incidences from storage.
virtual bool deletedIncidences (KCalCore::Incidence::List *list, const KDateTime &after=KDateTime(), const QString &notebookUid=QString())=0
 Get deleted incidences from storage.
virtual bool deletedIncidencesCreatedAfter (KCalCore::Incidence::List *list, const KDateTime &after=KDateTime(), const QString &notebookUid=QString())=0
 Get deleted incidences from storage, that are created and deleted after given datetime.
virtual bool allIncidences (KCalCore::Incidence::List *list, const QString &notebookUid=QString())=0
 Get all incidences from storage.
virtual bool duplicateIncidences (KCalCore::Incidence::List *list, const KCalCore::Incidence::Ptr &incidence, const QString &notebookUid=QString())=0
 Get possible duplicates for given incidence.
virtual KDateTime incidenceDeletedDate (const KCalCore::Incidence::Ptr &incidence)=0
 Get deletion time of incidence.
virtual int eventCount ()=0
 Get count of events.
virtual int todoCount ()=0
 Get count of todos.
virtual int journalCount ()=0
 Get count of journals.
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, bool signal=true)
 Add new notebook to the storage.
bool updateNotebook (const Notebook::Ptr &nb)
 Update notebook parameters.
bool deleteNotebook (const Notebook::Ptr &nb, bool onlyMemory=false)
 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 &notebookUid)
 Returns true if the given notebook is valid for the storage.
KCalCore::Incidence::Ptr checkAlarm (const QString &uid, const QString &recurrenceId, bool loadAlways=false)
 Checking if an incidence has active alarms.
void resetAlarms (const KCalCore::Incidence::Ptr &incidence)
 Reset alarms for the incidence.
void resetAlarms (const KCalCore::Incidence::List &incidences)
 Reset alarms for list of incidences.
void setAlarms (const KCalCore::Incidence::Ptr &incidence)
 Set alarms for the incidence without removing old alarms.
void clearAlarms (const QString &notebookUid)
 Remove all alarms for defined notebook.
Notebook::Ptr createDefaultNotebook (QString name="", QString color="")
 Creates and sets a default notebook.
virtual void virtual_hook (int id, void *data)=0
 Standard trick to add virtuals later.
bool isOwnSave ()
 Returns true if the save is "own save".
void setNotebookVisibility (const QString &id, bool visible)
 Sets notebook visiblity.
void resetDefaultNotebook ()
 Reset default notebook algorithm.

Protected Member Functions

virtual bool loadNotebooks ()=0
virtual bool reloadNotebooks ()=0
virtual bool modifyNotebook (const Notebook::Ptr &nb, DBOperation dbop, bool signal=true)=0
bool getLoadDates (const QDate &start, const QDate &end, KDateTime &loadStart, KDateTime &loadEnd)
void setLoadDates (const QDate &start, const QDate &end)
void setModified (const QString &info, bool mySave=false)
void setProgress (const QString &info)
void setFinished (bool error, const QString &info)
void clearAlarms (const KCalCore::Incidence::Ptr &incidence)
void clearAlarms (const KCalCore::Incidence::List &incidences)
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)
bool isUnreadIncidencesLoaded ()
void setIsUnreadIncidencesLoaded (bool loaded)
bool isInvitationIncidencesLoaded ()
void setIsInvitationIncidencesLoaded (bool loaded)
void clearLoaded (bool mySave=false)

Static Protected Member Functions

static bool notebookModifiedEarlierThan (const Notebook::Ptr &nb1, const Notebook::Ptr &nb2)

Detailed Description

This class provides a calendar storage interface.

Every action on the storage can be asynchronous, which means that actions are only scheduled for execution. Caller must use ExtendedStorageObserver to get notified about the completion.


Member Typedef Documentation

A shared pointer to a ExtendedStorage.

Reimplemented in mKCal::SqliteStorage.


Constructor & Destructor Documentation

ExtendedStorage::ExtendedStorage ( const ExtendedCalendar::Ptr &  cal,
bool  validateNotebooks = false 
) [explicit]

Constructs a new ExtendedStorage object.

Private class that helps to provide binary compatibility between releases.

Parameters:
cal is a pointer to a valid Calendar object.
validateNotebooks set to true for loading/saving only those incidences that belong to an existing notebook of this storage
Warning:
Do not usea storage as a global object, on closing the application it can dead lock. If you do so, be ready to destroy it manually before the application closes.
Once an Incidende has been added to the ExtendedStorage the UID cannot change. It is possible to do so through the API, but the internal hash tables will not be updated and hence the changes will not be tracked.

GRP::calendar TrackerWriteAccess

ExtendedStorage::~ExtendedStorage (  )  [virtual]

Destructor.


Member Function Documentation

bool ExtendedStorage::addNotebook ( const Notebook::Ptr nb,
bool  signal = true 
)

Add new notebook to the storage.

Notebook object is owned by the storage if operation succeeds. Operation is executed immediately into storage,

See also:
modifyNotebook().
Parameters:
nb notebook
signal for modifynotebook. Default true, false only when database is initialized
Returns:
true if operation was successful; false otherwise.
Note:
if the Notebook doesn't have a uid that is a valid UUID a new one will be generated on insertion.
virtual bool mKCal::ExtendedStorage::allIncidences ( KCalCore::Incidence::List *  list,
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual void mKCal::ExtendedStorage::calendarIncidenceAdded ( const KCalCore::Incidence::Ptr &  incidence  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual void mKCal::ExtendedStorage::calendarIncidenceAdditionCanceled ( const KCalCore::Incidence::Ptr &  incidence  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual void mKCal::ExtendedStorage::calendarIncidenceChanged ( const KCalCore::Incidence::Ptr &  incidence  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual void mKCal::ExtendedStorage::calendarIncidenceDeleted ( const KCalCore::Incidence::Ptr &  incidence  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual void mKCal::ExtendedStorage::calendarModified ( bool  modified,
KCalCore::Calendar *  calendar 
) [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::cancel (  )  [pure virtual]

Cancel any ongoing action (load etc.

).

Returns:
true cancel was successful; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

Incidence::Ptr ExtendedStorage::checkAlarm ( const QString &  uid,
const QString &  recurrenceId,
bool  loadAlways = false 
)

Checking if an incidence has active alarms.

Application can use this function for getting the incidence in question, for example, displaying the incidence after an alarm.

Parameters:
uid uid
recurrenceId recurrenceId
loadAlways set true to load always from storage
Returns:
the alarmed incidence, or null if there is no active alarm
void mKCal::ExtendedStorage::clearAlarms ( const KCalCore::Incidence::Ptr &  incidence  )  [protected]
void ExtendedStorage::clearAlarms ( const KCalCore::Incidence::List &  incidences  )  [protected]
void ExtendedStorage::clearAlarms ( const QString &  notebookUid  ) 

Remove all alarms for defined notebook.

void ExtendedStorage::clearLoaded ( bool  mySave = false  )  [protected]
virtual bool mKCal::ExtendedStorage::close (  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

Notebook::Ptr ExtendedStorage::createDefaultNotebook ( QString  name = "",
QString  color = "" 
)

Creates and sets a default notebook.

Usually called for an empty calendar.

Parameters:
name notebook's name, if empty default used
color notebook's color in format "#FF0042", if empty default used
Returns:
pointer to the created notebook
Notebook::Ptr ExtendedStorage::defaultNotebook (  ) 

defaultNotebook.

Returns:
pointer to default notebook.
virtual bool mKCal::ExtendedStorage::deletedIncidences ( KCalCore::Incidence::List *  list,
const KDateTime &  after = KDateTime(),
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::deletedIncidencesCreatedAfter ( KCalCore::Incidence::List *  list,
const KDateTime &  after = KDateTime(),
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

bool ExtendedStorage::deleteNotebook ( const Notebook::Ptr nb,
bool  onlyMemory = false 
)

Delete notebook from storage.

Operation is executed immediately into storage,

See also:
modifyNotebook().
Parameters:
nb notebook
onlyMemory. If true deleting notebooks only from memory but not from database. Default false, true only when notebooks are reloaded from database
Returns:
true if delete was successful; false otherwise.
virtual bool mKCal::ExtendedStorage::duplicateIncidences ( KCalCore::Incidence::List *  list,
const KCalCore::Incidence::Ptr &  incidence,
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::eventCount (  )  [pure virtual]

Get count of events.

Returns:
count of events

Implemented in DummyStorage, and mKCal::SqliteStorage.

bool ExtendedStorage::getLoadDates ( const QDate &  start,
const QDate &  end,
KDateTime &  loadStart,
KDateTime &  loadEnd 
) [protected]
virtual KDateTime mKCal::ExtendedStorage::incidenceDeletedDate ( const KCalCore::Incidence::Ptr &  incidence  )  [pure 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()

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::insertedIncidences ( KCalCore::Incidence::List *  list,
const KDateTime &  after = KDateTime(),
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

bool ExtendedStorage::isCompletedTodosCreatedLoaded (  )  [protected]
bool ExtendedStorage::isCompletedTodosDateLoaded (  )  [protected]
bool ExtendedStorage::isCreatedLoaded (  )  [protected]
bool ExtendedStorage::isDateLoaded (  )  [protected]
bool ExtendedStorage::isFutureDateLoaded (  )  [protected]
bool ExtendedStorage::isGeoCreatedLoaded (  )  [protected]
bool ExtendedStorage::isGeoDateLoaded (  )  [protected]
bool ExtendedStorage::isInvitationIncidencesLoaded (  )  [protected]
bool ExtendedStorage::isJournalsLoaded (  )  [protected]
bool ExtendedStorage::isOwnSave (  ) 

Returns true if the save is "own save".

Returns:
true or false
bool ExtendedStorage::isUncompletedTodosLoaded (  )  [protected]
bool ExtendedStorage::isUnreadIncidencesLoaded (  )  [protected]
bool ExtendedStorage::isValidNotebook ( const QString &  notebookUid  ) 

Returns true if the given notebook is valid for the storage.

That means that storage can load/save incidences on this notebook.

Parameters:
notebookUid notebook uid
Returns:
true or false
virtual int mKCal::ExtendedStorage::journalCount (  )  [pure virtual]

Get count of journals.

Returns:
count of journals

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::load ( const QDate &  date  )  [pure 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.

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::load ( const QDate &  start,
const QDate &  end 
) [pure 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.

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::load ( const QString &  uid,
const KDateTime &  recurrenceId = KDateTime() 
) [pure 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.

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::load (  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadAttendeeIncidences (  )  [pure virtual]

Load incidences that have attendee.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadCompletedTodos ( bool  hasDate,
int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadContactIncidences ( const KCalCore::Person::Ptr &  person,
int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual KCalCore::Person::List mKCal::ExtendedStorage::loadContacts (  )  [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadFutureIncidences ( int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadGeoIncidences ( bool  hasDate,
int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadGeoIncidences (  )  [pure virtual]

Load incidences that have geo parameters.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadGeoIncidences ( float  geoLatitude,
float  geoLongitude,
float  diffLatitude,
float  diffLongitude 
) [pure 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.

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadIncidences ( bool  hasDate,
int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadJournals ( int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadJournals (  )  [pure virtual]

Load journal type entries.

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadNotebookIncidences ( const QString &  notebookUid  )  [pure virtual]

Load incidences of one notebook into the memory.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadNotebooks (  )  [protected, pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadOldInvitationIncidences ( int  limit,
KDateTime *  last 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadPlainIncidences (  )  [pure virtual]

Load plain incidences (no startdate and no enddate).

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::loadRecurringIncidences (  )  [pure virtual]

Load recurring incidences.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadUncompletedTodos (  )  [pure virtual]

Load all uncompleted todos.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual int mKCal::ExtendedStorage::loadUnreadInvitationIncidences (  )  [pure virtual]

Load all unread incidences that are related to an invitation.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::modifiedIncidences ( KCalCore::Incidence::List *  list,
const KDateTime &  after = KDateTime(),
const QString &  notebookUid = QString() 
) [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::modifyNotebook ( const Notebook::Ptr nb,
DBOperation  dbop,
bool  signal = true 
) [protected, pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

Notebook::Ptr ExtendedStorage::notebook ( const QString &  uid  ) 

Search for notebook.

Parameters:
uid notebook uid
Returns:
pointer to notebook
Notebook::Ptr mKCal::ExtendedStorage::notebook ( Notebook::List list,
const QString &  uid 
)

Search for notebook in a list.

Parameters:
list notebook list
uid notebook uid
Returns:
pointer to notebook
bool ExtendedStorage::notebookModifiedEarlierThan ( const Notebook::Ptr nb1,
const Notebook::Ptr nb2 
) [static, protected]
Notebook::List ExtendedStorage::notebooks (  ) 

List all notebooks.

Returns:
list of notebooks
virtual bool mKCal::ExtendedStorage::notifyOpened ( const KCalCore::Incidence::Ptr &  incidence  )  [pure 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

Implemented in DummyStorage, and mKCal::SqliteStorage.

virtual bool mKCal::ExtendedStorage::open (  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

void ExtendedStorage::registerObserver ( ExtendedStorageObserver observer  ) 

Registers an Observer for this Storage.

Parameters:
observer is a pointer to an Observer object that will be watching this Storage.
See also:
unregisterObserver()
virtual bool mKCal::ExtendedStorage::reloadNotebooks (  )  [protected, pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

void mKCal::ExtendedStorage::resetAlarms ( const KCalCore::Incidence::Ptr &  incidence  ) 

Reset alarms for the incidence.

This function will be called automatically if application changes incidence alarms and calls save. Alarm information is communicated via DBus to the new timed, which will call the notification dialog when alarm triggers. If user presses open on the dialog, a DBus call is made to organiser application for displaying the incidence in question. See the documentation in extendedcalendar.h for the general architecture.

Parameters:
incidence incidence
void mKCal::ExtendedStorage::resetAlarms ( const KCalCore::Incidence::List &  incidences  ) 

Reset alarms for list of incidences.

void ExtendedStorage::resetDefaultNotebook (  ) 

Reset default notebook algorithm.

virtual bool mKCal::ExtendedStorage::save (  )  [pure virtual]

Implemented in DummyStorage, and mKCal::SqliteStorage.

void mKCal::ExtendedStorage::setAlarms ( const KCalCore::Incidence::Ptr &  incidence  ) 

Set alarms for the incidence without removing old alarms.

This is the same as resetAlarms except that the old alarms are not removed.

bool ExtendedStorage::setDefaultNotebook ( const Notebook::Ptr nb  ) 

setDefaultNotebook to the storage.

Parameters:
nb notebook
Returns:
true if operation was successful; false otherwise.
void ExtendedStorage::setFinished ( bool  error,
const QString &  info 
) [protected]
void ExtendedStorage::setIsCompletedTodosCreatedLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsCompletedTodosDateLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsCreatedLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsDateLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsFutureDateLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsGeoCreatedLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsGeoDateLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsInvitationIncidencesLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsJournalsLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsUncompletedTodosLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setIsUnreadIncidencesLoaded ( bool  loaded  )  [protected]
void ExtendedStorage::setLoadDates ( const QDate &  start,
const QDate &  end 
) [protected]
void ExtendedStorage::setModified ( const QString &  info,
bool  mySave = false 
) [protected]
void ExtendedStorage::setNotebookVisibility ( const QString &  id,
bool  visible 
)

Sets notebook visiblity.

Parameters:
id notebook id
visible visiblity state if true notebook visible and false otherwise
Note:
This method also changes default state and alarms state if needed
void ExtendedStorage::setProgress ( const QString &  info  )  [protected]
void ExtendedStorage::setValidateNotebooks ( bool  validateNotebooks  ) 

Determine if notebooks should be validated in saves and loads.

That means that storage can only load/save incidences into/from existing notebooks.

Parameters:
validate true to validate
virtual int mKCal::ExtendedStorage::todoCount (  )  [pure virtual]

Get count of todos.

Returns:
count of todos

Implemented in DummyStorage, and mKCal::SqliteStorage.

void ExtendedStorage::unregisterObserver ( ExtendedStorageObserver observer  ) 

Unregisters an Observer for this Storage.

Parameters:
observer is a pointer to an Observer object that has been watching this Storage.
See also:
registerObserver()
bool ExtendedStorage::updateNotebook ( const Notebook::Ptr nb  ) 

Update notebook parameters.

Operation is executed immediately into storage,

See also:
modifyNotebook().
Parameters:
nb notebook
Returns:
true if add was successful; false otherwise.
bool ExtendedStorage::validateNotebooks (  ) 

Returns true if notebooks should be validated in saves and loads.

That means that storage can only load/save incidences into/from existing notebooks.

Returns:
true to validate notebooks
virtual void mKCal::ExtendedStorage::virtual_hook ( int  id,
void *  data 
) [pure 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.

Implemented in DummyStorage, and mKCal::SqliteStorage.


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

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