mKCal::SqliteStorage Class Reference

This class provides a calendar storage as an sqlite database. More...

#include <sqlitestorage.h>

Inheritance diagram for mKCal::SqliteStorage:

Public Types

typedef QSharedPointer< SqliteStoragePtr
 A shared pointer to a SqliteStorage.
 
- Public Types inherited from mKCal::ExtendedStorage
enum  DeleteAction { MarkDeleted , PurgeDeleted }
 Action to be performed on save for deleted incidences. More...
 
typedef QSharedPointer< ExtendedStoragePtr
 A shared pointer to a ExtendedStorage.
 

Public Slots

void fileChanged (const QString &path)
 

Public Member Functions

 SqliteStorage (const ExtendedCalendar::Ptr &cal, const QString &databaseName, bool validateNotebooks=true)
 Constructs a new SqliteStorage object for Calendar calendar with storage to file databaseName.
 
 SqliteStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true)
 Constructs a new SqliteStorage object for Calendar calendar.
 
virtual ~SqliteStorage ()
 Destructor.
 
QString databaseName () const
 Returns a string containing the name of the calendar database.
 
bool open ()
 
bool load ()
 
bool load (const QString &uid, const QDateTime &recurrenceId=QDateTime())
 
bool load (const QDate &date)
 
bool load (const QDate &start, const QDate &end)
 
bool loadSeries (const QString &uid)
 
bool loadIncidenceInstance (const QString &instanceIdentifier)
 
bool loadNotebookIncidences (const QString &notebookUid)
 
bool loadJournals ()
 
bool loadPlainIncidences ()
 
bool loadRecurringIncidences ()
 
bool loadGeoIncidences ()
 
bool loadGeoIncidences (float geoLatitude, float geoLongitude, float diffLatitude, float diffLongitude)
 
bool loadAttendeeIncidences ()
 
int loadUncompletedTodos ()
 
int loadCompletedTodos (bool hasDate, int limit, QDateTime *last)
 
int loadIncidences (bool hasDate, int limit, QDateTime *last)
 
int loadFutureIncidences (int limit, QDateTime *last)
 
int loadGeoIncidences (bool hasDate, int limit, QDateTime *last)
 
KCalendarCore::Person::List loadContacts ()
 
int loadContactIncidences (const KCalendarCore::Person &person, int limit, QDateTime *last)
 
int loadJournals (int limit, QDateTime *last)
 
bool notifyOpened (const KCalendarCore::Incidence::Ptr &incidence)
 
bool purgeDeletedIncidences (const KCalendarCore::Incidence::List &list)
 
bool save ()
 
bool save (ExtendedStorage::DeleteAction deleteAction)
 
bool cancel ()
 
bool close ()
 
void calendarModified (bool modified, KCalendarCore::Calendar *calendar)
 
void calendarIncidenceCreated (const KCalendarCore::Incidence::Ptr &incidence)
 
void calendarIncidenceAdded (const KCalendarCore::Incidence::Ptr &incidence)
 
void calendarIncidenceChanged (const KCalendarCore::Incidence::Ptr &incidence)
 
void calendarIncidenceDeleted (const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar)
 
void calendarIncidenceAdditionCanceled (const KCalendarCore::Incidence::Ptr &incidence)
 
bool insertedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after, const QString &notebookUid=QString())
 
bool modifiedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after, const QString &notebookUid=QString())
 
bool deletedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString &notebookUid=QString())
 
bool allIncidences (KCalendarCore::Incidence::List *list, const QString &notebookUid=QString())
 
bool duplicateIncidences (KCalendarCore::Incidence::List *list, const KCalendarCore::Incidence::Ptr &incidence, const QString &notebookUid=QString())
 
QDateTime incidenceDeletedDate (const KCalendarCore::Incidence::Ptr &incidence)
 
int eventCount ()
 
int todoCount ()
 
int journalCount ()
 
virtual void virtual_hook (int id, void *data)
 
- Public Member Functions inherited from mKCal::ExtendedStorage
 ExtendedStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true)
 Constructs a new ExtendedStorage object.
 
virtual ~ExtendedStorage ()
 Destructor.
 
void registerObserver (ExtendedStorageObserver *observer)
 Registers an Observer for this Storage.
 
void unregisterObserver (ExtendedStorageObserver *observer)
 Unregisters an Observer for this Storage.
 
bool addNotebook (const Notebook::Ptr &nb)
 Add new notebook to the storage.
 
bool updateNotebook (const Notebook::Ptr &nb)
 Update notebook parameters.
 
bool deleteNotebook (const Notebook::Ptr &nb)
 Delete notebook from storage.
 
bool setDefaultNotebook (const Notebook::Ptr &nb)
 setDefaultNotebook to the storage.
 
Notebook::Ptr defaultNotebook ()
 defaultNotebook.
 
Notebook::Ptr notebook (const QString &uid)
 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.
 
KCalendarCore::Incidence::Ptr checkAlarm (const QString &uid, const QString &recurrenceId, bool loadAlways=false)
 Checking if an incidence has active alarms.
 
Notebook::Ptr createDefaultNotebook (QString name=QString(), QString color=QString())
 Creates and sets a default notebook.
 

Protected Member Functions

bool loadNotebooks ()
 
bool modifyNotebook (const Notebook::Ptr &nb, DBOperation dbop)
 
- Protected Member Functions inherited from mKCal::ExtendedStorage
bool getLoadDates (const QDate &start, const QDate &end, QDateTime *loadStart, QDateTime *loadEnd) const
 
void addLoadedRange (const QDate &start, const QDate &end) const
 
bool isRecurrenceLoaded () const
 
void setIsRecurrenceLoaded (bool loaded)
 
void setModified (const QString &info)
 
void setFinished (bool error, const QString &info)
 
void setUpdated (const KCalendarCore::Incidence::List &added, const KCalendarCore::Incidence::List &modified, const KCalendarCore::Incidence::List &deleted)
 
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)
 
void clearLoaded ()
 

Detailed Description

This class provides a calendar storage as an sqlite database.

Warning
When saving Attendees, the CustomProperties are not saved.

Member Typedef Documentation

◆ Ptr

A shared pointer to a SqliteStorage.

Constructor & Destructor Documentation

◆ SqliteStorage() [1/2]

SqliteStorage::SqliteStorage ( const ExtendedCalendar::Ptr & cal,
const QString & databaseName,
bool validateNotebooks = true )
explicit

Constructs a new SqliteStorage object for Calendar calendar with storage to file databaseName.

Private class that helps to provide binary compatibility between releases.

Parameters
calendaris a pointer to a valid Calendar object.
databaseNameis the name of the database containing the Calendar data.
validateNotebooksset to true for saving only those incidences that belong to an existing notebook of this storage

◆ SqliteStorage() [2/2]

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

Constructs a new SqliteStorage object for Calendar calendar.

Location of the database is using default location, or is taken from SQLITESTORAGEDB enivronment variable.

Parameters
calendaris a pointer to a valid Calendar object.
validateNotebooksset to true for saving only those incidences that belong to an existing notebook of this storage

◆ ~SqliteStorage()

SqliteStorage::~SqliteStorage ( )
virtual

Destructor.

Member Function Documentation

◆ allIncidences()

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

◆ calendarIncidenceAdded()

void SqliteStorage::calendarIncidenceAdded ( const KCalendarCore::Incidence::Ptr & incidence)
virtual

Calendar::CalendarObserver::calendarIncidenceAdded()

Implements mKCal::ExtendedStorage.

◆ calendarIncidenceAdditionCanceled()

void SqliteStorage::calendarIncidenceAdditionCanceled ( const KCalendarCore::Incidence::Ptr & incidence)
virtual

Calendar::CalendarObserver::calendarIncidenceAdditionCanceled()

Implements mKCal::ExtendedStorage.

◆ calendarIncidenceChanged()

void SqliteStorage::calendarIncidenceChanged ( const KCalendarCore::Incidence::Ptr & incidence)
virtual

Calendar::CalendarObserver::calendarIncidenceChanged()

Implements mKCal::ExtendedStorage.

◆ calendarIncidenceCreated()

void mKCal::SqliteStorage::calendarIncidenceCreated ( const KCalendarCore::Incidence::Ptr & incidence)

Calendar::CalendarObserver::calendarIncidenceCreated()

◆ calendarIncidenceDeleted()

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

Calendar::CalendarObserver::calendarIncidenceDeleted()

Implements mKCal::ExtendedStorage.

◆ calendarModified()

void SqliteStorage::calendarModified ( bool modified,
KCalendarCore::Calendar * calendar )
virtual

Calendar::CalendarObserver::calendarModified()

Implements mKCal::ExtendedStorage.

◆ cancel()

bool SqliteStorage::cancel ( )
virtual

◆ close()

bool SqliteStorage::close ( )
virtual

CalStorage::close()

Reimplemented from mKCal::ExtendedStorage.

◆ databaseName()

QString SqliteStorage::databaseName ( ) const

Returns a string containing the name of the calendar database.

◆ deletedIncidences()

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

◆ duplicateIncidences()

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

◆ eventCount()

int SqliteStorage::eventCount ( )
virtual

◆ fileChanged

void SqliteStorage::fileChanged ( const QString & path)
slot

◆ incidenceDeletedDate()

QDateTime SqliteStorage::incidenceDeletedDate ( const KCalendarCore::Incidence::Ptr & incidence)
virtual

◆ insertedIncidences()

bool SqliteStorage::insertedIncidences ( KCalendarCore::Incidence::List * list,
const QDateTime & after,
const QString & notebookUid = QString() )
virtual

◆ journalCount()

int SqliteStorage::journalCount ( )
virtual

◆ load() [1/4]

bool SqliteStorage::load ( )
virtual

CalStorage::load()

Implements mKCal::ExtendedStorage.

◆ load() [2/4]

bool SqliteStorage::load ( const QDate & date)
virtual

◆ load() [3/4]

bool SqliteStorage::load ( const QDate & start,
const QDate & end )
virtual

◆ load() [4/4]

bool SqliteStorage::load ( const QString & uid,
const QDateTime & recurrenceId = QDateTime() )
virtual

◆ loadAttendeeIncidences()

bool SqliteStorage::loadAttendeeIncidences ( )
virtual

◆ loadCompletedTodos()

int SqliteStorage::loadCompletedTodos ( bool hasDate,
int limit,
QDateTime * last )
virtual

◆ loadContactIncidences()

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

ExtendedStorage::loadContactIncidences( const KCalendarCore::Person & )

Implements mKCal::ExtendedStorage.

◆ loadContacts()

Person::List SqliteStorage::loadContacts ( )
virtual

◆ loadFutureIncidences()

int SqliteStorage::loadFutureIncidences ( int limit,
QDateTime * last )
virtual

ExtendedStorage::loadFutureIncidences( bool, int, QDateTime* );

Implements mKCal::ExtendedStorage.

◆ loadGeoIncidences() [1/3]

bool SqliteStorage::loadGeoIncidences ( )
virtual

◆ loadGeoIncidences() [2/3]

int SqliteStorage::loadGeoIncidences ( bool hasDate,
int limit,
QDateTime * last )
virtual

ExtendedStorage::loadGeoIncidences( bool, bool, int, QDateTime* );

Implements mKCal::ExtendedStorage.

◆ loadGeoIncidences() [3/3]

bool SqliteStorage::loadGeoIncidences ( float geoLatitude,
float geoLongitude,
float diffLatitude,
float diffLongitude )
virtual

◆ loadIncidenceInstance()

bool SqliteStorage::loadIncidenceInstance ( const QString & instanceIdentifier)
virtual

◆ loadIncidences()

int SqliteStorage::loadIncidences ( bool hasDate,
int limit,
QDateTime * last )
virtual

ExtendedStorage::loadIncidences( bool, bool, int, QDateTime* );

Implements mKCal::ExtendedStorage.

◆ loadJournals() [1/2]

bool SqliteStorage::loadJournals ( )
virtual

◆ loadJournals() [2/2]

int SqliteStorage::loadJournals ( int limit,
QDateTime * last )
virtual

◆ loadNotebookIncidences()

bool SqliteStorage::loadNotebookIncidences ( const QString & notebookUid)
virtual

◆ loadNotebooks()

bool SqliteStorage::loadNotebooks ( )
protectedvirtual

◆ loadPlainIncidences()

bool SqliteStorage::loadPlainIncidences ( )
virtual

◆ loadRecurringIncidences()

bool SqliteStorage::loadRecurringIncidences ( )
virtual

◆ loadSeries()

bool SqliteStorage::loadSeries ( const QString & uid)
virtual

◆ loadUncompletedTodos()

int SqliteStorage::loadUncompletedTodos ( )
virtual

◆ modifiedIncidences()

bool SqliteStorage::modifiedIncidences ( KCalendarCore::Incidence::List * list,
const QDateTime & after,
const QString & notebookUid = QString() )
virtual

◆ modifyNotebook()

bool SqliteStorage::modifyNotebook ( const Notebook::Ptr & nb,
DBOperation dbop )
protectedvirtual

◆ notifyOpened()

bool SqliteStorage::notifyOpened ( const KCalendarCore::Incidence::Ptr & incidence)
virtual

◆ open()

bool SqliteStorage::open ( )
virtual

CalStorage::open()

Implements mKCal::ExtendedStorage.

◆ purgeDeletedIncidences()

bool SqliteStorage::purgeDeletedIncidences ( const KCalendarCore::Incidence::List & list)
virtual

ExtendedStorage::purgeDeletedIncidences(const KCalCore::Incidence::List &)

Implements mKCal::ExtendedStorage.

◆ save() [1/2]

bool SqliteStorage::save ( )
virtual

CalStorage::save()

Implements mKCal::ExtendedStorage.

◆ save() [2/2]

◆ todoCount()

int SqliteStorage::todoCount ( )
virtual

◆ virtual_hook()

void SqliteStorage::virtual_hook ( int id,
void * data )
virtual

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

Generated on Thu Nov 28 2024 16:34:53 for libextendedkcal by doxygen 1.12.0