ICalConverter Class Reference

converts local database format to ical data and vice versa More...

#include <ICalConverter.h>


Public Member Functions

string localToIcalVcal (CComponent *pEntry, FileType iType, int pErrorCode)
CComponenttoLocal (string strIcalComp, FileType iType, int pErrorCode)
 ICalConverter ()
 ~ICalConverter ()
string appendControlM (string szContents)
string toString ()
vector< CComponent * > icalVcalToLocal (string strIcalComp, FileType iType, int pErrorCode)
string strip (string szContents)
bool checkCount (string szContents, string szBegin, string szEnd, unsigned int &iCount)
string validateContents (string szContents)
int getIntFromIcaltimetype (struct icaltimetype ical_time)

Private Member Functions

float stringToFloat (string szValue)
string addAlarmDateToString (string strIcalComp, string strVCalAlarmDate)
string addRuleToString (string strIcalComp, vector< string > rrules, int flag)
string getIcalAlarm (CAlarm *cAlarm)
void deleteWhiteSpaces (string &szSpaceString)
vector< CRecurrenceRule * > getRecurrence (string strIcalComp, icalcomponent *pComp, icalproperty_kind kind, FileType iFType)
CRecurrenceRulegetRecurrenceRule (string strIcalComp, int index, string strRuleType, FileType iFType)
vector< string > getRecurrenceDates (string strIcalComp, icalcomponent *pComp, icalproperty_kind kind)
CAlarmgetAlarm (string strIcalComp, icalcomponent *pComp)
tm initTime (icaltimetype time_ical)
string get_line (string strIcal, int start_loc)
string get_line_in_ical (string strInVcal, string strType, int index)
string getTranspFromIcal (icalproperty_transp iTransp)
COrganizergetOrganizerFromIcal (icalproperty *pProp)
CAttendeegetAttendeeFromIcal (icalproperty *pProp, FileType iType)
int getParticipationRoleFromIcal (icalparameter_role icalRole)
int getParticipationStatusFromIcal (icalparameter_partstat icalPartStat)
bool getRSVPFromIcal (icalparameter_rsvp icalRSVP)
int getCUTypeFromIcal (icalparameter_cutype icalCUType)
string getClasFromIcal (icalproperty_class iClass)
icalproperty * getIcalOrganizer (COrganizer *pOrg)
string getContactFromIcal (icalproperty *pProp)
icalparameter_rsvp getIcalRSVP (bool fRSVP)
icalparameter_partstat getIcalPartStatus (ParticipantStatus iPartStat)
icalparameter_role getIcalPartRole (ParticipantRole iRole)
icalparameter_cutype getIcalCalendarUserType (CalendarUserType iCUType)
icalproperty * getIcalAttendee (CAttendee *pAtten, FileType iType)
CPropertiesgetXProperty (icalproperty *pProp)
CParametersgetParameters (icalparameter *pParam)
vector< CParameters * > getRelationshipParamFromICal (icalparameter *pParam)
int getStatusFromIcal (icalproperty_status icalStatus)
CParametersgetLanguageFromIcal (icalparameter *pParam)
CParametersgetAlterFromIcal (icalparameter *pParam)
vector< CParameters * > getLangAlterParam (icalproperty *pProp)
int getIcalStatus (statusParam iStatus)
icalparameter_reltype getIcalRelType (RelationshipType iRel)
CParametersgetFMTypeFromIcal (icalparameter *pParam)
icalparameter * getTZIDParam ()


Detailed Description

converts local database format to ical data and vice versa

ICalConverter


Constructor & Destructor Documentation

ICalConverter::ICalConverter (  ) 

constructor

ICalConverter::~ICalConverter (  ) 

destructor


Member Function Documentation

string ICalConverter::localToIcalVcal ( CComponent pEntry,
FileType  iType,
int  pErrorCode 
)

Parameters:
pEntry CComponent object
iType FileType ( ICAL/VCAL/UNKNOWN )
pErrorCode Errorcode for the function
Returns:
string ical format string
This function takes CComponent object as parameter converts this into ical/vcal format and returns vcalendar string

CComponent * ICalConverter::toLocal ( string  strIcalComp,
FileType  iType,
int  pErrorCode 
)

Parameters:
strIcalComp ical string to be converted
iType FileType ( ICAL/VCAL/UNKNOWN )
pErrorCode Errorcode for the function
Returns:
CComponent object pointer
This function takes string as parameter converts the ical/vcal formatted string into local calendar database entry returns the CComponent object

string ICalConverter::appendControlM ( string  szContents  ) 

Parameters:
szContents 
Returns:
string
This function appends ctrl+M to each line as required for pc suite sync

string ICalConverter::toString (  ) 

Parameters:
string This function prints all the member variable values.

vector< CComponent * > ICalConverter::icalVcalToLocal ( string  strIcalComp,
FileType  iType,
int  pErrorCode 
)

Parameters:
strIcalComp ical string to be converted
iType FileType ( ICAL/VCAL/UNKNOWN )
pErrorCode Errorcode for the function
Returns:
vector <CComponent*>
This function takes string as parameter converts the ical/vcal formatted string into local calendar database entries and returns them as vector of CComponent object

string ICalConverter::strip ( string  szContents  ) 

Parameters:
szContents string
Returns:
string
This function is used to strip the BEGIN and END of VCALENDAR component in the given contents.This is used by icalVcalToLocal function.

bool ICalConverter::checkCount ( string  szContents,
string  szBegin,
string  szEnd,
unsigned int &  iCount 
)

Parameters:
szContents string
szBegin begin string of icalcomponent
szEnd end string of icalcomponent
iCount integer reference Count number of instance of entry(event/todo/journal) in ics file
Returns:
bool
This function is used to validate the string passed to icalVcalToLocal function by counting the number of BEGIN and END tags of the components. This is used by icalVcalToLocal function.

string ICalConverter::validateContents ( string  szContents  ) 

Parameters:
szContents string
Returns:
string
This function is used to validate the string passed to icalVcalToLocal function by removing trailing spaces and ctrl+M in the contents.This is used by icalVcalToLocal function.

int ICalConverter::getIntFromIcaltimetype ( struct icaltimetype  ical_time  ) 

Parameters:
ical_time icaltimetype structure
Returns:
integer
This function returns an int value for the given icaltimetype structure.

float ICalConverter::stringToFloat ( string  szValue  )  [private]

Parameters:
string the input string value
Returns:
float
This function is used to convert string to float.

string ICalConverter::addAlarmDateToString ( string  strIcalComp,
string  strVCalAlarmDate 
) [private]

Parameters:
strIcalComp string
strVCalAlarmDate string
Returns:
string
This function converts alarm date to string format.

string ICalConverter::addRuleToString ( string  strIcalComp,
vector< string >  rrules,
int  flag 
) [private]

Parameters:
strIcalComp string
rrules vector <string>
flag int
Returns:
string
Utility function used for parsing recurrence rules

string ICalConverter::getIcalAlarm ( CAlarm cAlarm  )  [private]

getIcalAlarm()

Parameters:
cAlarm CAlarm object
Returns:
string
Function to get the Alarm string from Alarm component

void ICalConverter::deleteWhiteSpaces ( string &  szSpaceString  )  [private]

Parameters:
szSpaceString 
Returns:
NONE
Function to strip all the white spaces

vector< CRecurrenceRule * > ICalConverter::getRecurrence ( string  strIcalComp,
icalcomponent *  pComp,
icalproperty_kind  kind,
FileType  iFType 
) [private]

Parameters:
strIcalComp string
pComp icalcomponent object
kind icalproperty_kind
iType FileType (ICAL/VCAL/UNKNOWN)
Returns:
vector <CRecurrenceRule*>
This function is used to get vector of recurrencerule objects from the given strIcalComp.

CRecurrenceRule * ICalConverter::getRecurrenceRule ( string  strIcalComp,
int  index,
string  strRuleType,
FileType  iFType 
) [private]

Parameters:
strIcalComp string
index position of the rule
strRuleType rule type (RRULE/EXRULE)
iType FileType (ICAL/VCAL/UNKNOWN)
Returns:
CRecurrenceRule object
This function is used to create recurrence rule from the given strIcalComp.

vector< string > ICalConverter::getRecurrenceDates ( string  strIcalComp,
icalcomponent *  pComp,
icalproperty_kind  kind 
) [private]

Parameters:
strIcalComp string
pComp icalcomponent object
kind icalproperty_kind kind of property (ICAL_RDATE_PROPERTY/ICAL_EXDATEPROPERTY)
Returns:
vector <string> list of dates
This function is used to get list of dates (RDATE/EXDATE) from given strIcalComp.

CAlarm * ICalConverter::getAlarm ( string  strIcalComp,
icalcomponent *  pComp 
) [private]

Parameters:
strIcalComp string
pComp icalcomponent object
Returns:
CAlarm object
This function is used to get the CAlarm object from given strIcalComp.

struct tm ICalConverter::initTime ( icaltimetype  time_ical  )  [private]

Parameters:
time_ical icaltimetype structure
Returns:
tm structure
This function takes icaltimetype structure and coverts it into tm structure.

string ICalConverter::get_line ( string  strIcal,
int  start_loc 
) [private]

Parameters:
strIcal Ical data in string format
start_loc Staring position for search
Returns:
string
This function returns string from given start_loc to a newline char in the given contents.

string ICalConverter::get_line_in_ical ( string  strInVcal,
string  strType,
int  index 
) [private]

Parameters:
strInVcal string
strType string
index int
Returns:
string

string ICalConverter::getTranspFromIcal ( icalproperty_transp  iTransp  )  [private]

Parameters:
iTransp icalproperty_transp
Returns:
string
This function returns the mapping for transparency from ICAL format to local calendar database format.

COrganizer * ICalConverter::getOrganizerFromIcal ( icalproperty *  pProp  )  [private]

Parameters:
pProp icalproperty object
Returns:
COrganizer object
This function converts the ICAL format organizer to COrganizer object.

CAttendee * ICalConverter::getAttendeeFromIcal ( icalproperty *  pProp,
FileType  iType 
) [private]

Parameters:
pProp icalproperty object
FileType iType (ICAL/VCAL/UNKNOWN)
Returns:
CAttendee object
This function converts the ICAL format attendee to CAttendee object.

int ICalConverter::getParticipationRoleFromIcal ( icalparameter_role  icalRole  )  [private]

Parameters:
icalRole icalparameter_role
Returns:
int
This function returns the mapping for Participation Role from ICAL format to local calendar database format.

int ICalConverter::getParticipationStatusFromIcal ( icalparameter_partstat  icalPartStat  )  [private]

Parameters:
icalPartStat icalparameter_partstat
Returns:
int
This function returns the mapping for Participation Status from ICAL format to local calendar database format.

bool ICalConverter::getRSVPFromIcal ( icalparameter_rsvp  icalRSVP  )  [private]

Parameters:
icalRSVP icalparameter_rsvp
Returns:
bool
This function returns the mapping for RSVP from ICAL format to local calendar database format.

int ICalConverter::getCUTypeFromIcal ( icalparameter_cutype  icalCUType  )  [private]

Parameters:
icalCUType icalparameter_cutype
Returns:
int
This function returns the mapping for CUType from ICAL format to local calendar database format.

string ICalConverter::getClasFromIcal ( icalproperty_class  iClass  )  [private]

Parameters:
iClass icalproperty_class
Returns:
string
This function returns the mapping for Class from ICAL format to local calendar database format.

icalproperty * ICalConverter::getIcalOrganizer ( COrganizer pOrg  )  [private]

Parameters:
pOrg COrganizer object
Returns:
icalproperty object
This function returns the ical organizer property from the given COrganizer object.

string ICalConverter::getContactFromIcal ( icalproperty *  pProp  )  [private]

Parameters:
pProp icalproperty object
Returns:
string
This function returns contact from ICAL format to local database format.

icalparameter_rsvp ICalConverter::getIcalRSVP ( bool  fRSVP  )  [private]

Parameters:
RSVP bool
Returns:
icalparameter_rsvp
This function returns the mapping for RSVP from local databse format to ICAL format.

icalparameter_partstat ICalConverter::getIcalPartStatus ( ParticipantStatus  iPartStat  )  [private]

Parameters:
iPartStat ParticipantStatus
Returns:
icalparameter_partstat
This function returns the mapping for ParticipantStatus from local databse format to ICAL format.

icalparameter_role ICalConverter::getIcalPartRole ( ParticipantRole  iRole  )  [private]

Parameters:
iRole ParticipantRole
Returns:
icalparameter_role
This function returns the mapping for ParticipantRole from local databse format to ICAL format.

icalparameter_cutype ICalConverter::getIcalCalendarUserType ( CalendarUserType  iCUType  )  [private]

Parameters:
iCUType CalendarUserType
Returns:
icalparameter_cutype
This function returns the mapping for CalendarUserType from local databse format to ICAL format.

icalproperty * ICalConverter::getIcalAttendee ( CAttendee pAtten,
FileType  iType 
) [private]

Parameters:
pAtten CAttendee object
iType FileType (ICAL/VCAL/UNKNOWN)
Returns:
icalproperty object
This function returns the ical attendee property from the given CAttendee object.

CProperties * ICalConverter::getXProperty ( icalproperty *  pProp  )  [private]

Parameters:
pProp icalproperty object
Returns:
CProperties object
This function returns CProperties object for fiven ICAL/VCAL X property.

this kind of check is needed because libical is not able to parse X_properties if it doesn't have X- for its parameters

CParameters * ICalConverter::getParameters ( icalparameter *  pParam  )  [private]

Parameters:
pParam icalparameter object
Returns:
CParameters object
This function returns CParameters object for fiven ical parameter.

vector< CParameters * > ICalConverter::getRelationshipParamFromICal ( icalparameter *  pParam  )  [private]

Parameters:
pParam icalparameter object
Returns:
vector <CParameters*>
This function returns Relationship param from ICAL format to local database format.

int ICalConverter::getStatusFromIcal ( icalproperty_status  icalStatus  )  [private]

Parameters:
icalStatus icalproperty_status
Returns:
int
This function returns Status from ICAL format to local database format.

CParameters * ICalConverter::getLanguageFromIcal ( icalparameter *  pParam  )  [private]

Parameters:
pParam icalparameter object
Returns:
CParameters object
This function returns language param from ICAL format to local database format.

CParameters * ICalConverter::getAlterFromIcal ( icalparameter *  pParam  )  [private]

Parameters:
pParam icalparameter object
Returns:
CParameters object
This function returns altrep param from ICAL format to local database format.

vector< CParameters * > ICalConverter::getLangAlterParam ( icalproperty *  pProp  )  [private]

Parameters:
pProp icalproperty object
Returns:
vector <CParameters> object
This function returns language and altrep param from ICAL format to local database format.

int ICalConverter::getIcalStatus ( statusParam  iStatus  )  [private]

Parameters:
iStatus statusparam
Returns:
int
This function returns the mapping for status from local databse format to ICAL format.

icalparameter_reltype ICalConverter::getIcalRelType ( RelationshipType  iRel  )  [private]

Parameters:
iRel RelationshipType
Returns:
icalparameter_reltype
This function returns the mapping for RelationshipType from local databse format to ICAL format.

CParameters * ICalConverter::getFMTypeFromIcal ( icalparameter *  pParam  )  [private]

Parameters:
pParam icalparameter object
Returns:
CParameters object
This function returns FMType param from ICAL format to local database format.

icalparameter * ICalConverter::getTZIDParam (  )  [private]

Returns:
icalparameter object
This function returns the local timezone.


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