Sqlite format implementation. More...
#include <sqliteformat.h>
Classes | |
class | Private |
Public Types | |
enum | RDateType { RDate = 1 , XDate , RDateTime , XDateTime } |
The different types of rdates. More... | |
enum | CalendarFlag { AllowEvents = (1 << 0) , AllowJournals = (1 << 1) , AllowTodos = (1 << 2) , Shared = (1 << 3) , Master = (1 << 4) , Synchronized = (1 << 5) , ReadOnly = (1 << 6) , Visible = (1 << 7) , RunTimeOnly = (1 << 8) , Default = (1 << 9) , Shareable = (1 << 10) } |
Values stored in the flag column of the calendars table. More... | |
Public Member Functions | |
SqliteFormat (sqlite3 *database, const QTimeZone &timeZone={}) | |
Constructor a new Sqlite Format object. | |
virtual | ~SqliteFormat () |
Destructor. | |
bool | modifyCalendars (const Notebook::Ptr ¬ebook, DBOperation dbop, sqlite3_stmt *stmt, bool isDefault) |
Update notebook data in Calendars table. | |
Notebook::Ptr | selectCalendars (sqlite3_stmt *stmt, bool *isDefault) |
Select notebooks from Calendars table. | |
bool | modifyComponents (const KCalendarCore::Incidence::Ptr &incidence, const QString ¬ebook, DBOperation dbop) |
Update incidence data in Components table. | |
bool | purgeDeletedComponents (const KCalendarCore::Incidence::Ptr &incidence) |
KCalendarCore::Incidence::Ptr | selectComponents (sqlite3_stmt *stmt1, QString ¬ebook) |
Select incidences from Components table. | |
KCalendarCore::Person::List | selectContacts () |
Select contacts and order them by appearances. | |
bool | selectMetadata (int *id) |
bool | incrementTransactionId (int *id) |
sqlite3_int64 | toOriginTime (const QDateTime &dt) |
Convert datetime to seconds relative to the origin. | |
sqlite3_int64 | toLocalOriginTime (const QDateTime &dt) |
Convert local datetime to seconds relative to the origin. | |
QDateTime | fromLocalOriginTime (sqlite3_int64 seconds) |
Convert seconds from the origin to clock time. | |
QDateTime | fromOriginTime (sqlite3_int64 seconds) |
Convert seconds from the origin to UTC datetime. | |
QDateTime | fromOriginTime (sqlite3_int64 seconds, const QByteArray &zonename) |
Convert seconds from the origin to datetime in given timezone. | |
Sqlite format implementation.
This class implements the Sqlite format. It provides methods for loading/saving/converting Sqlite format data into the internal representation as Calendar and Incidences.
SqliteFormat::SqliteFormat | ( | sqlite3 * | database, |
const QTimeZone & | timeZone = {} ) |
Constructor a new Sqlite Format object.
|
virtual |
Destructor.
QDateTime mKCal::SqliteFormat::fromLocalOriginTime | ( | sqlite3_int64 | seconds | ) |
Convert seconds from the origin to clock time.
seconds | relative to origin. |
QDateTime mKCal::SqliteFormat::fromOriginTime | ( | sqlite3_int64 | seconds | ) |
Convert seconds from the origin to UTC datetime.
seconds | relative to origin. |
QDateTime mKCal::SqliteFormat::fromOriginTime | ( | sqlite3_int64 | seconds, |
const QByteArray & | zonename ) |
Convert seconds from the origin to datetime in given timezone.
seconds | relative to origin. |
zonename | timezone name. |
bool SqliteFormat::incrementTransactionId | ( | int * | id | ) |
bool SqliteFormat::modifyCalendars | ( | const Notebook::Ptr & | notebook, |
DBOperation | dbop, | ||
sqlite3_stmt * | stmt, | ||
bool | isDefault ) |
Update notebook data in Calendars table.
notebook | notebook to update |
dbop | database operation |
stmt | prepared sqlite statement for calendars table |
isDefault | if the notebook is the default one in the DB |
bool SqliteFormat::modifyComponents | ( | const KCalendarCore::Incidence::Ptr & | incidence, |
const QString & | notebook, | ||
DBOperation | dbop ) |
Update incidence data in Components table.
incidence | incidence to update |
notebook | notebook of incidence |
dbop | database operation |
bool SqliteFormat::purgeDeletedComponents | ( | const KCalendarCore::Incidence::Ptr & | incidence | ) |
Notebook::Ptr SqliteFormat::selectCalendars | ( | sqlite3_stmt * | stmt, |
bool * | isDefault ) |
Select notebooks from Calendars table.
stmt | prepared sqlite statement for calendars table |
isDefault | true if the selected notebook is the DB default one |
Incidence::Ptr SqliteFormat::selectComponents | ( | sqlite3_stmt * | stmt1, |
QString & | notebook ) |
Select incidences from Components table.
stmt1 | prepared sqlite statement for components table |
notebook | notebook of incidence |
KCalendarCore::Person::List mKCal::SqliteFormat::selectContacts | ( | ) |
Select contacts and order them by appearances.
bool SqliteFormat::selectMetadata | ( | int * | id | ) |
sqlite3_int64 mKCal::SqliteFormat::toLocalOriginTime | ( | const QDateTime & | dt | ) |
Convert local datetime to seconds relative to the origin.
dt | datetime |
sqlite3_int64 mKCal::SqliteFormat::toOriginTime | ( | const QDateTime & | dt | ) |
Convert datetime to seconds relative to the origin.
dt | datetime |