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

CCalendargetSynchronizedCalendar ()
CCalendargetDefaultCalendar ()
bool getICSFileInfo (string szFileName, unsigned int &iEventCount, unsigned int &iTodoCount, unsigned int &iJournalCount, int &pErrorCode)
string getSynchronizedCalendarName ()
string getCTCapXML ()
bool importIcsFileData (string szFileName, int iCalid, string &eventId, int &pErrorCode)
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 &pErrorCode)
vector< time_t > getRecurrentTimes (string szRRule, icaltimetype iDtStart, time_t iViewEnd, int &pErrorCode)
vector< CComponent * > getComponents (int iCalId, int iType, int iStDate, int iEndDatei, int &pErrorCode)
int getNoofCalendars ()
int addCalendar (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)
void setMaxId (int iMaxId)
int getMaxId ()
int searchMaxId ()
vector< CComponent * > getComponentsAllCalendars (int iType, int iStDate, int iEndDate, int iLimit, int iOffset, vector< int > &vCalid, int &pErrorCode)
vector< CComponent * > getAllEventsTodosForCalendar (int iCalid, int iStDate, int iEndDate, int iLimit, int iOffset, 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 ()
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 ()
 ~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 &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, int &perrorcode)
void MCdestroy ()
vector< CComponent * > popEventDetails (QueryResult *pQr)
int getCalendarIdForComponent (string iI, int &pErrorCode)
vector< CCalendar * > getAllCalendars ()
CCalendargetBirthdayCalendar ()
bool deleteBirthdaysForCalendar (int iCalid, int &pErrorCode)
int getBdayEventCount (int iCalId, int &pErrorCode)

Static Public Member Functions

static CMulticalendarMCInstance ()

Private Member Functions

vector< string > giveRecursiveExpiredEvents (int iCalId, int iType, int iDayBefore, int &pErrorCode)
time_t getInstanceBeyond (string szRRule, icaltimetype iDtStart, time_t iViewEnd, 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)

Private Attributes

vector< CCalendar * > vCalendarList
int iMaxId
string AppName

Static Private Attributes

static CMulticalendarpMc


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

Default constructor for CMulticalendar class

CMulticalendar::~CMulticalendar (  ) 

Destructor for Multicalendar class

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

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

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

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.

string CMulticalendar::getSynchronizedCalendarName (  ) 

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

string CMulticalendar::getCTCapXML (  ) 

getCTCapXML

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

bool CMulticalendar::importIcsFileData ( string  szFileName,
int  iCalid,
string &  eventId,
int &  pErrorCode 
)

Parameters:
 string filename to be imported
 int iCalid - calendar id to which entries should be imported.
 string Eventid of added event
 int & reference to ErrorCode
Returns:
: string cal name
This function parses the given ics file .All the entries in the file are added to one calendar.

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.

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.

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.

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 vector of calendars maintained in CACHE. user of this API should not free the calendar thus obtained this will be freed when Multicalendar object is destroyed.

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.

bool CMulticalendar::enableAutomaticDeletion ( int  iDayBefore,
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.

vector< time_t > CMulticalendar::getRecurrentTimes ( string  szRRule,
icaltimetype  iDtStart,
time_t  iViewEnd,
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:
: 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.

vector< CComponent * > CMulticalendar::getComponents ( int  iCalId,
int  iType,
int  iStDate,
int  iEndDatei,
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*>

int CMulticalendar::getNoofCalendars (  ) 

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

int 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:
: success / failure
This function is called to add a new calendar into the database. It is an overloaded API used by UI.

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.

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.

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

Parameters:
 calid Calendar id
 int * pointer reference to ErrorCode
Returns:
: CCalendar pointer
Function used to get the calendar object based on calendar id. This api returns CCalendar* from cache list , so the Calendar pointer thus obtained shouldn't be freed by the end user.

void CMulticalendar::setMaxId ( int  iMaxId  ) 

Parameters:
int Max id of component found from DB
Returns:
none
Function to set MaxId value

int CMulticalendar::getMaxId (  ) 

Parameters:
none 
Returns:
integer maximum id of entry(event/todo/jounral) in database
Function to get max component Id existing in DB

int CMulticalendar::searchMaxId (  ) 

Parameters:
none 
Returns:
integer
Search maximum Id in DB called at the time of construction.

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

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

vector< CComponent * > CMulticalendar::getAllEventsTodosForCalendar ( 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

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

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.

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.

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

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.

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.

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.

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.

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

CMulticalendar * CMulticalendar::MCInstance (  )  [static]

This fuction is used to create single multicalendar instance Function used to get the CMulticalendar instance

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.

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.

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 .

vector< CCalendar * > CMulticalendar::getListCalFromMc (  ) 

Parameters:
 NONE
Returns:
: vector of CCalendar*
Function to return list of calendars from CMulticalenadr object. This will return the cache list maintained in this class. Should not be freed by API user, will be automatically freed when Multicalendar object is destroyed. IMPORTANT: This is not a thread safe function.

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.

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 not be freed bu API user will be destroyed while Multicalendar object destructor is invoked.

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.

int CMulticalendar::getNumOfAllDayEventsForToday ( int &  pErrorCode  ) 

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

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

getTodaysAllDay

Parameters:
pErrorcode reference to error code
Returns:
list of CComponent*
Function to retrieve allday events on today

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

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.

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.

CCalendar * CMulticalendar::getCalendarByType ( int  iCalTypei,
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 shouldn't be freed by the API user. It will be destroyed when CMulticalendar object is destroyed.

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.

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.

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.

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.

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

Parameters:
: int iCalendar of the calendar
: string sComponentId of the component
: 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.

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.

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

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

string CMulticalendar::getDefaultCalendarName (  ) 

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

CComponent * CMulticalendar::getPrevNextComponent ( string  szId,
time_t  iDateStart,
bool  isPrev,
int &  iCalid,
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

void CMulticalendar::MCdestroy (  ) 

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

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

Parameters:
vector<CComponent *>
struct QueryResult pointer
Function to retunrn CComponents from database based on the query result

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

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

vector< CCalendar * > CMulticalendar::getAllCalendars (  ) 

Parameters:
 NONE
Returns:
: Vector of CCalendar* objects
This function is called to get the calendars from database. At the creation of Multicalendar object this function is automatically invoked. getAllCalendars should not be used by any one other than CMulticalendar class itself others can use the API getListCalFromMc this will return the list of members stored in cache rather than fetching from DB. The list of calendars thus obtained should not be freed they will be freed at the time of destruction of CMulticalendar object.

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

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

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.

vector< string > CMulticalendar::giveRecursiveExpiredEvents ( int  iCalId,
int  iType,
int  iDayBefore,
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)

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)

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

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.

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

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

private dummy overloaded assignment operator to avoid creation of mutiple instances


Field Documentation

vector< CCalendar * > CMulticalendar::vCalendarList [private]

Calendar vector to maintain the list of calendars

CMulticalendar * CMulticalendar::pMc [static, private]

Static multicalendar private object


The documentation for this class was generated from the following files:
Generated on Tue Feb 24 16:21:34 2009 for calendar-backend by  doxygen 1.5.1