This class provides a calendar storage as an sqlite database. More...
#include <sqlitestorage.h>
Public Types | |
typedef QSharedPointer< SqliteStorage > | Ptr |
A shared pointer to a SqliteStorage. More... | |
![]() | |
enum | DeleteAction { MarkDeleted , PurgeDeleted } |
Action to be performed on save for deleted incidences. More... | |
typedef QSharedPointer< ExtendedStorage > | Ptr |
A shared pointer to a ExtendedStorage. More... | |
Public Slots | |
void | fileChanged (const QString &path) |
void | queryFinished () |
Public Member Functions | |
SqliteStorage (const ExtendedCalendar::Ptr &cal, const QString &databaseName, bool validateNotebooks=true) | |
Constructs a new SqliteStorage object for Calendar calendar with format format , and storage to file fileName . More... | |
virtual | ~SqliteStorage () |
Destructor. More... | |
QString | databaseName () const |
Returns a string containing the name of the calendar database. More... | |
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 ¬ebookUid) |
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) |
int | loadUnreadInvitationIncidences () |
int | loadOldInvitationIncidences (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 ¬ebookUid=QString()) |
bool | modifiedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after, const QString ¬ebookUid=QString()) |
bool | deletedIncidences (KCalendarCore::Incidence::List *list, const QDateTime &after=QDateTime(), const QString ¬ebookUid=QString()) |
bool | allIncidences (KCalendarCore::Incidence::List *list, const QString ¬ebookUid=QString()) |
bool | duplicateIncidences (KCalendarCore::Incidence::List *list, const KCalendarCore::Incidence::Ptr &incidence, const QString ¬ebookUid=QString()) |
QDateTime | incidenceDeletedDate (const KCalendarCore::Incidence::Ptr &incidence) |
int | eventCount () |
int | todoCount () |
int | journalCount () |
virtual void | virtual_hook (int id, void *data) |
sqlite3_int64 | toOriginTime (const QDateTime &dt) |
Convert datetime to seconds relative to the origin. More... | |
sqlite3_int64 | toLocalOriginTime (const QDateTime &dt) |
Convert local datetime to seconds relative to the origin. More... | |
QDateTime | fromLocalOriginTime (sqlite3_int64 seconds) |
Convert seconds from the origin to clock time. More... | |
QDateTime | fromOriginTime (sqlite3_int64 seconds) |
Convert seconds from the origin to UTC datetime. More... | |
QDateTime | fromOriginTime (sqlite3_int64 seconds, const QByteArray &zonename) |
Convert seconds from the origin to datetime in given timezone. More... | |
![]() | |
ExtendedStorage (const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true) | |
Constructs a new ExtendedStorage object. More... | |
virtual | ~ExtendedStorage () |
Destructor. 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 ¬ebookUid) |
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... | |
Protected Member Functions | |
bool | loadNotebooks () |
bool | reloadNotebooks () |
bool | modifyNotebook (const Notebook::Ptr &nb, DBOperation dbop, bool signal=true) |
![]() | |
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 () |
This class provides a calendar storage as an sqlite database.
typedef QSharedPointer<SqliteStorage> mKCal::SqliteStorage::Ptr |
A shared pointer to a SqliteStorage.
|
explicit |
Constructs a new SqliteStorage object for Calendar calendar
with format format
, and storage to file fileName
.
Private class that helps to provide binary compatibility between releases.
calendar | is a pointer to a valid Calendar object. |
databaseName | is the name of the database containing the Calendar data. |
validateNotebooks | set to true for saving only those incidences that belong to an existing notebook of this storage |
|
virtual |
Destructor.
|
virtual |
|
virtual |
Calendar::CalendarObserver::calendarIncidenceAdded()
Implements mKCal::ExtendedStorage.
|
virtual |
Calendar::CalendarObserver::calendarIncidenceAdditionCanceled()
Implements mKCal::ExtendedStorage.
|
virtual |
Calendar::CalendarObserver::calendarIncidenceChanged()
Implements mKCal::ExtendedStorage.
void mKCal::SqliteStorage::calendarIncidenceCreated | ( | const KCalendarCore::Incidence::Ptr & | incidence | ) |
Calendar::CalendarObserver::calendarIncidenceCreated()
|
virtual |
Calendar::CalendarObserver::calendarIncidenceDeleted()
Implements mKCal::ExtendedStorage.
|
virtual |
Calendar::CalendarObserver::calendarModified()
Implements mKCal::ExtendedStorage.
|
virtual |
Implements mKCal::ExtendedStorage.
|
virtual |
CalStorage::close()
Implements mKCal::ExtendedStorage.
QString SqliteStorage::databaseName | ( | ) | const |
Returns a string containing the name of the calendar database.
|
virtual |
|
virtual |
|
virtual |
Implements mKCal::ExtendedStorage.
|
slot |
QDateTime SqliteStorage::fromLocalOriginTime | ( | sqlite3_int64 | seconds | ) |
Convert seconds from the origin to clock time.
seconds | relative to origin. |
QDateTime SqliteStorage::fromOriginTime | ( | sqlite3_int64 | seconds | ) |
Convert seconds from the origin to UTC datetime.
seconds | relative to origin. |
QDateTime SqliteStorage::fromOriginTime | ( | sqlite3_int64 | seconds, |
const QByteArray & | zonename | ||
) |
Convert seconds from the origin to datetime in given timezone.
seconds | relative to origin. |
zonename | timezone name. |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
CalStorage::load()
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
ExtendedStorage::loadContactIncidences( const KCalendarCore::Person & )
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
ExtendedStorage::loadFutureIncidences( bool, int, QDateTime* );
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
ExtendedStorage::loadGeoIncidences( bool, bool, int, QDateTime* );
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
|
virtual |
ExtendedStorage::loadIncidences( bool, bool, int, QDateTime* );
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Implements mKCal::ExtendedStorage.
|
virtual |
ExtendedStorage::loadInvitationIncidences()
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
CalStorage::open()
Implements mKCal::ExtendedStorage.
|
virtual |
ExtendedStorage::purgeDeletedIncidences(const KCalCore::Incidence::List &)
Implements mKCal::ExtendedStorage.
|
slot |
|
protectedvirtual |
Implements mKCal::ExtendedStorage.
|
virtual |
CalStorage::save()
Implements mKCal::ExtendedStorage.
|
virtual |
|
virtual |
Implements mKCal::ExtendedStorage.
sqlite3_int64 SqliteStorage::toLocalOriginTime | ( | const QDateTime & | dt | ) |
Convert local datetime to seconds relative to the origin.
dt | datetime |
sqlite3_int64 SqliteStorage::toOriginTime | ( | const QDateTime & | dt | ) |
Convert datetime to seconds relative to the origin.
dt | datetime |
|
virtual |