mKCal::SqliteFormat Class Reference

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 &notebook, 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 &notebook, DBOperation dbop)
 Update incidence data in Components table.
 
bool purgeDeletedComponents (const KCalendarCore::Incidence::Ptr &incidence)
 
KCalendarCore::Incidence::Ptr selectComponents (sqlite3_stmt *stmt1, QString &notebook)
 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.
 

Detailed Description

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.

Member Enumeration Documentation

◆ CalendarFlag

Values stored in the flag column of the calendars table.

Enumerator
AllowEvents 
AllowJournals 
AllowTodos 
Shared 
Master 
Synchronized 
ReadOnly 
Visible 
RunTimeOnly 
Default 
Shareable 

◆ RDateType

The different types of rdates.

Enumerator
RDate 
XDate 
RDateTime 
XDateTime 

Constructor & Destructor Documentation

◆ SqliteFormat()

SqliteFormat::SqliteFormat ( sqlite3 * database,
const QTimeZone & timeZone = {} )

Constructor a new Sqlite Format object.

◆ ~SqliteFormat()

SqliteFormat::~SqliteFormat ( )
virtual

Destructor.

Member Function Documentation

◆ fromLocalOriginTime()

QDateTime mKCal::SqliteFormat::fromLocalOriginTime ( sqlite3_int64 seconds)

Convert seconds from the origin to clock time.

Parameters
secondsrelative to origin.
Returns
clocktime datetime.

◆ fromOriginTime() [1/2]

QDateTime mKCal::SqliteFormat::fromOriginTime ( sqlite3_int64 seconds)

Convert seconds from the origin to UTC datetime.

Parameters
secondsrelative to origin.
Returns
UTC datetime.

◆ fromOriginTime() [2/2]

QDateTime mKCal::SqliteFormat::fromOriginTime ( sqlite3_int64 seconds,
const QByteArray & zonename )

Convert seconds from the origin to datetime in given timezone.

Parameters
secondsrelative to origin.
zonenametimezone name.
Returns
datetime in timezone.

◆ incrementTransactionId()

bool SqliteFormat::incrementTransactionId ( int * id)

◆ modifyCalendars()

bool SqliteFormat::modifyCalendars ( const Notebook::Ptr & notebook,
DBOperation dbop,
sqlite3_stmt * stmt,
bool isDefault )

Update notebook data in Calendars table.

Parameters
notebooknotebook to update
dbopdatabase operation
stmtprepared sqlite statement for calendars table
isDefaultif the notebook is the default one in the DB
Returns
true if the operation was successful; false otherwise.

◆ modifyComponents()

bool SqliteFormat::modifyComponents ( const KCalendarCore::Incidence::Ptr & incidence,
const QString & notebook,
DBOperation dbop )

Update incidence data in Components table.

Parameters
incidenceincidence to update
notebooknotebook of incidence
dbopdatabase operation
Returns
true if the operation was successful; false otherwise.

◆ purgeDeletedComponents()

bool SqliteFormat::purgeDeletedComponents ( const KCalendarCore::Incidence::Ptr & incidence)

◆ selectCalendars()

Notebook::Ptr SqliteFormat::selectCalendars ( sqlite3_stmt * stmt,
bool * isDefault )

Select notebooks from Calendars table.

Parameters
stmtprepared sqlite statement for calendars table
isDefaulttrue if the selected notebook is the DB default one
Returns
the queried notebook.

◆ selectComponents()

Incidence::Ptr SqliteFormat::selectComponents ( sqlite3_stmt * stmt1,
QString & notebook )

Select incidences from Components table.

Parameters
stmt1prepared sqlite statement for components table
notebooknotebook of incidence
Returns
the queried incidence.

◆ selectContacts()

KCalendarCore::Person::List mKCal::SqliteFormat::selectContacts ( )

Select contacts and order them by appearances.

Returns
ordered list of contacts.

◆ selectMetadata()

bool SqliteFormat::selectMetadata ( int * id)

◆ toLocalOriginTime()

sqlite3_int64 mKCal::SqliteFormat::toLocalOriginTime ( const QDateTime & dt)

Convert local datetime to seconds relative to the origin.

Parameters
dtdatetime
Returns
seconds relative to origin

◆ toOriginTime()

sqlite3_int64 mKCal::SqliteFormat::toOriginTime ( const QDateTime & dt)

Convert datetime to seconds relative to the origin.

Parameters
dtdatetime
Returns
seconds relative to origin

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