CMulticalendar Class Reference

CMulticalendar class is a single point of entry to access the calendar backend. The design pattern used is Facade, hence this class is face of the calendar-backend. There can be only one instance of CMulticalendar per process. It has API's for calendar management and fetching the components from database. More...

#include <CMulticalendar.h>


Public Member Functions

bool getRequiredDates (time_t iCurrTime, int iFutureDateNum, int iBackDateNum, int &iStartDate, int &iEndDate, vector< string > &vIdList, int &pErrorCode)
int getDateRange (time_t currTime, int iNum, bool iOperation, string &szTemp, int &pErrorCode)
vector< CComponent * > getEventInList (vector< string > listId, vector< int > &vCalId, int &pErrorCode)
CCalendargetSynchronizedCalendar ()
CCalendargetDefaultCalendar ()
bool getICSFileInfo (string szFileName, unsigned int &iEventCount, unsigned int &iTodoCount, unsigned int &iJournalCount, int &pErrorCode)
bool getICSFileInfoProgressive (string szFileName, unsigned int &iEventCount, unsigned int &iTodoCount, unsigned int &iJournalCount, int &pErrorCode, bool *bFileReadingOver, unsigned int iRequestLimit)
void cancelImportIcsFileData ()
string getSynchronizedCalendarName ()
string getCTCapXML ()
bool importIcsFileDataProgressive (string szFileName, int iCalId, string &eventId, int &iDuplicateCountTask, int &iDuplicateCountEvent, int &iDuplicateCountJournal, int &pErrorCode, bool *bFileReadingOver, unsigned int iRequestLimit)
bool importIcsFileData (string szFileName, int iCalId, string &eventId, int &iDuplicateCountTask, int &iDuplicateCountEvent, int &iDuplicateCountJournal, int &pErrorCode)
int totalComponentsRead (string szLine, bool &bError, int &iEventBegin, int &iJournalBegin, int &iToDoBegin, unsigned int &iEventCount, unsigned int &iTodoCount, unsigned int &iJournalCount)
int exportCalendarEntries (int iCalendarId, string szFileName, int &pErrorCode)
bool deleteEventBeyond (int iCalId, time_t iUtc, int &pErrorCode)
bool deleteTodosBeyond (int iCalId, time_t iUtc, int &pErrorCode)
CCalendargetCalendarByName (string szName, int &pErrorCode)
bool deleteJournalsBeyond (int iCalId, time_t iUtc, int &pErrorCode)
bool enableAutomaticDeletion (int iDayBefore, int iMax, int &iLimit, int &pErrorCode)
vector< time_t > getRecurrentTimes (string szRRule, icaltimetype iDtStart, time_t iViewEnd, icaltimezone *pTz, int &pErrorCode, int limit=-1)
bool checkRecurrentTimes (string szRRule, icaltimetype iDtStart, time_t iViewEnd, icaltimezone *pTz, int &pErrorCode)
vector< CComponent * > getComponents (int iCalId, int iType, int iStDate, int iEndDatei, int &pErrorCode)
int getNoofCalendars ()
CCalendaraddCalendar (string szTitle, CalendarColour iColor, int iReadOnly, int iVisible, CalendarType iType, string szCalendarTune, string szCalendarVersion, int &pErrorCode)
bool modifyCalendar (int iId, string szTitle, CalendarColour iColor, int iReadOnly, int iVisible, CalendarType iType, string szCalendarTune, string szCalendarVersion, int &pErrorCode)
bool deleteCalendar (int iCalId, int &pErrorCode)
CCalendargetCalendarById (int iCalId, int &pErrorCode)
vector< CComponent * > getComponentsAllCalendars (int iStDate, int iEndDate, int iLimit, int iOffset, vector< int > &vCalid, int &pErrorCode)
vector< CComponent * > getAllEventsTodos (int iCalid, int iStDate, int iEndDate, int iLimit, int iOffset, int &pErrorCode)
bool deleteEventAndTodoBeyond (int iCalId, time_t iUtc, int iType, int &pErrorCode)
bool addEvent (CEvent *pEvent, int iCalendarId, int &pErrorCode)
bool modifyEvent (CEvent *pEvent, int iCalendarId, int &pErrorCode)
bool deleteEvent (int iCalId, string sCompId, int &pErrorCode)
bool addTodo (CTodo *pTodo, int iCalendarId, int &pErrorCode)
bool modifyTodo (CTodo *pTodo, int iCalendarId, int &pErrorCode)
bool deleteTodo (int iCalId, string sCompId, int &pErrorCode)
bool addJournal (CJournal *pJournal, int iCalendarId, int &pErrorCode)
bool modifyJournal (CJournal *pJournal, int iCalendarId, int &pErrorCode)
bool deleteJournal (int iCalId, string sCompId, int &pErrorCode)
int getEventCount (int iCalId, int &pErrorCode)
int getTodoCount (int iCalId, int &pErrorCode)
int getNoteCount (int iCalId, int &pErrorCode)
vector< CCalendar * > getListCalFromMc ()
void releaseListCalendars (vector< CCalendar * > Calendars)
bool modifyCalendar (CCalendar *pCal, int &pErrorCode)
int addCalendar (CCalendar *pCal, int &pErrorCode)
int getNumOfUndoneTasks (int *iCalId, int &pErrorCode)
int getNumOfAllDayEventsForToday (int &pErrorCode)
vector< CComponent * > getTodaysAllDay (int &pErrorCode)
 ~CMulticalendar ()
bool addBirthDay (CBdayEvent *pBday, int &pErrorCode)
bool modifyBirthDay (CBdayEvent *pBday, int &pErrorCode)
bool deleteBirthDay (string szEUid, int &pErrorCode)
CCalendargetCalendarByType (int iCalTypei, int &pErrorCode)
vector< CComponent * > getComponents (int iCalId, int iType, int iStDate, int iEndDate, int iLimit, int iOffset, int &pErrorCode)
int setAutocommitOff ()
bool commitAllChanges ()
bool rollbackAllChanges ()
bool setNextAlarm (int iCalendarId, string sComponentId, int iType, int &pErrorCode)
void setApplicationName (string ApplicationName)
string getApplicationName ()
bool checkCalendarNameExists (string szName)
CComponentgetLatestComponent (int iType, time_t &startdate, int &ioffset, int &pErrorCode)
string getDefaultCalendarName ()
CComponentgetPrevNextComponent (string szId, time_t iDateStart, bool isPrev, int &iCalid, time_t &instance_time, int &perrorcode)
void MCdestroy ()
vector< CComponent * > popEventDetails (QueryResult *pQr)
int getCalendarIdForComponent (string iI, int &pErrorCode)
CCalendargetBirthdayCalendar ()
bool deleteBirthdaysForCalendar (int iCalid, int &pErrorCode)
int getBdayEventCount (int iCalId, int &pErrorCode)
void clearCalendar (int iCalId, int &pErrorCode)
void clearCalendarContents (int iCalId, int &pErrorCode)
icaltimezone * getSystemTimeZoneAsIcalTimeZone ()
void printCurrentTime ()
vector< string > addComponents (vector< CComponent * > &compList, int iCalId, vector< string > &duplicateId, int &ErroCode)
void deleteComponents (vector< string > &idList, int iCalId, int &ErrorCode)
void modifyComponents (vector< CComponent * > &compList, int iCalId, int &ErrorCode)
int getVisibleCalendarCount (int &pErrorCode)
void findRecursiveImpendingEventId (time_t OriginalDateStart, time_t timebasedDateStart, bool isPrev, string &szEventId, time_t &instance_time, int &pErrorCode)
string getEventIdFromMap (map< time_t, string > &timeEventIdMap, time_t &timebasedDateStart, time_t &OriginalDateStart, bool isPrev, time_t &instance_time)
void enableDisableCalendarLogs (int value)
void deleteItemsByIdList (vector< string > &listId, int &pErrorCode)
bool moveFileFromSkel (string oldpath, string newpath)
bool checkFileExists (string szPath)
int getComponentCount (int &pErrorCode)
CEventlocalBdayEventFromRemoteId (string szExId, int &pErrorCode)
bool getInstances (string sId, time_t timeFrom, time_t timeTo, vector< time_t > &result, time_t tzshift=0)
int getInstanceNumber (string sId, time_t timeFrom, time_t timeTo, time_t tzshift=0)
bool dropInstances (string sId)
bool addInstance (string sId, time_t instTime, time_t duration, time_t tzshift=0)
bool addInstances (string sId, vector< time_t > instances, time_t duration, time_t tzshift=0)
vector< CComponent * > getComponentsWithLimitedData (int iStDate, int iEndDate, int iLimit, int iOffset, vector< int > &vCalid, int &pErrorCode)

Static Public Member Functions

static CMulticalendarMCInstance ()
static time_t getSystemTimeShift ()
static string getSystemTimeZone ()

Private Member Functions

 CMulticalendar ()
vector< string > giveRecursiveExpiredEvents (int iCalId, int iType, int iDayBefore, int iMax, int &iLimit, int &pErrorCode)
time_t getInstanceBeyond (string szRRule, icaltimetype iDtStart, time_t iViewEnd, icaltimezone *pTz, int &pErrorCode)
vector< string > giveExpiredEntries (int iCalId, int iType, int iConfiguredTime, int &pErrorCode)
int getCount (int iCalId, int iType, int &pErrorCode)
string generateRrule (int iRepeatType, time_t iUntil, int &pErrorCode)
 CMulticalendar (CMulticalendar &ref)
CMulticalendaroperator= (CMulticalendar &calendardb)
int regenerateInstances ()

Private Attributes

int iMaxId
string AppName

Static Private Attributes

static CMulticalendarpMc = 0


Detailed Description

CMulticalendar class is a single point of entry to access the calendar backend. The design pattern used is Facade, hence this class is face of the calendar-backend. There can be only one instance of CMulticalendar per process. It has API's for calendar management and fetching the components from database.

CMulticalendar class


Constructor & Destructor Documentation

CMulticalendar::~CMulticalendar (  ) 

Destructor for Multicalendar class

Destructor for CMulticalendar class

References CCalendarDB::closeDB(), and CCalendarDB::Instance().

CMulticalendar::CMulticalendar (  )  [private]

Default constructor for CMulticalendar class

Constructor for CMulticalendar class

Referenced by MCInstance().

CMulticalendar::CMulticalendar ( CMulticalendar ref  )  [private]

private Dummy copy constructor because only one object needs to present To make sure copies are not created at runtime


Member Function Documentation

bool CMulticalendar::getRequiredDates ( time_t  iCurrTime,
int  iFutureDateNum,
int  iBackDateNum,
int &  iStartDate,
int &  iEndDate,
vector< string > &  vIdList,
int &  pErrorCode 
)

Function to return the dates ranges for events distributed for given number of days

References getDateRange().

int CMulticalendar::getDateRange ( time_t  currTime,
int  iNum,
bool  iOperation,
string &  szTemp,
int &  pErrorCode 
)

fundtion to find the actual numner of events

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by getRequiredDates().

vector< CComponent * > CMulticalendar::getEventInList ( vector< string >  listId,
vector< int > &  vCalId,
int &  pErrorCode 
)

CCalendar * CMulticalendar::getSynchronizedCalendar (  ) 

Parameters:
NONE 
Returns:
CCalendar* Retrieves existing Synchronized calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed Returns NULL in error case
Parameters:
NONE 
Returns:
CCalendar* Retrieves existing Synchronized calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed Returns 0 in error case

References getListCalFromMc().

CCalendar * CMulticalendar::getDefaultCalendar (  ) 

Parameters:
NONE 
Returns:
CCalendar* Retrieves existing default calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed. Returns NULL in error case
Parameters:
NONE 
Returns:
CCalendar* Retrieves existing default calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed. Returns 0 in error case

References getListCalFromMc().

bool CMulticalendar::getICSFileInfo ( string  szFileName,
unsigned int &  iEventCount,
unsigned int &  iTodoCount,
unsigned int &  iJournalCount,
int &  pErrorCode 
)

Parameters:
string szFilenName
int& iEventCount Count of events in file
int& iTodoCount Number of todos in file
int& iJournalCount Number of journals in file
int& pErrorCode - error indicator
Returns:
bool status of operation
Function to check validy of ICS file and also report entriy count from file.

References ASSERTION, BEGIN_EVENT, and ICalConverter::checkCount().

void CMulticalendar::cancelImportIcsFileData (  ) 

cancelImportIcsFileData

string CMulticalendar::getSynchronizedCalendarName (  ) 

Parameters:
NONE 
Returns:
string Function to retrieve the name of the Synchronized Calendar

References getListCalFromMc(), and releaseListCalendars().

string CMulticalendar::getCTCapXML (  ) 

getCTCapXML

Parameters:
none 
Returns:
string CTC capabilities in XML
Function to get the parameters supported by calendar in XML format

Parameters:
none 
Returns:
string CTC capabilities in XML
Function to get the parameters supported by calendar in XML format

bool CMulticalendar::importIcsFileDataProgressive ( string  szFileName,
int  iCalId,
string &  eventId,
int &  iDuplicateCountTask,
int &  iDuplicateCountEvent,
int &  iDuplicateCountJournal,
int &  pErrorCode,
bool *  bFileReadingOver,
unsigned int  iRequestLimit 
)

Progressive API for importing events

importIcsFileDataProgressive()

Parameters:
 string filename to be imported
 int iCalId Calendar in to which event have to be imported
 string Eventid of added event
 int * pointer to ErrorCode
Returns:
: string cal name This function parses the given ics file .All the entries in the file are added to one calendar.

References addComponents(), ASSERTION, ICalConverter::icalVcalToLocal(), and totalComponentsRead().

bool CMulticalendar::importIcsFileData ( string  szFileName,
int  iCalId,
string &  eventId,
int &  iDuplicateCountTask,
int &  iDuplicateCountEvent,
int &  iDuplicateCountJournal,
int &  pErrorCode 
)

importIcsFileData()

Parameters:
 string filename to be imported
 int iCalId Calendar in to which event have to be imported
 string Eventid of added event
 int * pointer to ErrorCode
Returns:
: string cal name This function parses the given ics file .All the entries in the file are added to one calendar. This is a non progressive API

References addComponents(), ASSERTION, and ICalConverter::icalVcalToLocal().

int CMulticalendar::totalComponentsRead ( string  szLine,
bool &  bError,
int &  iEventBegin,
int &  iJournalBegin,
int &  iToDoBegin,
unsigned int &  iEventCount,
unsigned int &  iTodoCount,
unsigned int &  iJournalCount 
)

Function to fetch the count of component read from file

References BEGIN_EVENT.

Referenced by importIcsFileDataProgressive().

int CMulticalendar::exportCalendarEntries ( int  iCalendarId,
string  szFileName,
int &  pErrorCode 
)

Parameters:
 CalendarId - Id of the calendar for which export has to happen
 string - filename of the ics file
 int & reference to ErrorCode
Returns:
: boolean status of operation true/false
Export file format will always be in ICAL format.This function exports the given calendar to a ics file.

Parameters:
 CalendarId - Id of the calendar for which export has to happen
 string - filename of the ics file
 int * pointer to ErrorCode
Returns:
: string name of the file
Export file format will always be in ICAL format.This function exports the given calendar to a ics file.

References CCalendar::exportCalendarEntries(), and getCalendarById().

bool CMulticalendar::deleteEventBeyond ( int  iCalId,
time_t  iUtc,
int &  pErrorCode 
)

Parameters:
 int iCalid id of the calendar
 utc time ( int utc) before wich all events should be deleted
 int& pErrorcode reference to errorcode
Returns:
: status of the operation.
Function used to delete events before particular date for a specified calendar ID . This API is specifically designed for applications like synchronization.

Parameters:
 icalid calendar ID
 time utc beyond which all todos should be deleted
 int * pointer to ErrorCode
Returns:
: bool success/failure of the function

References deleteEvent(), getCalendarById(), giveExpiredEntries(), and MCInstance().

Referenced by deleteEventAndTodoBeyond().

bool CMulticalendar::deleteTodosBeyond ( int  iCalId,
time_t  iUtc,
int &  pErrorCode 
)

Parameters:
 int iCalid id of the calendar
 time iUtc( int utc) before wich all todos should be deleted
 int& pErrorcode reference to errorcode
Returns:
:bool status of the operation.
Function used to delete todos before particular date for a specified calendar ID. This API is specifically designed for applications like synchronization.

Parameters:
 int iCalid id of the calendar
 utc time ( int utc) before wich all todos should be deleted
 int * pointer to ErrorCode
Returns:
: status of the operation. Function used to delete todos before particulat date for a specified calendar ID.

References deleteTodo(), getCalendarById(), giveExpiredEntries(), and MCInstance().

Referenced by deleteEventAndTodoBeyond().

CCalendar * CMulticalendar::getCalendarByName ( string  szName,
int &  pErrorCode 
)

Parameters:
 string szName calendar Name
 int& pErrorCode reference to integer
Returns:
: CCalendar* Calendar Pointer
Function used to retrieve CCalendar pointer from DB. user of this API should free the calendar thus obtained.

References getListCalFromMc().

bool CMulticalendar::deleteJournalsBeyond ( int  iCalId,
time_t  iUtc,
int &  pErrorCode 
)

Parameters:
 int iCalid id of the calendar
 time iUtc( int utc) before which all journals should be deleted
 int & pErrorCode reference to integer
Returns:
: status of the operation.
Function used to delete journals before particular date for a specified calendar ID. This API is specifically designed for applications like synchronization.

Parameters:
 int iCalid id of the calendar
 utc time ( int utc) before which all journals should be deleted
 int * pointer to ErrorCode
Returns:
: status of the operation. Function used to delete journals before particular date for a specified calendar ID.

References deleteJournal(), getCalendarById(), giveExpiredEntries(), and MCInstance().

bool CMulticalendar::enableAutomaticDeletion ( int  iDayBefore,
int  iMax,
int &  iLimit,
int &  pErrorCode 
)

Parameters:
 int iDayBefore configuration time for deletion of old events
 int& pErrorcode reference to integer
Returns:
: bool result of operation
This function has to be called when ever clean up of old events and todos is required for given calendar ID. All events before the days specified are deleted All Todos which are marked done and are before specified days are deleted Journals are never deleted.

Parameters:
 int configuration time for deletion of old events
 int * pointer to ErrorCode
Returns:
: bool result of operation
This function has to be called when ever clean up of old events and todos is required for given calendar ID.

References ASSERTION, CComponent::getDateEnd(), CComponent::getDateStart(), CCalendarDB::getDb(), CComponent::getId(), getInstanceBeyond(), getListCalFromMc(), CCalendarDB::getRecords(), getSystemTimeZone(), CComponent::getTzid(), giveRecursiveExpiredEvents(), CCalendarDB::Instance(), modifyComponents(), releaseListCalendars(), CComponent::setDateEnd(), CComponent::setDateStart(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

vector< time_t > CMulticalendar::getRecurrentTimes ( string  szRRule,
icaltimetype  iDtStart,
time_t  iViewEnd,
icaltimezone *  pTz,
int &  pErrorCode,
int  limit = -1 
)

Parameters:
 string rrule recurrencerule
 icaltimetype iDtdtstart datestart in Icaltime format.
 time_t iViewEnd end range of current claendar view
 int& pErrorCode pointer to ErrorCode
 int limit will return if this number of instances has found
Returns:
: vector of recurrent times
Function to parse the time of occurrances from recurrence rules. For a recursive entry if rule is provided along with Datestart and view range then it will return the set of times in view range. This API is used by caledar-UI.

Parameters:
 rrule recurrencerule
 dtstart datestart in Icaltime format.
 viewEnd end range of current claendar view
Returns:
: vector of recurrent times
Function to parse the time of occurrances from recurrence rules.

Referenced by checkRecurrentTimes(), CRecurrence::generateInstanceTimes(), ICalConverter::getImpendingAlarm(), getLocation(), CCalendar::manageCookie(), and CCalendar::setNextAlarm().

bool CMulticalendar::checkRecurrentTimes ( string  szRRule,
icaltimetype  iDtStart,
time_t  iViewEnd,
icaltimezone *  pTz,
int &  pErrorCode 
)

Parameters:
 string rrule recurrencerule
 icaltimetype iDtdtstart datestart in Icaltime format.
 time_t iViewEnd end range of current claendar view
 int& pErrorCode pointer to ErrorCode
Returns:
: true if found
Function to parse the time of occurrances from recurrence rules. For a recursive entry if rule is provided along with Datestart and view range then it will return the set of times in view range. This API is used by caledar-UI.

Parameters:
 rrule recurrencerule
 dtstart datestart in Icaltime format.
 viewEnd end range of current claendar view
Returns:
: true or false
Function to parse the time of occurrances from recurrence rules.

References getRecurrentTimes().

Referenced by CRecurrence::checkInstances().

vector< CComponent * > CMulticalendar::getComponents ( int  iCalId,
int  iType,
int  iStDate,
int  iEndDate,
int &  pErrorCode 
)

Parameters:
 int iCalId Calendar ID
 int iType 1 -> EVENT 2 -> TODO 3 -> JOURNAL
 int iStDate to do conditional fetching based on start date. -1 in case of no conditions
 int iEndDate to do conditional fetching based on end date. -1 in case of no conditions
 int & refernce to ErrorCode
Returns:
: Vector for CComponent
This function is used to get all the entries associated with particular component type. NOTE : API user has to free memory occupied by vector<CComponent*>

Parameters:
 calid Calendar ID
 type 1 -> EVENT 2 -> TODO 3 -> JOURNAL
 stDate to do conditional fetching based on start date. -1 in case of no conditions
 endDate to do conditional fetching based on end date. -1 in case of no conditions
 int * pointer to ErrorCode
Returns:
: Vector for CComponent
This function is used to get all the entries associated with particular component type. NOTE : API user has to free memory occupied by vector<CComponent*>

References getCalendarById(), and CCalendar::getComponents().

int CMulticalendar::getNoofCalendars (  ) 

Parameters:
 NONE
Returns:
: int Number of calendars in database
This function is called to get number of existing calendars from DB.

getNoofCalendars ()

Parameters:
 NONE
Returns:
: int Number of calendars in database
This function is called to get number of calendars from DB.

References getListCalFromMc(), and releaseListCalendars().

CCalendar * CMulticalendar::addCalendar ( string  szTitle,
CalendarColour  iColor,
int  iReadOnly,
int  iVisible,
CalendarType  iType,
string  szCalendarTune,
string  szCalendarVersion,
int &  pErrorCode 
)

Parameters:
 string szTitle title of the calendar
 CalendarColour colour of the calendar
 int readonly flag
 int visible flag
 CalendarType type of the calendar
 string szCalendarTune Calendar tune
 string szCalendarVersion Calendar version
 int& refernce to ErrorCode
Returns:
: Newly created calendar pointer, NULL in case of any error
This function is called to add a new calendar into the database. It is an overloaded API used by UI.

Parameters:
 title title of the calendar
 CalendarColour colour of the calendar
 int readonly flag
 int visible flag
 CalendarType type of the calendar
 string szCalendarTune Calendar tune
 string szCalendarversion Calendar Version
 int * pointer to ErrorCode
Returns:
: newly created calendar pointer
This function is called to add a new calendar into the database.

bool CMulticalendar::modifyCalendar ( int  iId,
string  szTitle,
CalendarColour  iColor,
int  iReadOnly,
int  iVisible,
CalendarType  iType,
string  szCalendarTune,
string  szCalendarVersion,
int &  pErrorCode 
)

Parameters:
 int iId of the calendar
 string szTitle title of the calendar
 CalendarColour colour of the calendar
 int iReadonly flag
 int iVisible flag
 string szCalendarTune Calendar tune
 string szCalendarVersion Calendar version
 CalendarType type of the calendar
 int reference to ErrorCode
Returns:
: bool (True/False)
This function is called to modify the calendar record in the database.

Parameters:
 Id of the calendar
 title title of the calendar
 CalendarColour colour of the calendar
 int readonly flag
 int visible flag
 CalendarType type of the calendar
 string CalendarTune of the calendar
 string CalendarVersion of the calendar
 int * pointer to ErrorCode
Returns:
: bool (SUCCESS/FAILURE)
This function is called to modify the calendar record in the database.

References CCalendar::setCalendarId().

bool CMulticalendar::deleteCalendar ( int  iCalId,
int &  pErrorCode 
)

Parameters:
 int iCalid Calendar id
 int & reference to ErrorCode
Returns:
: SUCCESS/FAILURE
This function is used to delete the calendar from database.

Parameters:
 calid Calendar id
 int * pointer to ErrorCode
Returns:
: SUCCESS/FAILURE
This function is used to delete the calendar from database.

References ASSERTION, clearCalendar(), commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::getCalendarType(), CCalendarDB::getDb(), CCalendarDB::Instance(), rollbackAllChanges(), setAutocommitOff(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

CCalendar * CMulticalendar::getCalendarById ( int  iCalId,
int &  pErrorCode 
)

vector< CComponent * > CMulticalendar::getComponentsAllCalendars ( int  iStDate,
int  iEndDate,
int  iLimit,
int  iOffset,
vector< int > &  vCalid,
int &  pErrorCode 
)

Parameters:
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit Max limit of components to be obtanined by this function call
: offset from which we need to fetch
: vector<int> vCalid reference to place holder for calenadr id for each entry
 int * pointer to ErrorCode
Returns:
: Vector for CComponent
This function is overloaded API for fetching entries for all calendars at a time progressively

Parameters:
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit Max limit of components to be obtanined by this function call
: offset from which we need to fetch
: vector<int> vCalid reference to place holder for calenadr id for each entry
 int * pointer to ErrorCode
Returns:
: Vector for CComponent
This function is overloaded API for fetching entries for all calendars at a time progressively

define SELECT_ALL_CALCOMP__UNION "select * from %s where ((%s = %d AND %s < %d AND %s >= %d) OR ( %s = %d AND %s >= %d AND %s <= %d )) AND (%s != %d AND %s != %d) AND calendarId in (select calendarid from calendars where IsVisible =1 ) union select * from %s where (%s = %d OR %s=%d) AND (%s = %d OR %s = %d) AND (%d < %s OR %d = %s) AND calendarId in (select calendarid from calendars where IsVisible =1) ORDER BY CalendarId LIMIT %d OFFSET %d "

References ASSERTION, CComponent::getAlarmProperties(), CComponent::getFlags(), CComponent::getId(), CComponent::getInstanceNumber(), CCalendarDB::getRecords(), CComponent::getRecurrenceProperties(), CComponent::getType(), CCalendarDB::Instance(), CComponent::setDescription(), CComponent::setGUid(), CComponent::setId(), CComponent::setLocation(), CComponent::setSummary(), CComponent::setTzid(), CCalendarDB::sqliteErrorMapper(), and CComponent::toString().

vector< CComponent * > CMulticalendar::getAllEventsTodos ( int  iCalid,
int  iStDate,
int  iEndDate,
int  iLimit,
int  iOffset,
int &  pErrorCode 
)

Parameters:
: iCalid Id of the Calendar for which event belongs
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit limit for number of events fetched by the calenadr
int * pErrorCode error code if any
Returns:
: Vector for CComponent This function is used to get all the Events /Todos /Bdays associated with particular Calendar progressively It is an overloaded API for get componets used to fetch Components in bursts of specified size
Parameters:
: iCalid Id of the Calendar for which event belongs
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit limit for number of events fetched by the calenadr
int * pErrorCode error code if any
Returns:
: Vector for CComponent This function is used to get all the Events /Todos /Bdays associated with particular Calendar progressively It is an overloaded API for get componets used to fetch Components in bursts of specified size

References CCalendar::getAllEventsTodos(), getCalendarById(), and MCInstance().

bool CMulticalendar::deleteEventAndTodoBeyond ( int  iCalId,
time_t  iUtc,
int  iType,
int &  pErrorCode 
)

Parameters:
 icalid calendar ID
 time utc beyond which all todos should be deleted
 iType Component type
 int * pointer to ErrorCode
Returns:
: bool success/failure of the function
Function to delete Events/Todos beyond a particular date

References ASSERTION, deleteEventBeyond(), deleteTodosBeyond(), and MCInstance().

bool CMulticalendar::addEvent ( CEvent pEvent,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 CEvent *CEvent object pointer
 int iCalendarId calendar ID
 int & reference to ErrorCode
Returns:
: bool
Function used to add the Event using CMulticalendar class.In successful scenario Id of the newly added event will be set in the passed pEvent object itself. Can be retrieved using pEvent->getId();

Parameters:
 ptr CEvent object pointer
 calendarId calendar ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to add the Event using CMulticalendar class.

References CCalendar::addEvent(), commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::modifyEvent ( CEvent pEvent,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 ptr CEvent object pointer
 calendarId calendar ID
 int * pointer reference to ErrorCode
Returns:
: bool
Function used to modify the Event using CMulticalendar class.

Parameters:
 ptr CEvent object pointer
 calendarId calendar ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to modify the Event using CMulticalendar class.

References commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::modifyEvent(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::deleteEvent ( int  iCalId,
string  sCompId,
int &  pErrorCode 
)

Parameters:
 cal_id Calendar id
 compId Event ID
 int * pointer reference to ErrorCode
Returns:
: bool
Function used to delete the Event using CMulticalendar class.

Parameters:
 cal_id Calendar id
 compId Event ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to delete the Event using CMulticalendar class.

References commitAllChanges(), CCalendar::deleteEvent(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

Referenced by deleteEventBeyond().

bool CMulticalendar::addTodo ( CTodo pTodo,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 ptr CTodo object pointer
 calendarId calendar ID
 int * pointer reference to ErrorCode
Returns:
: NONE
Function used to add the Todo using CMulticalendar class.If addition is successful then the id of newly created task will be set in passed CTodo object itself. Can be retrieved using pTodo->getId()

Parameters:
 ptr CTodo object pointer
 calendarId calendar ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to add the Todo using CMulticalendar class.

References CCalendar::addTodo(), commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::modifyTodo ( CTodo pTodo,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 ptr CTodo object pointer
 calendarId calendar ID
 int * pointer reference to ErrorCode
Returns:
: bool
Function used to modify the Todo using CMulticalendar class.

Parameters:
 ptr CTodo object pointer
 calendarId calendar ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to modify the Todo using CMulticalendar class.

References commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::modifyTodo(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::deleteTodo ( int  iCalId,
string  sCompId,
int &  pErrorCode 
)

Parameters:
 cal_id Calendar id
 compId Todo ID
 int * pointer reference to ErrorCode
Returns:
: Bool
Function used to delete the Todo using CMulticalendar class.

Parameters:
 cal_id Calendar id
 compId Todo ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to delete the Todo using CMulticalendar class.

References commitAllChanges(), CCalendar::deleteTodo(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

Referenced by deleteTodosBeyond().

bool CMulticalendar::addJournal ( CJournal pJournal,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 ptr CJournal object pointer
 calendarId calendar ID
 int * pointer reference to ErrorCode
Returns:
: bool
Function used to add the Journal using CMulticalendar class.

Parameters:
 ptr CJournal object pointer
 calendarId calendar ID
 int * pointer to ErrorCode
Returns:
: bool
Function used to add the Journal using CMulticalendar class.

References CCalendar::addJournal(), commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::modifyJournal ( CJournal pJournal,
int  iCalendarId,
int &  pErrorCode 
)

Parameters:
 CJournal* pJournal pointer to CJournal.
 int iCalendarId Calendar id
 int reference to error code.
Returns:
bool
Function used to modify the Journal using CMulticalendar class.

Parameters:
 ptr CJournal object pointer
 calendarId Calendar id
 int * pointer to ErrorCode
Returns:
bool
Function used to modify the Journal using CMulticalendar class.

References commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::modifyJournal(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::deleteJournal ( int  iCalId,
string  sCompId,
int &  pErrorCode 
)

Parameters:
 int iCalId Calendar id
 string sCompId Journal id
 int reference to error code
Returns:
: bool
Function used to delete the journal using CMulticalendar class

Parameters:
 cal_id Calendar id
 compId Journal id
 int * pointer to ErrorCode
Returns:
: bool
Function used to delete the journal using CMulticalendar class

References commitAllChanges(), CCalendar::deleteJournal(), getCalendarById(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

Referenced by deleteJournalsBeyond().

CMulticalendar * CMulticalendar::MCInstance (  )  [static]

int CMulticalendar::getEventCount ( int  iCalId,
int &  pErrorCode 
)

Parameters:
 int iCalid Calendar id
 int & reference to error code.
Returns:
: integer event count
Function used to get the number of events for particular calendar in DB.

Parameters:
 iCalid Calendar id
 int * pointer to ErrorCode
Returns:
: integer event count
Function used to get the number of events for particular calendar in DB.

References getCount().

int CMulticalendar::getTodoCount ( int  iCalId,
int &  pErrorCode 
)

Parameters:
 int iCalid calendar ID
 int & reference to error code
Returns:
: integer todo count
Function used to get the number of Todos for particular calenadar in DB.

Parameters:
 iCalid
 int * pointer to ErrorCode
Returns:
: integer todo count
Function used to get the number of Todos for particular calenadar in DB.

References getCount().

int CMulticalendar::getNoteCount ( int  iCalId,
int &  pErrorCode 
)

Parameters:
 int iCalid calenadar Id
 int * pointer reference to ErrorCode
Returns:
: integer journal count
Function used to get the number of journals for particular calenadar in DB .

Parameters:
 ICalid
 int * pointer to ErrorCode
Returns:
: integer journal count
Function used to get the number of journals for particular calenadar in DB .

References getCount().

vector< CCalendar * > CMulticalendar::getListCalFromMc (  ) 

void CMulticalendar::releaseListCalendars ( vector< CCalendar * >  Calendars  ) 

Parameters:
 Vector of CCalendar*
Returns:
: NONE
Function to release a list of calendars.

Referenced by checkCalendarNameExists(), enableAutomaticDeletion(), getDefaultCalendarName(), getNoofCalendars(), getSynchronizedCalendarName(), and modifyCalendar().

bool CMulticalendar::modifyCalendar ( CCalendar pCal,
int &  pErrorCode 
)

Parameters:
 CCalendar* pCal Pointer to CCalendar object
 int refernce to ErrorCode
Returns:
: bool (SUCCESS/FAILURE)
This function is called to modify the calendar record in the database.

Parameters:
 pCal Pointer to CCalendar object
 int * pointer to ErrorCode
Returns:
: bool (SUCCESS/FAILURE)
This function is called to modify the calendar record in the database.

References ASSERTION, commitAllChanges(), CCalendar::destroyExistingValidAlarms(), CCalendar::getCalendarColor(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::getCalendarTune(), CCalendar::getCalendarType(), CCalendar::getCalendarVersion(), CCalendarDB::getDb(), getListCalFromMc(), CCalendar::getProfileType(), CCalendarDB::Instance(), CCalendar::IsReadOnly(), CCalendar::IsShown(), CCalendar::registerAlarmForVisibleCalendar(), releaseListCalendars(), rollbackAllChanges(), setAutocommitOff(), CCalendar::setCalendarType(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

int CMulticalendar::addCalendar ( CCalendar pCal,
int &  pErrorCode 
)

Parameters:
 pCal pointer to CCalendar object
 int& reference to ErrorCode
Returns:
: newly created calendar Id
This function is called to add a new calendar into the database. It is an overloaded API. Calendar pointer object passed should be freed by the API user.

Parameters:
 pCal pointer to CCalendar object
 int * pointer to ErrorCode
Returns:
: success/failure
This function is called to add a new calendar into the database.

References ASSERTION, checkCalendarNameExists(), commitAllChanges(), CCalendar::getCalendarColor(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::getCalendarTune(), CCalendar::getCalendarType(), CCalendar::getCalendarVersion(), CCalendarDB::getDb(), CCalendar::getProfileType(), CCalendarDB::insertRows(), CCalendarDB::Instance(), CCalendar::IsReadOnly(), CCalendar::IsShown(), rollbackAllChanges(), setAutocommitOff(), CCalendar::setCalendarId(), and CCalendarDB::sqliteErrorMapper().

int CMulticalendar::getNumOfUndoneTasks ( int *  iCalId,
int &  pErrorCode 
)

Parameters:
iCalId int
Returns:
int
This function is used to get the number of undone tasks. This function returns the calendar id in outparam iCalId if there is only one undone task.

select * from components where Status =0 AND ComponentType =2 AND CalendarId in (select CalendarId from calendars where IsVisible =1);

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

int CMulticalendar::getNumOfAllDayEventsForToday ( int &  pErrorCode  ) 

Parameters:
pErrorCode int
Returns:
int
This function is used to get the number of allday events for today.

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

vector< CComponent * > CMulticalendar::getTodaysAllDay ( int &  pErrorCode  ) 

bool CMulticalendar::addBirthDay ( CBdayEvent pBday,
int &  pErrorCode 
)

Parameters:
 pBday CBdayEvent object pointer
 int &refernce to ErrorCode
Returns:
: bool (SUCESS/FAILURE)
Function used to add the Birthday data using CMulticalendar class. Id of the newly added birthdayevent will be set inside the CBdayEvent object and can be retrieved using pBday->getId()

Parameters:
 pBday CBdayEvent object pointer
 int * pointer to ErrorCode
Returns:
: bool (SUCESS/FAILURE)
Function used to add the Birthday data using CMulticalendar class.

References CCalendar::addBirthDay(), commitAllChanges(), getCalendarByType(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::modifyBirthDay ( CBdayEvent pBday,
int &  pErrorCode 
)

Parameters:
 pBday CBdayEvent object pointer
 int reference to ErrorCode
Returns:
: bool (SUCCESS/FAILURE)
Function used to modify the Birthdays using CMulticalendar class.

Parameters:
 pBday CBdayEvent object pointer
 int * pointer to ErrorCode
Returns:
: bool (SUCCESS/FAILURE)
Function used to modify the Birthdays using CMulticalendar class.

References commitAllChanges(), getCalendarByType(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::modifyBirthDay(), rollbackAllChanges(), and setAutocommitOff().

bool CMulticalendar::deleteBirthDay ( string  szEUid,
int &  pErrorCode 
)

Parameters:
 string szEUid Id of the birthday event
 int& pointer to ErrorCode
Returns:
: boolean (SUCCESS/FAILURE)
Function used to delete the Event using CMulticalendar class.

Parameters:
 eUid Ebook Uid
 int & pointer to ErrorCode
Returns:
: boolean (SUCCESS/FAILURE)
Function used to delete the Event using CMulticalendar class.

References commitAllChanges(), CCalendar::deleteBirthDay(), getCalendarByType(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), rollbackAllChanges(), and setAutocommitOff().

CCalendar * CMulticalendar::getCalendarByType ( int  iCalType,
int &  pErrorCode 
)

Parameters:
 iCalType Calendar Type
 int & irefernce to ErrorCode
Returns:
: CCalendar object
Function used to get the calendar object based on calendar type. CCalendar object thus obtained should be freed by the API user.

References getListCalFromMc().

Referenced by addBirthDay(), deleteBirthDay(), and modifyBirthDay().

vector< CComponent * > CMulticalendar::getComponents ( int  iCalId,
int  iType,
int  iStDate,
int  iEndDate,
int  iLimit,
int  iOffset,
int &  pErrorCode 
)

Parameters:
: int iCalid Calendar ID
: type 1 -> EVENT 2 -> TODO 3 -> JOURNAL 4 -> BDAY
: int stDate to do conditional fetching based on start date. -1 in case of no conditions
: int endDate to do conditional fetching based on end date. -1 in case of no conditions
: int limit Max limit of components to be obtanined by this function call
: int offset from which we need to fetch
 int& reference to ErrorCode
Returns:
: Vector of CComponent*
For vector<CComponent*> memory is allocated inside this procedure , it has to be freed by the API user. This function is overloaded API for Progressive updation , used by calendar UI.

getComponents ()

Parameters:
: calid Calendar ID
: type 1 -> EVENT 2 -> TODO 3 -> JOURNAL 4 -> BDAY
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit Max limit of components to be obtanined by this function call
: offset from which we need to fetch
 int * pointer to ErrorCode
Returns:
: Vector for CComponent
This function is overloaded API for Progressive updation.

References getCalendarById(), and CCalendar::getComponents().

int CMulticalendar::setAutocommitOff (  ) 

Parameters:
 none
Returns:
: int SUCCESS/FAILURE
Function to set the autocommit off in sqlite database. Autocommit by default is in "ON" state. While doing Mass logical updations this can be turned to "OFF" state by calling this API.

Parameters:
 none
Returns:
: int SUCCESS/FAILURE
Function to set the autocommit off in sqlite database.

References ASSERTION, CCalendarDB::Instance(), and CCalendarDB::setAutocommitOff().

Referenced by addBirthDay(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), clearCalendarContents(), deleteBirthDay(), deleteBirthdaysForCalendar(), deleteCalendar(), deleteComponents(), deleteEvent(), deleteJournal(), deleteTodo(), modifyBirthDay(), modifyCalendar(), modifyComponents(), modifyEvent(), modifyJournal(), modifyTodo(), and setNextAlarm().

bool CMulticalendar::commitAllChanges (  ) 

Parameters:
NONE 
Returns:
: bool TRUE/FALSE
Function to commit all the changes made into database. If Auto commit is turned "OFF" using setAutocommitOff then all changes acan be commited using this API. Only in case of Mass Logical updations this will happen.

Parameters:
 string DBus message to be sent when commit happens
Returns:
: bool TRUE/FALSE
Function to commit all the changes made into database.

References ASSERTION, CCalendarDB::commitDB(), CCalendarDB::Instance(), and intToString().

Referenced by addBirthDay(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), clearCalendarContents(), deleteBirthDay(), deleteBirthdaysForCalendar(), deleteCalendar(), deleteComponents(), deleteEvent(), deleteJournal(), deleteTodo(), modifyBirthDay(), modifyCalendar(), modifyComponents(), modifyEvent(), modifyJournal(), modifyTodo(), and setNextAlarm().

bool CMulticalendar::rollbackAllChanges (  ) 

Parameters:
 none
Returns:
: bool TRUE/FALSE
Function to rollback all the changes made into database. Rollback function to cancel all the changes done to DB.

Parameters:
 none
Returns:
: bool TRUE/FALSE
Function to rollback all the changes made into database.

References ASSERTION, CCalendarDB::Instance(), and CCalendarDB::rollbackDB().

Referenced by addBirthDay(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), clearCalendar(), clearCalendarContents(), deleteBirthDay(), deleteBirthdaysForCalendar(), deleteCalendar(), deleteComponents(), deleteEvent(), deleteJournal(), deleteTodo(), modifyBirthDay(), modifyCalendar(), modifyComponents(), modifyEvent(), modifyJournal(), modifyTodo(), and setNextAlarm().

bool CMulticalendar::setNextAlarm ( int  iCalendarId,
string  sComponentId,
int  iType,
int &  pErrorCode 
)

Parameters:
: int iCalendar of the calendar
: string sComponentId of the component
: int iType Component type
: int& reference to errorcode
Returns:
bool : returns SUCCESS/FAILURE of the function
This function sets the alarm for the given component of the calendar. For any recursive event with ALARM , only one alarm is stored in DB Up on the invocation of alarm next impending alarm is calculated and set TODO: Can be made private As outside applications need not use it.

setNextAlarm()

Parameters:
: int id of the calendar
: string id of the component
: int errorcode
Returns:
bool : returns SUCCESS/FAILURE of the function
This function sets the alarm for the given component of the calendar.

References commitAllChanges(), getCalendarById(), rollbackAllChanges(), setAutocommitOff(), and CCalendar::setNextAlarm().

void CMulticalendar::setApplicationName ( string  ApplicationName  ) 

Parameters:
 string name of the application
Returns:
: void
This function sets the given name as the application name.

string CMulticalendar::getApplicationName (  ) 

Parameters:
: None
Returns:
: string name of the application
This function sets the given name as the application name.

Referenced by CCalendarDB::sendDBusMessage().

bool CMulticalendar::checkCalendarNameExists ( string  szName  ) 

Parameters:
string szName Name of Calendar
Returns:
bool true/fals
Function to check whether the calendar name exists or not

Parameters:
szName Name of Calendar
Returns:
bool
Function to check whether the calendar name exists or not

References getListCalFromMc(), and releaseListCalendars().

Referenced by addCalendar().

CComponent * CMulticalendar::getLatestComponent ( int  iType,
time_t &  startdate,
int &  ioffset,
int &  pErrorCode 
)

Parameters:
int iType Can be Event or todo( E_EVENT,E_TODO)
time_t time beyond which event can be fetched
ioffset - offset period on which the event can be fetched
int reference pErrorCode , error code to define the possible errros Function used by calendar applet to retrieve the latest components Function to retrieve upcoming events,todos
function used by applet to retrieve the latest components
Parameters:
type Can be Event or todo
ioffset offset from which the event can be fetched
pErrorCode,error code to define the possible errros
Function to retrieve upcoming events The usage of API - First

References ASSERTION, CComponent::getAllDay(), CCalendar::getBirthDayEvent(), getCalendarById(), CCalendar::getCalendarType(), CComponent::getDateStart(), CCalendar::getEvent(), CComponent::getId(), CCalendarDB::getRecords(), CComponent::getSummary(), CComponent::getTzid(), CCalendarDB::Instance(), CCalendar::IsShown(), CComponent::setAllDay(), CComponent::setDateStart(), CComponent::setId(), CComponent::setStatus(), CComponent::setSummary(), CComponent::setTzid(), and CCalendarDB::sqliteErrorMapper().

string CMulticalendar::getDefaultCalendarName (  ) 

Parameters:
NONE 
Returns:
string
Function to retrieve the name of the Default Calendar

Parameters:
NONE 
Returns:
string Function to retrieve the name of the Default Calendar

References getListCalFromMc(), and releaseListCalendars().

CComponent * CMulticalendar::getPrevNextComponent ( string  szId,
time_t  iDateStart,
bool  isPrev,
int &  iCalid,
time_t &  instance_time,
int &  pErrorCode 
)

Parameters:
string Id of the event
datestart of the event
isPrev flag to check query from previous/next event
iCalid calendar Id of the component
perrorcode reference to int to store error code if any
Returns:
CComponent*
Function used to fetch previous and next event in Database based on Date start

Parameters:
string Id of the event
datestart of the event
isPrev flag to check query from previous/next event
iCalid calendar Id of the component
Returns:
CComponent*
Function used to fetch previous and next event in Database based on Date start

References ASSERTION, CCalendar::getBirthDayEvent(), getCalendarById(), CCalendar::getCalendarType(), CComponent::getDateStart(), CCalendar::getEvent(), CCalendarDB::getRecords(), CComponent::getStatus(), CCalendarDB::Instance(), popEventDetails(), and CCalendarDB::sqliteErrorMapper().

void CMulticalendar::MCdestroy (  ) 

Parameters:
NONE 
Returns:
NONE Function used to destroy CMulticalendar object

vector< CComponent * > CMulticalendar::popEventDetails ( QueryResult *  pQr  ) 

int CMulticalendar::getCalendarIdForComponent ( string  iI,
int &  pErrorCode 
)

Parameters:
string iI
error_code 
Returns:
Calendar Id for component 0 in case of error

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

CCalendar * CMulticalendar::getBirthdayCalendar (  ) 

Parameters:
NONE 
Returns:
CCalendar* Retrieves existing Synchronized calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed Returns NULL in error case
Parameters:
NONE 
Returns:
CCalendar* Retrieves existing Synchronized calendar.Calendar pointer thus obtained shouldn't be freed. It will be destroyed when CMulticalendar object is destroyed Returns 0 in error case

References getListCalFromMc().

Referenced by getTodaysAllDay().

bool CMulticalendar::deleteBirthdaysForCalendar ( int  iCalId,
int &  pErrorCode 
)

Parameters:
int iCalid smart calendar Id to be deleted
pErrorcode int reference to error code
Returns:
bool success/failure indicator Function used to delete birthdays for a given calendar

References ASSERTION, commitAllChanges(), CCalendarDB::getDb(), CCalendarDB::Instance(), rollbackAllChanges(), setAutocommitOff(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

int CMulticalendar::getBdayEventCount ( int  iCalId,
int &  pErrorCode 
)

Parameters:
 iCalid Calendar id
 int * pointer to ErrorCode
Returns:
: integer event count
Function used to get the number of Bday events for particular calendar in DB.

References getCount().

time_t CMulticalendar::getSystemTimeShift (  )  [static]

utility API can be used by applications using backend to get the current timezone

References getSystemTimeZone().

string CMulticalendar::getSystemTimeZone (  )  [static]

void CMulticalendar::clearCalendar ( int  iCalId,
int &  pErrorCode 
)

Parameters:
iCalId Calendar Id
pErrorCode - Reference to errror Code
API to Clear the contents of the Calendar

References ASSERTION, CCalendar::destroyExistingValidAlarms(), getCalendarById(), CCalendar::getCalendarType(), CCalendarDB::getDb(), CCalendarDB::Instance(), rollbackAllChanges(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

Referenced by clearCalendarContents(), and deleteCalendar().

void CMulticalendar::clearCalendarContents ( int  iCalId,
int &  pErrorCode 
)

Parameters:
iCalId Calendar Id
pErrorCode - Reference to errror Code
API to Clear the contents of the Calendar

References clearCalendar(), commitAllChanges(), rollbackAllChanges(), and setAutocommitOff().

icaltimezone * CMulticalendar::getSystemTimeZoneAsIcalTimeZone (  ) 

getSystemTimeZoneAsIcalTimeZone

References getSystemTimeZone().

Referenced by ICalConverter::getImpendingAlarm(), CCalendar::manageCookie(), and CCalendar::setNextAlarm().

void CMulticalendar::printCurrentTime (  ) 

This function is used esp for debugging logs time in microsec

vector< string > CMulticalendar::addComponents ( vector< CComponent * > &  compList,
int  iCalId,
vector< string > &  duplicateId,
int &  ErroCode 
)

Function to disable debugging at runtime

Parameters:
vector<CComponent*> vector of CComponent * to be added
Calendar Id for which the entry belongs
vector <string> duplicate Ids if at all they exist
Error code
Returns:
vector<string> added Component Ids in Calendar database.
Function to add Events/tasks /Journals in batch

fetch the Calendar for which the Component has to be added

Call the CCalendar batch API here

References CCalendar::addComponents(), commitAllChanges(), getCalendarById(), rollbackAllChanges(), and setAutocommitOff().

Referenced by importIcsFileData(), and importIcsFileDataProgressive().

void CMulticalendar::deleteComponents ( vector< string > &  idList,
int  iCalId,
int &  ErrorCode 
)

Parameters:
vector<string> id of Component to be deleted
Calendar Id for which the entry belongs
ErrorCode 
Returns:
void
Function to delete Events/tasks /Journals in batch

fetch the Calendar for which the Component has to be added

Call the CCalendar batch API here

References commitAllChanges(), CCalendar::deleteComponents(), getCalendarById(), rollbackAllChanges(), and setAutocommitOff().

void CMulticalendar::modifyComponents ( vector< CComponent * > &  compList,
int  iCalId,
int &  ErrorCode 
)

Parameters:
vector<CComponent*> vector of CComponent*
Calendar Id for which the entry belongs
ErrorCode 
Returns:
void
Function to modify Events/tasks /Journals in batch

fetch the Calendar for which the Component has to be added

Call the CCalendar batch API here

References commitAllChanges(), getCalendarById(), CCalendar::modifyComponents(), rollbackAllChanges(), and setAutocommitOff().

Referenced by enableAutomaticDeletion().

int CMulticalendar::getVisibleCalendarCount ( int &  pErrorCode  ) 

getVisibleCalendarCount

Parameters:
ErrorCode 
Returns:
count of VisibleCalendars

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

void CMulticalendar::enableDisableCalendarLogs ( int  value  ) 

Parameters:
int Value
Returns:
NONE
function used to enable and disable calendar logs pass 0 to disable calendar logs pass 1 ro enable calendar logs

Referenced by checkFileExists(), MCInstance(), and moveFileFromSkel().

bool CMulticalendar::moveFileFromSkel ( string  oldpath,
string  newpath 
)

moving the calendardb file from /etc/skel/.claendar/calendardb

References enableDisableCalendarLogs().

bool CMulticalendar::checkFileExists ( string  szPath  ) 

API to see if DB file already exists

References enableDisableCalendarLogs().

int CMulticalendar::getComponentCount ( int &  pErrorCode  ) 

API to find the number of Components in the DB

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

CEvent * CMulticalendar::localBdayEventFromRemoteId ( string  szExId,
int &  pErrorCode 
)

bool CMulticalendar::getInstances ( string  sId,
time_t  timeFrom,
time_t  timeTo,
vector< time_t > &  result,
time_t  tzshift = 0 
)

Parameters:
string sId Id of the component
time_t timeFrom the start time of the interval
time_t timeTo the end time of the interval
vector<time_t> result placeholder for the results
time_t tzshift time zone shitf to be added from each value
Returns:
boolean SUCCESS/FAILURE
This function returns all instances of the event by given id

Parameters:
string sId Id of the component
time_t timeFrom the start time of the interval
time_t timeTo the end time of the interval
vector<time_t> result placeholder for the results
Returns:
boolean SUCCESS/FAILURE
This function returns all instances of the event by given id

References ASSERTION, and CCalendarDB::Instance().

int CMulticalendar::getInstanceNumber ( string  sId,
time_t  timeFrom,
time_t  timeTo,
time_t  tzshift = 0 
)

Parameters:
string sId Id of the component
time_t timeFrom the start time of the interval
time_t timeTo the end time of the interval
time_t tzshift time zone shitf to be added to each value
Returns:
int number of occurences
This function returns number of instances of the event by given id

Parameters:
string sId Id of the component
time_t timeFrom the start time of the interval
time_t timeTo the end time of the interval
Returns:
int number of occurences
This function returns number of instances of the event by given id

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

bool CMulticalendar::dropInstances ( string  sId  ) 

Parameters:
string sId Id of the component
Returns:
boolean SUCCESS/FAILURE
This function drops all instances of the event by given id

Parameters:
string sId Id of the component
This function drops all instances of the event by given id

References ASSERTION, CCalendarDB::execSQL(), and CCalendarDB::Instance().

bool CMulticalendar::addInstance ( string  sId,
time_t  instTime,
time_t  duration,
time_t  tzshift = 0 
)

Parameters:
string sId Id of the component
time_t instTime one instance time
time_t duration duration of the event
time_t tzshift time zone shitf to be substracted from each value
Returns:
boolean SUCCESS/FAILURE
This function adds to the database one instance of the event by given id

Parameters:
string sId Id of the component
time_t instTime one instance time
Returns:
boolean SUCCESS/FAILURE
This function adds to the database one instance of the event by given id

References ASSERTION, CCalendarDB::getDb(), CCalendarDB::insertRows(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by addInstances().

bool CMulticalendar::addInstances ( string  sId,
vector< time_t >  instances,
time_t  duration,
time_t  tzshift = 0 
)

Parameters:
string sId Id of the component
vector<time_t> instances array of instances
time_t duration duration of the event
time_t tzshift time zone shitf to be substracted from each value
Returns:
boolean SUCCESS/FAILURE
This function adds to the database the array of instances of the event by given id

Parameters:
string sId Id of the component
vector<time_t> instances array of instances
Returns:
boolean SUCCESS/FAILURE
This function adds to the database the array of instances of the event by given id

References addInstance().

vector< CComponent * > CMulticalendar::getComponentsWithLimitedData ( int  iStDate,
int  iEndDate,
int  iLimit,
int  iOffset,
vector< int > &  vCalid,
int &  pErrorCode 
)

Parameters:
: stDate to do conditional fetching based on start date. -1 in case of no conditions
: endDate to do conditional fetching based on end date. -1 in case of no conditions
: limit Max limit of components to be obtanined by this function call
: offset from which we need to fetch
: vector<int> vCalid reference to place holder for calenadr id for each entry
 int * pointer to ErrorCode
Returns:
: Vector for CComponent
This function is overloaded API for fetching entries for all calendars at a time progressively. It gives only the minimal data required for Calendar-ui in month view. P.S : Please donot use this API if you need complete data.

define SELECT_ALL_CALCOMP__UNION "select * from %s where ((%s = %d AND %s < %d AND %s >= %d) OR ( %s = %d AND %s >= %d AND %s <= %d )) AND (%s != %d AND %s != %d) AND calendarId in (select calendarid from calendars where IsVisible =1 ) union select * from %s where (%s = %d OR %s=%d) AND (%s = %d OR %s = %d) AND (%d < %s OR %d = %s) AND calendarId in (select calendarid from calendars where IsVisible =1) ORDER BY CalendarId LIMIT %d OFFSET %d "

References ASSERTION, CComponent::getFlags(), CComponent::getId(), CComponent::getInstanceNumber(), CCalendarDB::getRecords(), CComponent::getRecurrenceProperties(), CComponent::getType(), CCalendarDB::Instance(), CComponent::setId(), CComponent::setSummary(), CComponent::setTzid(), CCalendarDB::sqliteErrorMapper(), and CComponent::toString().

vector< string > CMulticalendar::giveRecursiveExpiredEvents ( int  iCalId,
int  iType,
int  iConfiguredTime,
int  iMax,
int &  iLimit,
int &  pErrorCode 
) [private]

Parameters:
 iCalId - calendar ID
 int type E_EVENT = 1
 int iDaybefore time for deletion of entries
 int reference to ErrorCode
Returns:
: vector of string Id
Function used to retrieve the ID of the entries ( only Events and Todos) expired ( 2weeks over-due)

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by enableAutomaticDeletion().

time_t CMulticalendar::getInstanceBeyond ( string  szRRule,
icaltimetype  iDtStart,
time_t  iViewEnd,
icaltimezone *  pTz,
int &  pErrorCode 
) [private]

Parameters:
string recurence rule icaltimetype date start value in icaltimetype
time_t view end parameter
icaltimezone pointer
pErrorCode reference to error code
Returns:
return the particular instance time
Function to get the next instance time given rruke and date start

Parameters:
string recurence rule icaltimetype date start value in icaltimetype
time_t view end parameter
pErrorCode reference to error code
Returns:
return the particular instance time
Function to get the next instance time given rruke and date start

Referenced by enableAutomaticDeletion().

vector< string > CMulticalendar::giveExpiredEntries ( int  iCalId,
int  iType,
int  iConfiguredTime,
int &  pErrorCode 
) [private]

Parameters:
 int iCalId - calendar ID
 int type E_EVENT = 1,E_TODO = 2
 int Configured time for deletion of entries
 int & pointer to ErrorCode
Returns:
: vector of string Id
Function used to retrieve the ID of the entries ( only Events and Todos) expired ( 2weeks over-due)

Parameters:
 iCalId - calendar ID
 int type E_EVENT = 1,E_TODO = 2
 int Configured time for deletion of entries
 int * pointer to ErrorCode
Returns:
: vector of string Id
Function used to retrieve the ID of the entries ( only Events and Todos) expired ( 2weeks over-due)

select only non recursive events ,Modify the recursive events such that only previous instances are deleted

define GET_EXPIRED_EVENTS select s from components where s=d and s= d and s < d

define GET_EXPIRED_EVENTS select s from components where s=d and s= d and s < d

define GET_EXPIRED_TODOS select s from components where s=d and s= d and s = d and s < d

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by deleteEventBeyond(), deleteJournalsBeyond(), and deleteTodosBeyond().

int CMulticalendar::getCount ( int  iCalId,
int  iType,
int &  pErrorCode 
) [private]

Parameters:
 int calendar id
 int type of component
 int& pointer to ErrorCode
Returns:
: int number of instances of the particular type in DB
This is common function called from getEventCount ,getTodoCount and getNoteCount to get the count for each type.

Parameters:
 int calendar id
 int type of component
 int * pointer to ErrorCode
Returns:
: int number of instances of the particular type in DB
This is common function called from getEventCount ,getTodoCount and getNoteCount to get the count for each type.

References ASSERTION, CCalendarDB::getRecords(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by getBdayEventCount(), getEventCount(), getNoteCount(), and getTodoCount().

string CMulticalendar::generateRrule ( int  iRepeatType,
time_t  iUntil,
int &  pErrorCode 
) [private]

Parameters:
 repeattype frequency in int
 until time in utc
 int & reference to ErrorCode
Returns:
: string Rrule in string
Function used to generate RRULE in the format as per ICAL RFC 2445 The generated RULE is of type FREQ=****UNTIL=****; This is useful only for events added from calendar-UI

Parameters:
 repeattype frequency in int
 until time in utc
 int * pointer to ErrorCode
Returns:
: string Rrule in string
Function used to generate RRULE in the format as per ICAL RFC 2445

CMulticalendar & CMulticalendar::operator= ( CMulticalendar right  )  [private]

private dummy overloaded assignment operator to avoid creation of mutiple instances

overloaded function dummy


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

Generated on Wed Jul 8 14:17:13 2009 for calendar-backend by  doxygen 1.5.6