Public Types | Public Member Functions | Protected Member Functions | List of all members
mKCal::ExtendedStorage Class Referenceabstract

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

#include <extendedstorage.h>

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

Public Types

enum  DeleteAction { MarkDeleted , PurgeDeleted }
 Action to be performed on save for deleted incidences. More...
 
typedef QSharedPointer< ExtendedStoragePtr
 A shared pointer to a ExtendedStorage. More...
 

Public Member Functions

 ExtendedStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true)
 Constructs a new ExtendedStorage object. More...
 
virtual ~ExtendedStorage ()
 Destructor. More...
 
virtual bool open ()=0
 
virtual bool load ()=0
 
virtual bool load (const QString &uid, const QDateTime &recurrenceId=QDateTime())=0
 Load incidence by uid into the memory. More...
 
virtual bool load (const QDate &date)=0
 Load incidences at given date into the memory. More...
 
virtual bool load (const QDate &start, const QDate &end)=0
 Load incidences between given dates into the memory. More...
 
virtual bool loadSeries (const QString &uid)=0
 Load all incidences sharing the same uid into the memory. More...
 
virtual bool loadIncidenceInstance (const QString &instanceIdentifier)=0
 Load the incidence matching the given identifier. More...
 
virtual bool loadNotebookIncidences (const QString &notebookUid)=0
 Load incidences of one notebook into the memory. More...
 
virtual bool loadJournals ()=0
 Load journal type entries. More...
 
virtual bool loadPlainIncidences ()=0
 Load plain incidences (no startdate and no enddate). More...
 
virtual bool loadRecurringIncidences ()=0
 Load recurring incidences. More...
 
virtual bool loadGeoIncidences ()=0
 Load incidences that have geo parameters. More...
 
virtual bool loadGeoIncidences (float geoLatitude, float geoLongitude, float diffLatitude, float diffLongitude)=0
 Load incidences that have geo parameters inside given rectangle. More...
 
virtual bool loadAttendeeIncidences ()=0
 Load incidences that have attendee. More...
 
virtual int loadUncompletedTodos ()=0
 Load all uncompleted todos. More...
 
virtual int loadCompletedTodos (bool hasDate, int limit, QDateTime *last)=0
 Load completed todos based on parameters. More...
 
virtual int loadIncidences (bool hasDate, int limit, QDateTime *last)=0
 Load incidences based on start/due date or creation date. More...
 
virtual int loadFutureIncidences (int limit, QDateTime *last)=0
 Load future incidences based on start/due date. More...
 
virtual int loadGeoIncidences (bool hasDate, int limit, QDateTime *last)=0
 Load incidences that have location information based on parameters. More...
 
virtual int loadUnreadInvitationIncidences ()=0
 Load all unread incidences that are related to an invitation. More...
 
virtual int loadOldInvitationIncidences (int limit, QDateTime *last)=0
 Load incidences that are related to an invitation. More...
 
virtual KCalendarCore::Person::List loadContacts ()=0
 Load all contacts in the database. More...
 
virtual int loadContactIncidences (const KCalendarCore::Person &person, int limit, QDateTime *last)=0
 Load all incidences that have the specified attendee. More...
 
virtual int loadJournals (int limit, QDateTime *last)=0
 Load journal entries based on parameters. More...
 
virtual bool purgeDeletedIncidences (const KCalendarCore::Incidence::List &list)=0
 Remove from storage all incidences that have been previously marked as deleted and that matches the UID / RecID of the incidences in list. More...
 
virtual bool save ()=0
 
virtual bool save (DeleteAction deleteAction)=0
 This is an overload of save() method. More...
 
virtual bool notifyOpened (const KCalendarCore::Incidence::Ptr &incidence)=0
 Mark if supported by the storage that an incidence has been opened. More...
 
virtual bool cancel ()=0
 Cancel any ongoing action (load etc.). More...
 
virtual bool close ()=0
 
virtual void calendarModified (bool modified, KCalendarCore::Calendar *calendar)=0
 
virtual void calendarIncidenceAdded (const KCalendarCore::Incidence::Ptr &incidence)=0
 
virtual void calendarIncidenceChanged (const KCalendarCore::Incidence::Ptr &incidence)=0
 
virtual void calendarIncidenceDeleted (const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar)=0
 
virtual void calendarIncidenceAdditionCanceled (const KCalendarCore::Incidence::Ptr &incidence)=0
 
virtual bool insertedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString &notebookUid=QString())=0
 Get inserted incidences from storage. More...
 
virtual bool modifiedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString &notebookUid=QString())=0
 Get modified incidences from storage. More...
 
virtual bool deletedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString &notebookUid=QString())=0
 Get deleted incidences from storage. More...
 
virtual bool allIncidences (KCalendarCore::Incidence::List *list, const QString &notebookUid=QString())=0
 Get all incidences from storage. More...
 
virtual bool duplicateIncidences (KCalendarCore::Incidence::List *list, const KCalendarCore::Incidence::Ptr &incidence, const QString &notebookUid=QString())=0
 Get possible duplicates for given incidence. More...
 
virtual QDateTime incidenceDeletedDate (const KCalendarCore::Incidence::Ptr &incidence)=0
 Get deletion time of incidence. More...
 
virtual int eventCount ()=0
 Get count of events. More...
 
virtual int todoCount ()=0
 Get count of todos. More...
 
virtual int journalCount ()=0
 Get count of journals. More...
 
void registerObserver (ExtendedStorageObserver *observer)
 Registers an Observer for this Storage. More...
 
void unregisterObserver (ExtendedStorageObserver *observer)
 Unregisters an Observer for this Storage. More...
 
bool addNotebook (const Notebook::Ptr &nb, bool signal=true)
 Add new notebook to the storage. More...
 
bool updateNotebook (const Notebook::Ptr &nb)
 Update notebook parameters. More...
 
bool deleteNotebook (const Notebook::Ptr &nb, bool onlyMemory=false)
 Delete notebook from storage. More...
 
bool setDefaultNotebook (const Notebook::Ptr &nb)
 setDefaultNotebook to the storage. More...
 
Notebook::Ptr defaultNotebook ()
 defaultNotebook. More...
 
Notebook::Ptr notebook (const QString &uid)
 Search for notebook. More...
 
Notebook::Ptr notebook (Notebook::List &list, const QString &uid)
 Search for notebook in a list. More...
 
Notebook::List notebooks ()
 List all notebooks. More...
 
void setValidateNotebooks (bool validateNotebooks)
 Determine if notebooks should be validated in saves and loads. More...
 
bool validateNotebooks ()
 Returns true if notebooks should be validated in saves and loads. More...
 
bool isValidNotebook (const QString &notebookUid)
 Returns true if the given notebook is valid for the storage. More...
 
KCalendarCore::Incidence::Ptr checkAlarm (const QString &uid, const QString &recurrenceId, bool loadAlways=false)
 Checking if an incidence has active alarms. More...
 
Notebook::Ptr createDefaultNotebook (QString name=QString(), QString color=QString())
 Creates and sets a default notebook. More...
 
virtual void virtual_hook (int id, void *data)=0
 Standard trick to add virtuals later. More...
 

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, QDateTime &loadStart, QDateTime &loadEnd)
 
void setLoadDates (const QDate &start, const QDate &end)
 
void setModified (const QString &info)
 
void setProgress (const QString &info)
 
void setFinished (bool error, const QString &info)
 
void clearAlarms (const KCalendarCore::Incidence::Ptr &incidence)
 
void clearAlarms (const KCalendarCore::Incidence::List &incidences)
 
void clearAlarms (const QString &nname)
 
void setAlarms (const KCalendarCore::Incidence::Ptr &incidence)
 
void setAlarms (const KCalendarCore::Incidence::List &incidences)
 
void resetAlarms (const KCalendarCore::Incidence::List &incidences)
 
void resetAlarms (const KCalendarCore::Incidence::Ptr &incidence)
 
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 ()
 

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

◆ Ptr

A shared pointer to a ExtendedStorage.

Member Enumeration Documentation

◆ DeleteAction

Action to be performed on save for deleted incidences.

Enumerator
MarkDeleted 
PurgeDeleted 

Constructor & Destructor Documentation

◆ ExtendedStorage()

ExtendedStorage::ExtendedStorage ( const ExtendedCalendar::Ptr &  cal,
bool  validateNotebooks = true 
)
explicit

Constructs a new ExtendedStorage object.

Private class that helps to provide binary compatibility between releases.

Parameters
calis a pointer to a valid Calendar object.
validateNotebooksset to true for loading/saving only those incidences that belong to an existing notebook of this storage
Warning
Do not use 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 Incidence 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.

◆ ~ExtendedStorage()

ExtendedStorage::~ExtendedStorage ( )
virtual

Destructor.

Member Function Documentation

◆ addNotebook()

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
nbnotebook
signalfor 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.

◆ allIncidences()

virtual bool mKCal::ExtendedStorage::allIncidences ( KCalendarCore::Incidence::List *  list,
const QString &  notebookUid = QString() 
)
pure virtual

Get all incidences from storage.

Parameters
listnotebook's incidences
notebookUidlist incidences for given notebook
Returns
true if execution was scheduled; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ calendarIncidenceAdded()

virtual void mKCal::ExtendedStorage::calendarIncidenceAdded ( const KCalendarCore::Incidence::Ptr &  incidence)
pure virtual

Calendar::CalendarObserver::calendarIncidenceAdded()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ calendarIncidenceAdditionCanceled()

virtual void mKCal::ExtendedStorage::calendarIncidenceAdditionCanceled ( const KCalendarCore::Incidence::Ptr &  incidence)
pure virtual

Calendar::CalendarObserver::calendarIncidenceAdditionCanceled()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ calendarIncidenceChanged()

virtual void mKCal::ExtendedStorage::calendarIncidenceChanged ( const KCalendarCore::Incidence::Ptr &  incidence)
pure virtual

Calendar::CalendarObserver::calendarIncidenceChanged()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ calendarIncidenceDeleted()

virtual void mKCal::ExtendedStorage::calendarIncidenceDeleted ( const KCalendarCore::Incidence::Ptr &  incidence,
const KCalendarCore::Calendar *  calendar 
)
pure virtual

Calendar::CalendarObserver::calendarIncidenceDeleted()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ calendarModified()

virtual void mKCal::ExtendedStorage::calendarModified ( bool  modified,
KCalendarCore::Calendar *  calendar 
)
pure virtual

Calendar::CalendarObserver::calendarModified()

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ cancel()

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.

◆ checkAlarm()

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
uiduid
recurrenceIdrecurrenceId
loadAlwaysset true to load always from storage
Returns
the alarmed incidence, or null if there is no active alarm

◆ clearAlarms() [1/3]

void ExtendedStorage::clearAlarms ( const KCalendarCore::Incidence::List &  incidences)
protected

◆ clearAlarms() [2/3]

void mKCal::ExtendedStorage::clearAlarms ( const KCalendarCore::Incidence::Ptr &  incidence)
protected

◆ clearAlarms() [3/3]

void ExtendedStorage::clearAlarms ( const QString &  nname)
protected

◆ clearLoaded()

void ExtendedStorage::clearLoaded ( )
protected

◆ close()

virtual bool mKCal::ExtendedStorage::close ( )
pure virtual

CalStorage::close()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ createDefaultNotebook()

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

Creates and sets a default notebook.

Usually called for an empty calendar.

Parameters
namenotebook's name, if empty default used
colornotebook's color in format "#FF0042", if empty default used
Returns
pointer to the created notebook

◆ defaultNotebook()

Notebook::Ptr ExtendedStorage::defaultNotebook ( )

defaultNotebook.

Returns
pointer to default notebook.

◆ deletedIncidences()

virtual bool mKCal::ExtendedStorage::deletedIncidences ( KCalendarCore::Incidence::List *  list,
const QDateTime &  after = QDateTime(),
const QString &  notebookUid = QString() 
)
pure virtual

Get deleted incidences from storage.

Parameters
listdeleted incidences
afterlist only incidences deleted after or at given datetime
notebookUidlist only incidences for given notebook
Returns
true if execution was scheduled; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ deleteNotebook()

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

Delete notebook from storage.

Operation is executed immediately into storage,

See also
modifyNotebook().
Parameters
nbnotebook
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.

◆ duplicateIncidences()

virtual bool mKCal::ExtendedStorage::duplicateIncidences ( KCalendarCore::Incidence::List *  list,
const KCalendarCore::Incidence::Ptr &  incidence,
const QString &  notebookUid = QString() 
)
pure virtual

Get possible duplicates for given incidence.

Parameters
listduplicate incidences
incidenceincidence to check
notebookUidlist incidences for given notebook
Returns
true if execution was scheduled; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ eventCount()

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

Get count of events.

Returns
count of events

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ getLoadDates()

bool ExtendedStorage::getLoadDates ( const QDate &  start,
const QDate &  end,
QDateTime &  loadStart,
QDateTime &  loadEnd 
)
protected

◆ incidenceDeletedDate()

virtual QDateTime mKCal::ExtendedStorage::incidenceDeletedDate ( const KCalendarCore::Incidence::Ptr &  incidence)
pure virtual

Get deletion time of incidence.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ insertedIncidences()

virtual bool mKCal::ExtendedStorage::insertedIncidences ( KCalendarCore::Incidence::List *  list,
const QDateTime &  after = QDateTime(),
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
listinserted incidences
afterlist only incidences inserted after or at given datetime
notebookUidlist only incidences for given notebook
Returns
true if execution was scheduled; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ isCompletedTodosCreatedLoaded()

bool ExtendedStorage::isCompletedTodosCreatedLoaded ( )
protected

◆ isCompletedTodosDateLoaded()

bool ExtendedStorage::isCompletedTodosDateLoaded ( )
protected

◆ isCreatedLoaded()

bool ExtendedStorage::isCreatedLoaded ( )
protected

◆ isDateLoaded()

bool ExtendedStorage::isDateLoaded ( )
protected

◆ isFutureDateLoaded()

bool ExtendedStorage::isFutureDateLoaded ( )
protected

◆ isGeoCreatedLoaded()

bool ExtendedStorage::isGeoCreatedLoaded ( )
protected

◆ isGeoDateLoaded()

bool ExtendedStorage::isGeoDateLoaded ( )
protected

◆ isInvitationIncidencesLoaded()

bool ExtendedStorage::isInvitationIncidencesLoaded ( )
protected

◆ isJournalsLoaded()

bool ExtendedStorage::isJournalsLoaded ( )
protected

◆ isUncompletedTodosLoaded()

bool ExtendedStorage::isUncompletedTodosLoaded ( )
protected

◆ isUnreadIncidencesLoaded()

bool ExtendedStorage::isUnreadIncidencesLoaded ( )
protected

◆ isValidNotebook()

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
notebookUidnotebook uid
Returns
true or false

◆ journalCount()

virtual int mKCal::ExtendedStorage::journalCount ( )
pure virtual

Get count of journals.

Returns
count of journals

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ load() [1/4]

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

CalStorage::load()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ load() [2/4]

virtual bool mKCal::ExtendedStorage::load ( const QDate &  date)
pure virtual

Load incidences at given date into the memory.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ load() [3/4]

virtual bool mKCal::ExtendedStorage::load ( const QDate &  start,
const QDate &  end 
)
pure virtual

Load incidences between given dates into the memory.

Parameters
startis the starting date
endis 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.

◆ load() [4/4]

virtual bool mKCal::ExtendedStorage::load ( const QString &  uid,
const QDateTime &  recurrenceId = QDateTime() 
)
pure virtual

Load incidence by uid into the memory.

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

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadAttendeeIncidences()

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.

◆ loadCompletedTodos()

virtual int mKCal::ExtendedStorage::loadCompletedTodos ( bool  hasDate,
int  limit,
QDateTime *  last 
)
pure virtual

Load completed todos based on parameters.

Load direction is descending, i.e., starting from most distant upcoming todo.

Parameters
hasDateset true to load todos that have due date
limitload only that many todos
lastlast loaded todo due/creation date in return
Returns
number of loaded todos, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadContactIncidences()

virtual int mKCal::ExtendedStorage::loadContactIncidences ( const KCalendarCore::Person &  person,
int  limit,
QDateTime *  last 
)
pure virtual

Load all incidences that have the specified attendee.

Also includes all shared notes (in a shared notebook).

Parameters
personperson in question
limitload only that many incidences
lastlast loaded incidence due/creation date in return
Returns
number of loaded incidences, or -1 on error

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadContacts()

virtual KCalendarCore::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.

◆ loadFutureIncidences()

virtual int mKCal::ExtendedStorage::loadFutureIncidences ( int  limit,
QDateTime *  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
limitload only that many incidences
lastlast loaded incidence start date in return
Returns
number of loaded incidences, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadGeoIncidences() [1/3]

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.

◆ loadGeoIncidences() [2/3]

virtual int mKCal::ExtendedStorage::loadGeoIncidences ( bool  hasDate,
int  limit,
QDateTime *  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
hasDateset true to load incidences that have start/due date
limitload only that many incidences
lastlast loaded incidence due/creation date in return
Returns
number of loaded incidences, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadGeoIncidences() [3/3]

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
geoLatitudelatitude
geoLongitudelongitude
diffLatitudemaximum latitudinal difference
diffLongitudemaximum longitudinal difference
Returns
true if the load was successful; false otherwise.

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadIncidenceInstance()

virtual bool mKCal::ExtendedStorage::loadIncidenceInstance ( const QString &  instanceIdentifier)
pure virtual

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.

Parameters
instanceIdentifieris an identifier returned by Incidence::instanceIdentifier()
Returns
true if the load was successful; false otherwise.

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadIncidences()

virtual int mKCal::ExtendedStorage::loadIncidences ( bool  hasDate,
int  limit,
QDateTime *  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
hasDateset true to load incidences that have start/due date
limitload only that many incidences
lastlast loaded incidence due/creation date in return
Returns
number of loaded incidences, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadJournals() [1/2]

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

Load journal type entries.

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadJournals() [2/2]

virtual int mKCal::ExtendedStorage::loadJournals ( int  limit,
QDateTime *  last 
)
pure virtual

Load journal entries based on parameters.

Load direction is descending, i.e. starting from the most recently modified journal.

Parameters
limitload only that many incidences
lastlast loaded incidence due/creation date in return
Returns
number of loaded incidences, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadNotebookIncidences()

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

Load incidences of one notebook into the memory.

Parameters
notebookUidis uid of notebook
Returns
true if the load was successful; false otherwise.

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadNotebooks()

virtual bool mKCal::ExtendedStorage::loadNotebooks ( )
protectedpure virtual

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadOldInvitationIncidences()

virtual int mKCal::ExtendedStorage::loadOldInvitationIncidences ( int  limit,
QDateTime *  last 
)
pure virtual

Load incidences that are related to an invitation.

Load direction is descending, i.e., starting from most distant upcoming incidence.

Parameters
limitload only that many incidences
lastlast loaded incidence due/creation date in return
Returns
number of loaded incidences, or -1 on error

Implemented in mKCal::SqliteStorage, and DummyStorage.

◆ loadPlainIncidences()

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.

◆ loadRecurringIncidences()

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.

◆ loadSeries()

virtual bool mKCal::ExtendedStorage::loadSeries ( const QString &  uid)
pure virtual

Load all incidences sharing the same uid into the memory.

Parameters
uidis uid of the series
Returns
true if the load was successful; false otherwise.

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ loadUncompletedTodos()

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.

◆ loadUnreadInvitationIncidences()

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.

◆ modifiedIncidences()

virtual bool mKCal::ExtendedStorage::modifiedIncidences ( KCalendarCore::Incidence::List *  list,
const QDateTime &  after = QDateTime(),
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
listmodified incidences
afterlist only incidences modified after or at given datetime
notebookUidlist only incidences for given notebook
Returns
true if execution was scheduled; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ modifyNotebook()

virtual bool mKCal::ExtendedStorage::modifyNotebook ( const Notebook::Ptr nb,
DBOperation  dbop,
bool  signal = true 
)
protectedpure virtual

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ notebook() [1/2]

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

Search for notebook.

Parameters
uidnotebook uid
Returns
pointer to notebook

◆ notebook() [2/2]

Notebook::Ptr mKCal::ExtendedStorage::notebook ( Notebook::List list,
const QString &  uid 
)

Search for notebook in a list.

Parameters
listnotebook list
uidnotebook uid
Returns
pointer to notebook

◆ notebooks()

Notebook::List ExtendedStorage::notebooks ( )

List all notebooks.

Returns
list of notebooks

◆ notifyOpened()

virtual bool mKCal::ExtendedStorage::notifyOpened ( const KCalendarCore::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
incidenceThe incidence that has been opened
Returns
True if sucessful; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ open()

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

CalStorage::open()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ purgeDeletedIncidences()

virtual bool mKCal::ExtendedStorage::purgeDeletedIncidences ( const KCalendarCore::Incidence::List &  list)
pure virtual

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.

Returns
True on success, false otherwise.

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ registerObserver()

void ExtendedStorage::registerObserver ( ExtendedStorageObserver observer)

Registers an Observer for this Storage.

Parameters
observeris a pointer to an Observer object that will be watching this Storage.
See also
unregisterObserver()

◆ reloadNotebooks()

virtual bool mKCal::ExtendedStorage::reloadNotebooks ( )
protectedpure virtual

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ resetAlarms() [1/2]

void mKCal::ExtendedStorage::resetAlarms ( const KCalendarCore::Incidence::List &  incidences)
protected

◆ resetAlarms() [2/2]

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

◆ save() [1/2]

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

CalStorage::save()

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ save() [2/2]

virtual bool mKCal::ExtendedStorage::save ( DeleteAction  deleteAction)
pure virtual

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

Parameters
deleteActionthe action to apply to deleted incidences
Returns
True if successful; false otherwise

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ setAlarms() [1/2]

void mKCal::ExtendedStorage::setAlarms ( const KCalendarCore::Incidence::List &  incidences)
protected

◆ setAlarms() [2/2]

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

◆ setDefaultNotebook()

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

setDefaultNotebook to the storage.

Parameters
nbnotebook
Returns
true if operation was successful; false otherwise.

◆ setFinished()

void ExtendedStorage::setFinished ( bool  error,
const QString &  info 
)
protected

◆ setIsCompletedTodosCreatedLoaded()

void ExtendedStorage::setIsCompletedTodosCreatedLoaded ( bool  loaded)
protected

◆ setIsCompletedTodosDateLoaded()

void ExtendedStorage::setIsCompletedTodosDateLoaded ( bool  loaded)
protected

◆ setIsCreatedLoaded()

void ExtendedStorage::setIsCreatedLoaded ( bool  loaded)
protected

◆ setIsDateLoaded()

void ExtendedStorage::setIsDateLoaded ( bool  loaded)
protected

◆ setIsFutureDateLoaded()

void ExtendedStorage::setIsFutureDateLoaded ( bool  loaded)
protected

◆ setIsGeoCreatedLoaded()

void ExtendedStorage::setIsGeoCreatedLoaded ( bool  loaded)
protected

◆ setIsGeoDateLoaded()

void ExtendedStorage::setIsGeoDateLoaded ( bool  loaded)
protected

◆ setIsInvitationIncidencesLoaded()

void ExtendedStorage::setIsInvitationIncidencesLoaded ( bool  loaded)
protected

◆ setIsJournalsLoaded()

void ExtendedStorage::setIsJournalsLoaded ( bool  loaded)
protected

◆ setIsUncompletedTodosLoaded()

void ExtendedStorage::setIsUncompletedTodosLoaded ( bool  loaded)
protected

◆ setIsUnreadIncidencesLoaded()

void ExtendedStorage::setIsUnreadIncidencesLoaded ( bool  loaded)
protected

◆ setLoadDates()

void ExtendedStorage::setLoadDates ( const QDate &  start,
const QDate &  end 
)
protected

◆ setModified()

void ExtendedStorage::setModified ( const QString &  info)
protected

◆ setProgress()

void ExtendedStorage::setProgress ( const QString &  info)
protected

◆ setValidateNotebooks()

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
validatetrue to validate

◆ todoCount()

virtual int mKCal::ExtendedStorage::todoCount ( )
pure virtual

Get count of todos.

Returns
count of todos

Implemented in DummyStorage, and mKCal::SqliteStorage.

◆ unregisterObserver()

void ExtendedStorage::unregisterObserver ( ExtendedStorageObserver observer)

Unregisters an Observer for this Storage.

Parameters
observeris a pointer to an Observer object that has been watching this Storage.
See also
registerObserver()

◆ updateNotebook()

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

Update notebook parameters.

Operation is executed immediately into storage,

See also
modifyNotebook().
Parameters
nbnotebook
Returns
true if add was successful; false otherwise.

◆ validateNotebooks()

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_hook()

virtual void mKCal::ExtendedStorage::virtual_hook ( int  id,
void *  data 
)
pure virtual

Standard trick to add virtuals later.

Parameters
idis any integer unique to this class which we will use to identify the method to be called.
datais a pointer to some glob of data, typically a struct.

Implemented in mKCal::SqliteStorage, and DummyStorage.


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

Generated on Mon Sep 13 2021 12:08:02 for libextendedkcal by doxygen 1.9.2