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 getRecurrentTimes (string szRRule, icaltimetype iDtStart, int iEventDuration, time_t iViewBegin, time_t iViewEnd, icaltimezone *pTz, vector< time_t > &outTimes, int &pErrorCode, int limit=-1)
bool checkRecurrentTimes (string szRRule, icaltimetype iDtStart, time_t iViewEnd, icaltimezone *pTz, int &pErrorCode)
bool checkRecurrentTimes (string szRRule, icaltimetype iDtStart, int iEventDuration, time_t iViewBegin, 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, int iQueryType=0)
int getComponentsAllCalendars (int iStDate, int iEndDate, int iLimit, int iOffset, vector< CComponent * > &vComponents, int iQueryType=0)
int getComponentsAllCalendarsBySummary (std::string sSummary, int iLimit, int iOffset, vector< CComponent * > &vComponents)
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 addBirthdays (vector< CBdayEvent * > &pBdays, int &pErrorCode)
bool modifyBirthDay (CBdayEvent *pBday, int &pErrorCode)
bool deleteBirthDay (string szEUid, int &pErrorCode)
bool deleteBirthdays (vector< string > &szEUidList, 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)
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)
bool checkExistenceOfFutureRepeatingEvent (time_t OriginalDateStart, string sId, int &pErrorCode)
bool checkForNextPrev (time_t instanceTime, string Id, bool isPrev, int &pErrorCode)
CalendarColour getUnusedCalendarColor (void)
void getImpendingAlarm (string szRrule, time_t &triggerTime, time_t dateStart, int alarmFlag, icaltimezone *pTz)

Static Public Member Functions

static CMulticalendarMCInstance ()
static time_t getSystemTimeShift ()
static string getSystemTimeZone ()
static bool checkFileExists (string szPath)
static void reloadSystemTimezone ()

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)
void setCalendarName (CCalendar *pCalendar, string szCalendarName) const
int regenerateInstances ()
 Current timezone.
int deleteNonRecurrentComponents (int iDayBefore, int iMax, int &pErrorCode)
bool deleteAllComponents (int iCalId, int &pErrorCode)
void cleanupIcsString (std::string &ics_line)
void restoreAlarms ()
int comparePrevNextComponent (CComponent *c1, CComponent *c2, time_t t1=-1, time_t t2=-1)

Private Attributes

int iMaxId
string AppName

Static Private Attributes

static CMulticalendarpMc = 0
static std::string szSystemTimezone


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 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 ICalConverter::checkCount(), and cleanupIcsString().

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(), cleanupIcsString(), 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(), cleanupIcsString(), 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

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 deleteNonRecurrentComponents(), CComponent::getDateEnd(), CComponent::getDateStart(), CComponent::getId(), getInstanceBeyond(), getListCalFromMc(), getSystemTimeZone(), CComponent::getTzid(), giveRecursiveExpiredEvents(), CCalendarDB::Instance(), modifyComponents(), releaseListCalendars(), CComponent::setDateEnd(), and CComponent::setDateStart().

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.
Note:
: This function will be removed soon. Please switch to 'bool getRecurrentTimes(...)'.
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(), and getImpendingAlarm().

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

Parameters:
 string rrule recurrencerule
 icaltimetype iDtdtstart datestart in Icaltime format.
 int iEventDuration duration of original event
 time_t iViewBegin start range of current claendar view
 time_t iViewEnd end range of current claendar view
 vector<time_t> outTimes - generated event times
 int& pErrorCode pointer to ErrorCode
 int limit will return if this number of instances has found
Returns:
: bool result of operation
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.
 iEventDuration duration of original event
 iViewBegin start range of current claendar view
 viewEnd end range of current claendar view
 outTimes generated event times
 pErrorCode pointer to ErrorCode
 limit will return if this number of instances has found
Returns:
: bool result of operation
Function to parse the time of occurrances from recurrence rules.

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

Parameters:
 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.
Note:
: This function will be removed soon. Please switch to extended function below.
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.

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

Parameters:
 string rrule recurrencerule
 icaltimetype iDtdtstart datestart in Icaltime format.
 int iEventDuration duration of original event
 time_t iViewBegin start range of current claendar view
 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().

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. If it is COLOUR_NEXT_FREE, next available free color will be choosen automatically.
 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 getCalendarById(), CCalendar::setCalendarColor(), setCalendarName(), CCalendar::setCalendarReadOnly(), CCalendar::setCalendarShown(), CCalendar::setCalendarTune(), CCalendar::setCalendarType(), and CCalendar::setCalendarVersion().

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 clearCalendar(), commitAllChanges(), getCalendarById(), CCalendar::getCalendarId(), 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,
int  iQueryType = 0 
)

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: CALENDAR_OPERATION_SUCCESSFUL- fetching is successful and can be continued; CALENDAR_FETCH_NOITEMS- fetching is finished (no more items found in DB); other error code- fetching is failed.
: int iQueryType value 1 - Indicates simple events and tasks value 2 - indicates Repeating events Any other value fetches all ( repeating events , non repeating events and tasks) Default value is 0.
Returns:
: Vector for CComponent. If pErrorCode equals to CALENDAR_OPERATION_SUCCESSFUL, but vector is empty, no component (from offset to limit) meets the conditions, continue fetching
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: CALENDAR_OPERATION_SUCCESSFUL- fetching is successful and can be continued; CALENDAR_FETCH_NOITEMS- fetching is finished (no more items found in DB); other error code- fetching is failed.
: iQueryType - default parameter with value 0 0- Fetches all Events + tasks 1- Fetches non repeating events + tasks 2- Fetches repeating events alone in the given range.
Returns:
: Vector for CComponent. If pErrorCode equals to CALENDAR_OPERATION_SUCCESSFUL, but vector is empty, no component (from offset to limit) meets the conditions, continue fetching
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 CComponent::getAlarmProperties(), CComponent::getFlags(), CComponent::getInstanceNumber(), CCalendarDB::getRecords(), CComponent::getRecurrenceProperties(), CComponent::getType(), CCalendarDB::Instance(), CComponent::setCalendarId(), CComponent::setDescription(), CComponent::setGUid(), CComponent::setId(), CComponent::setLocation(), CComponent::setSummary(), CComponent::setTzid(), and CCalendarDB::sqliteErrorMapper().

Referenced by getPrevNextComponent(), and regenerateInstances().

int CMulticalendar::getComponentsAllCalendars ( int  iStDate,
int  iEndDate,
int  iLimit,
int  iOffset,
vector< CComponent * > &  vComponents,
int  iQueryType = 0 
)

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 for CComponent. If pErrorCode equals to CALENDAR_OPERATION_SUCCESSFUL, but vector is empty, no component (from offset to limit) meets the conditions, continue fetching
: int iQueryType value 1 - Indicates simple events and tasks value 2 - indicates Repeating events Any other value fetches all ( repeating events , non repeating events and tasks) Default value is 0.
Returns:
Error code: CALENDAR_OPERATION_SUCCESSFUL- fetching is successful and can be continued; CALENDAR_FETCH_NOITEMS- fetching is finished (no more items found in DB); other error code- fetching is failed.
This function is overloaded API for fetching entries for all calendars at a time progressively

References CCalendarDB::Instance().

int CMulticalendar::getComponentsAllCalendarsBySummary ( std::string  sSummary,
int  iLimit,
int  iOffset,
vector< CComponent * > &  vComponents 
)

Parameters:
sSummary text for finding in summary of components (should be specified in format of SQL LIKE operator)
iLimit Max limit of components to be obtanined by this function call
iOffset offset from which we need to fetch
vComponents Vector for CComponent. If pErrorCode equals to CALENDAR_OPERATION_SUCCESSFUL, but vector is empty, no component (from offset to limit) meets the conditions, continue fetching
Returns:
error code CALENDAR_OPERATION_SUCCESSFUL- fetching is successful and can be continued; CALENDAR_FETCH_NOITEMS- fetching is finished (no more items found in DB); other error code- fetching is failed.
This function is overloaded API for fetching entries for all calendars with specified word in summary.

References CCalendarDB::Instance().

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 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(), CComponent::getId(), 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(), CComponent::getId(), 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(), 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(), CComponent::getId(), 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(), CComponent::getId(), 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(), 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(), CComponent::getId(), 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(), CComponent::getId(), 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(), 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(), getUnusedCalendarColor(), 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 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 checkCalendarNameExists(), commitAllChanges(), CCalendar::getCalendarColor(), CCalendar::getCalendarId(), CCalendar::getCalendarName(), CCalendar::getCalendarTune(), CCalendar::getCalendarType(), CCalendar::getCalendarVersion(), CCalendarDB::getDb(), CCalendar::getProfileType(), getUnusedCalendarColor(), CCalendarDB::insertRows(), CCalendarDB::Instance(), CCalendar::IsReadOnly(), CCalendar::IsShown(), rollbackAllChanges(), setAutocommitOff(), CCalendar::setCalendarColor(), 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 <>1 AND ComponentType =2 AND CalendarId in (select CalendarId from calendars where IsVisible =1); NOTE: Status<>1 means not completed status. This shall be changed if it will be possible to have more than 1 completed status.

References 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 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 addBirthdays().

bool CMulticalendar::addBirthdays ( vector< CBdayEvent * > &  pBdays,
int &  pErrorCode 
)

Parameters:
 pBdays list of 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(), rollbackAllChanges(), and setAutocommitOff().

Referenced by addBirthDay().

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(), CComponent::getId(), 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 deleteBirthdays().

bool CMulticalendar::deleteBirthdays ( vector< string > &  szEUidList,
int &  pErrorCode 
)

Parameters:
 vector<string>& szEUidList list of Ids of the birthday events
 int& pointer to ErrorCode
Returns:
: boolean (SUCCESS/FAILURE)
Function used to delete the Event using CMulticalendar class.

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

Referenced by deleteBirthDay().

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 addBirthdays(), deleteBirthdays(), 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 CCalendarDB::Instance(), and CCalendarDB::setAutocommitOff().

Referenced by addBirthdays(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), deleteBirthdays(), 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 CCalendarDB::commitDB(), and CCalendarDB::Instance().

Referenced by addBirthdays(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), clearCalendarContents(), deleteBirthdays(), 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 CCalendarDB::Instance(), and CCalendarDB::rollbackDB().

Referenced by addBirthdays(), addCalendar(), addComponents(), addEvent(), addJournal(), addTodo(), clearCalendar(), deleteBirthdays(), 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(), CCalendar::IsShown(), rollbackAllChanges(), setAutocommitOff(), and CCalendar::setNextAlarm().

Referenced by restoreAlarms().

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 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::setCalendarId(), CComponent::setDateStart(), CComponent::setId(), 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 comparePrevNextComponent(), CCalendar::getBirthDayEvent(), getCalendarById(), CComponent::getCalendarId(), CCalendar::getCalendarType(), getComponentsAllCalendars(), CComponent::getDateStart(), CCalendar::getEvent(), CComponent::getId(), CCalendarDB::getRecords(), CComponent::getSummary(), 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 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 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 
)

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

Parameters:
iCalId Calendar Id
pErrorCode - Reference to errror Code
API to Clear the contents of the Calendar
Note:
This function MUST NOT be called between setAutoCommitOff() and commitAllChanges()
Parameters:
iCalId Calendar Id
pErrorCode - Reference to errror Code
API to Clear the contents of the Calendar

References clearCalendar(), and commitAllChanges().

icaltimezone * CMulticalendar::getSystemTimeZoneAsIcalTimeZone (  ) 

getSystemTimeZoneAsIcalTimeZone

References getSystemTimeZone().

Referenced by ICalConverter::getImpendingAlarm().

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(), CCalendarDB::Instance(), rollbackAllChanges(), CCalendarDB::sendDBusMessage(), and setAutocommitOff().

Referenced by deleteAllComponents(), and deleteNonRecurrentComponents().

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 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 MCInstance().

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

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

bool CMulticalendar::checkFileExists ( string  szPath  )  [static]

API to see if DB file already exists

Referenced by MCInstance().

int CMulticalendar::getComponentCount ( int &  pErrorCode  ) 

API to find the number of Components in the DB

References 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 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 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 CCalendarDB::getDb(), CCalendarDB::Instance(), CCalendarDB::sqliteErrorMapper(), and CCalendarDB::updateDB().

Referenced by CCalendar::addComponent().

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 CCalendarDB::getDb(), CCalendarDB::insertRows(), CCalendarDB::Instance(), and CCalendarDB::sqliteErrorMapper().

Referenced by CCalendar::addComponent(), addInstances(), and regenerateInstances().

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().

Referenced by CCalendar::addComponent(), and regenerateInstances().

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 CComponent::getFlags(), CComponent::getId(), CComponent::getInstanceNumber(), CCalendarDB::getRecords(), CComponent::getRecurrenceProperties(), CComponent::getType(), CCalendarDB::Instance(), CComponent::setCalendarId(), CComponent::setId(), CComponent::setSummary(), CComponent::setTzid(), CCalendarDB::sqliteErrorMapper(), and CComponent::toString().

bool CMulticalendar::checkExistenceOfFutureRepeatingEvent ( time_t  OriginalDateStart,
string  sId,
int &  pErrorCode 
)

bool CMulticalendar::checkForNextPrev ( time_t  instanceTime,
string  Id,
bool  isPrev,
int &  pErrorCode 
)

Parameters:
: time_t instanceTime time beyond which Next/Prev entry has to be fetched
: string Id Id of event currently visible in Event view.
: bool isPrev whether we want previous event.
: int &pErrorCode place holder for error code.
Returns:
: boolean to indicate the Next/Prev presence.
Next prev Presence can be found by this method. API used to see if there is next prev instance so that NEXT PREV Menus are updated in UI in event view. This has to be used intelligently by UI API Usage:

1. Api quickly indicates the presence of PREV /NEXT event 2. If the event opened in event view is nth repeat and the event has p repeats event 1 has total p repeats and Ui is showing the nth repeat in event view 0, 1,2,........ n ........p In this case no need to call the checkNextPrev as the instance being shown in UI middle instance there will be next and previous instances. So enable the Next and Previous menus. ( exception case is when repeat type is complex In this case call getNextPrevious to get the actual instance in this case it will be a bit slower )

3. PRev logic checks if previous event exist or not , idea is event has to start before the input date for it to be previous event ( same logic holds goog for timebased and repeating events) 5. Next logic is optimised to see if there is any event which starts after this time / any repeating event if this fails then we check for any repeating event with until=-1 ( if one such event is found then we return at that point itself with out expanding any further.)

Next prev Presence can be found by this method. API used to see if there is next prev instance so that NEXT PREV Menus are updated in UI in event view. This has to be used intelligently by UI How to use this API:

1. Api quickly indicates the presence of PREV /NEXT event 2. If the event opened in event view is nth repeat and the event has p repeats event 1 has total p repeats and Ui is showing the nth repeat in event view 0, 1,2,........ n ........p In this case no need to call the checkNextPrev as the instance being shown in UI middle instance there will be next and previous instances. So enable the Next and Previous menus. ( exception case is when repeat type is complex In this case call getNextPrevious to get the actual instance in this case it will be a bit slower )

3. PRev logic checks if previous event exist or not is --- event has to start before the input date be it timebased repeating 5. Next logic is optimised to see if there is any event which starts after this time / any repeating event if this fails then we check for any repeating event with until=-1 ( if one such event is found then we return at that point in time.)

If there is next previous present then return

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

CalendarColour CMulticalendar::getUnusedCalendarColor ( void   ) 

Get the unused color in the calendar applcation. Returns COLOUR_DARKBLUE if all the colors have been used.

Parameters:
void No arguments
Returns:
CalendarColour Calendar color

References CCalendar::getCalendarColor(), getListCalFromMc(), and releaseListCalendars().

Referenced by addCalendar().

void CMulticalendar::reloadSystemTimezone (  )  [static]

Reload timezone information from system

void CMulticalendar::getImpendingAlarm ( string  szRrule,
time_t &  triggerTime,
time_t  dateStart,
int  alarmFlag,
icaltimezone *  pTz 
)

Function to get the impending alarm time

References getRecurrentTimes().

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 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 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 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

void CMulticalendar::setCalendarName ( CCalendar pCalendar,
string  szCalendarName 
) const [private]

Parameters:
pCalendar pointer to calendar to set name to
szCalendarName calendar name read from database
Returns:
none
Function to set the name for calendar. If it is default synced calendar the name shall be the same with product name if was not changed. Otherwise it shall be name read from database

References CCalendar::setCalendarName().

Referenced by getCalendarById(), getListCalFromMc(), and modifyCalendar().

int CMulticalendar::deleteNonRecurrentComponents ( int  iDayBefore,
int  iMax,
int &  pErrorCode 
) [private]

Remove non-recurrent events older than specified date

Parameters:
iDayBefore - target date. All events older than that date will be deleted.
iMax - max nubmer of events to be deleted at once
pErrorCode - error code
Returns:
number of deleted components

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

Referenced by enableAutomaticDeletion().

bool CMulticalendar::deleteAllComponents ( int  iCalId,
int &  pErrorCode 
) [private]

Remove all events from specified calendar (prior calendar deletion)

Parameters:
iCalId - calendar to be flushed
pErrorCode - error code
Returns:
operation complete status (SUCCESS/FAILURE)

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

Referenced by clearCalendar().

void CMulticalendar::cleanupIcsString ( std::string &  ics_line  )  [private]

Remove unsupported symbols from ICS file string.

Parameters:
ics_line string to clean up

Referenced by getICSFileInfo(), importIcsFileData(), and importIcsFileDataProgressive().

void CMulticalendar::restoreAlarms (  )  [private]

Restore daemon-side alarms based on calendar alarms

References CAlarm::deleteAlarmEvent(), CCalendarDB::getRecords(), CCalendarDB::Instance(), CAlarm::purgeAlarms(), and setNextAlarm().

Referenced by MCInstance().

int CMulticalendar::comparePrevNextComponent ( CComponent c1,
CComponent c2,
time_t  t1 = -1,
time_t  t2 = -1 
) [private]

Compare compoenents in the order of "Prev/Next event"

Parameters:
c1 - pointer to first compoenent
c2 - pointer to second compoenent
Returns:
1 - c1 сome after c2 (direct order) -1 - c1 comes before c1 (revers order) 0 - components are equal (i.e. same components are compared)

References CComponent::getAllDay(), CComponent::getDateEnd(), CComponent::getDateStart(), CComponent::getId(), and CComponent::getSummary().

Referenced by getPrevNextComponent().


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

Generated on Tue Jul 27 14:17:50 2010 for calendar-backend by  doxygen 1.5.6