CRecurrenceRule Class Reference

This class contains the information about Recurrence rule for particular component. More...

#include <CRecurrenceRule.h>


Public Member Functions

 CRecurrenceRule (CRecurrenceRule &ref)
CRecurrenceRuleoperator= (CRecurrenceRule &right)
 CRecurrenceRule ()
 ~CRecurrenceRule ()
bool setRuleType (RuleType iType)
RuleType getRuleType ()
bool rruleParser (string szRule)
bool setRrule (string szRRule)
string getRrule ()
bool setFrequency (FREQUENCY iValue)
FREQUENCY getFrequency ()
bool setUntil (time_t iUntil)
time_t getUntil ()
bool setCount (int iCount)
int getCount ()
bool setSecond (vector< short > vSec)
vector< short > getSecond ()
bool setMinute (vector< short > vMinute)
vector< short > getMinute ()
bool setHour (vector< short > vHour)
vector< short > getHour ()
bool setWeekDay (vector< short > vByWeekDay)
vector< short > getWeekDay ()
bool setMonthDay (vector< short > vByMonthDay)
vector< short > getMonthDay ()
bool setYearDay (vector< short > vByYearDay)
vector< short > getYearDay ()
bool setWeekNumber (vector< short > vByWeekNumber)
vector< short > getWeekNumber ()
bool setMonth (vector< short > vMonth)
vector< short > getMonth ()
bool setPos (vector< short > vPosition)
vector< short > getPos ()
bool setWeekStart (icalrecurrencetype_weekday start)
icalrecurrencetype_weekday getWeekStart ()
bool setInterval (short interval)
short getInterval ()
string toString ()
 CRecurrenceRule (int iType, string szRRule)
bool checkRuleIsComplex ()

Private Member Functions

vector< short > convertArrayToVector (short array[], int iLengthMax)

Private Attributes

FREQUENCY iFreq
string szRule
int iCount
short interval
time_t iUntil
RuleType iType
icalrecurrencetype_weekday weekStart
vector< short > vBySecond
vector< short > vByMinute
vector< short > vByHour
vector< short > vByWeekDay
vector< short > vByMonthDay
vector< short > vByYearDay
vector< short > vByWeekNumber
vector< short > vByMonth
vector< short > vBySetPos


Detailed Description

This class contains the information about Recurrence rule for particular component.

CRecurrenceRule class


Constructor & Destructor Documentation

CRecurrenceRule::CRecurrenceRule ( CRecurrenceRule ref  ) 

CRecurrenceRule::CRecurrenceRule (  ) 

CRecurrenceRule::~CRecurrenceRule (  ) 

Destructor of the class

CRecurrenceRule::CRecurrenceRule ( int  iType,
string  szRRule 
)

overloaded Constructor type 0-rrule ,1 -exrule

References iCount, iFreq, interval, iUntil, szRule, vByHour, vByMinute, vByMonth, vByMonthDay, vBySecond, vBySetPos, vByWeekDay, vByWeekNumber, vByYearDay, and weekStart.


Member Function Documentation

CRecurrenceRule & CRecurrenceRule::operator= ( CRecurrenceRule right  ) 

bool CRecurrenceRule::setRuleType ( RuleType  iType  ) 

setRuleType

Parameters:
RuleType type of recurrence rule 0 - RecurrenceRule ;1 -Exception Rule
Returns:
boolean
function used to decide the rule type

setRuleType

Parameters:
int type of recurrence rule 0 - RecurrenceRule ;1 -Exception Rule
Returns:
boolean
function used to decide the rule type

Referenced by ICalConverter::getRecurrence().

RuleType CRecurrenceRule::getRuleType (  ) 

getRuleType

Parameters:
NONE 
Returns:
RuleType type of recurrence rule 0 - RecurrenceRule ;1 -Exception Rule
function used to retrieve rule type from CRecurrenceRule object

getRuleType

Parameters:
NONE 
Returns:
int type of recurrence rule 0 - RecurrenceRule ;1 -Exception Rule function used to retrieve rule type from CRecurrenceRule object

References iType.

Referenced by ICalConverter::localToIcalVcal().

bool CRecurrenceRule::rruleParser ( string  szRule  ) 

Parameters:
string szRule recurrence rule, can be recurrence rule or exception rule
Returns:
bool status of the operation
Function used to parse the recurrence rule and populate the fields in to private members of this class All other set methods defined in this class will be called inside this procedure

rruleParser()

Parameters:
string : recurrence rule, can be recurrence rule or exception rule
Returns:
: bool status of the operation
Function used to parse the recurrence rule and populate the fields in to private members of this class All other set methods defined in this class will be called inside this procedure

currently libical is used later this dependency has to be removed and Funambol API should be used

References convertArrayToVector(), iCount, iFreq, interval, vByHour, vByMinute, vByMonth, vByMonthDay, vBySecond, vBySetPos, vByWeekDay, vByWeekNumber, and vByYearDay.

Referenced by ICalConverter::importEventRecurrence().

bool CRecurrenceRule::setRrule ( string  szRRule  ) 

Parameters:
: string szRRule - recurrence rule / exception rule
Returns:
: bool whether the operation is successful or not
Function to set recurrence rule in class place holder

setRrule

Parameters:
: string rrule - recurrence rule / exception rule
Returns:
: bool whether the operation is successful or not Function to set recurrence rule in class place holder

References szRule.

Referenced by ICalConverter::getRecurrenceRule().

string CRecurrenceRule::getRrule (  ) 

Parameters:
: NONE
Returns:
: string recurrence rule
Function used to retrieve recurrence values from class members

getRrule()

Parameters:
: NONE
Returns:
: string recurrence rule Function used to retrieve recurrence values from class members

References szRule.

Referenced by ICalConverter::localToIcalVcal(), and toString().

bool CRecurrenceRule::setFrequency ( FREQUENCY  iValue  ) 

Parameters:
FREQUENCY : ivaluea frequebncy can be daily,monthly etc, valid values defined in FREQUENCY enumeration.
Returns:
bool: status
to set FREQUENCY of occurrence

setFrequency

Parameters:
FREQUENCY : ivalue
Returns:
bool: status to set FREQUENCY of occurrence

References iFreq.

FREQUENCY CRecurrenceRule::getFrequency (  ) 

Parameters:
NONE 
Returns:
FREQUENCY of occurrence
function returns FREQUENCY parameter set in the class

getFREQUENCY

Parameters:
NONE 
Returns:
FREQUENCY of occurrence function returns FREQUENCY parameter set in the class

References iFreq.

Referenced by toString().

bool CRecurrenceRule::setUntil ( time_t  iUntil  ) 

Parameters:
time_t : until value in rrule as time_t
Returns:
bool : status of operation performed
function used to set unitl time in CRecurrencRule object

setUntil(time_t until)

Parameters:
time_t : until value in rrule as time_t
Returns:
bool : status of operation performed
function used to set unitl time in CRecurrencRule object

time_t CRecurrenceRule::getUntil (  ) 

Parameters:
: NONE
Returns:
unitl :time_t status of operation performed
function used to set until time in CRecurrencRule object

getUntil()

Parameters:
: NONE
Returns:
unitl :time_t status of operation performed
function used to set until time in CRecurrencRule object

References iUntil.

bool CRecurrenceRule::setCount ( int  iCount  ) 

Parameters:
: integer Count of occurances
Returns:
: boolean status of operation performed
Function used to set MAX count of instances

setCount

Parameters:
: integer Count of occurances
Returns:
: boolean status of operation performed
Function used to set MAX count of instances

int CRecurrenceRule::getCount (  ) 

Parameters:
: NONE
Returns:
: integer count of occurances
Function used to retrieve MAX count of instances

getCount

Parameters:
: NONE
Returns:
: integer count of occurances
Function used to retrieve MAX count of instances

References iCount.

bool CRecurrenceRule::setSecond ( vector< short >  vSec  ) 

Parameters:
vector<short>,: seconds list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set seconds in list of seconds appearing in Recurrence rule

setSecond

Parameters:
vector<short>,: seconds list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set seconds in list of seconds appearing in Recurrence rule

References vBySecond.

vector< short > CRecurrenceRule::getSecond (  ) 

Parameters:
NONE 
Returns:
vector<short>: seconds list on which the events should occur
Function used to get seconds list in CRecurrenceRule Class

getSecond

Parameters:
NONE 
Returns:
vector<short>: seconds list on which the events should occur
Function used to get seconds list in CRecurrenceRule Class

References vBySecond.

bool CRecurrenceRule::setMinute ( vector< short >  vMinute  ) 

Parameters:
vector<short>,: Minute list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Minutes appearig in Recurrence rule to CRecurrenceRule class

setMinute

Parameters:
vector<short>,: Minute list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Minutes appearig in Recurrence rule to CRecurrenceRule class

References vByMinute.

vector< short > CRecurrenceRule::getMinute (  ) 

Returns:
vector<short>: Minute list on which the events should occur
Parameters:
NONE Function used to get Minutes in CRecurrenceRule class
getMinute
Returns:
vector<short>: Minute list on which the events should occur
Parameters:
NONE Function used to get Minutes in CRecurrenceRule class

References vByMinute.

bool CRecurrenceRule::setHour ( vector< short >  vHour  ) 

Parameters:
vector<short>,: Hour list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Hours appearing in Recurrence rule to CRecurrenceRule class

setHour

Parameters:
vector<short>,: Hour list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Hours appearing in Recurrence rule to CRecurrenceRule class

References vByHour.

vector< short > CRecurrenceRule::getHour (  ) 

Parameters:
NONE 
Returns:
vector<short>: Hour list on which the events should occur
Function used to get Hours in CRecurrenceRule class

getHour

Parameters:
NONE 
Returns:
vector<short>: Hour list on which the events should occur
Function used to get Hours in CRecurrenceRule class

References vByHour.

bool CRecurrenceRule::setWeekDay ( vector< short >  vByWeekDay  ) 

Parameters:
vector<short>,: WeekDay list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set WeekDays SU.MO,TU etc appearing in Recurrence rule to CRecurrenceRule class

setWeekDay

Parameters:
vector<short>,: WeekDay list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set WeekDays SU.MO,TU etc appearing in Recurrence rule to CRecurrenceRule class

vector< short > CRecurrenceRule::getWeekDay (  ) 

Parameters:
NONE 
Returns:
vector<short>: WeekDay list on which the events should occur
Function used to get WeekDays SU.MO,TU etc in CRecurrenceRule class

getWeekDay

Parameters:
NONE 
Returns:
vector<short>: WeekDay list on which the events should occur
Function used to get WeekDays SU.MO,TU etc in CRecurrenceRule class

References vByWeekDay.

bool CRecurrenceRule::setMonthDay ( vector< short >  vMonthDays  ) 

Parameters:
vector<short>,: MonthDay list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Month Days appearing in Recurrence rule to CRecurrenceRule

setMonthDay

Parameters:
vector<short> : month days 0-31
Returns:
bool status of operation Function to add Month day in recurrence rule

References vByMonthDay.

vector< short > CRecurrenceRule::getMonthDay (  ) 

Parameters:
NONE 
Returns:
vector<short>: YearDay list on which the events should occur
Function used to Retrieve MonthDay appearing in CRecurrenceRule class

getMonthDay

Parameters:
NONE 
Returns:
vector<short> : month days 0-31 Function to retrieve list of month days

References vByMonthDay.

bool CRecurrenceRule::setYearDay ( vector< short >  vByYearDay  ) 

Parameters:
vector<short>,: YearDay list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set YearDay appearing in Recurrence rule to CRecurrenceRule class Eg: RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200

setYearDay

Parameters:
vector<short>,: YearDay list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set YearDay appearing in Recurrence rule to CRecurrenceRule class Eg: RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200

vector< short > CRecurrenceRule::getYearDay (  ) 

Parameters:
NONE 
Returns:
vector<short>: YearDay list on which the events should occur
Function used to Retrieve YearDay appearing in CRecurrenceRule class

getYearDay

Parameters:
NONE 
Returns:
vector<short>: YearDay list on which the events should occur
Function used to Retrieve YearDay appearing in CRecurrenceRule class

References vByYearDay.

bool CRecurrenceRule::setWeekNumber ( vector< short >  vByWeekNumber  ) 

Parameters:
vector<short>,: WeekNumeber list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set WeekNumber appearing in Recurrence rule to CRecurrenceRule class

setWeekNumber

Parameters:
vector<short>,: WeekNumeber list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set WeekNumber appearing in Recurrence rule to CRecurrenceRule class

vector< short > CRecurrenceRule::getWeekNumber (  ) 

Parameters:
NONE 
Returns:
vector<short>: WeekNumeber list on which the events should occur
Function used to get WeekNumber appearing in CRecurrenceRule class

getWeekNumber

Parameters:
NONE 
Returns:
vector<short>: WeekNumeber list on which the events should occur
Function used to get WeekNumber appearing in CRecurrenceRule class

References vByWeekNumber.

bool CRecurrenceRule::setMonth ( vector< short >  vMonth  ) 

Parameters:
vector<short>,: Month list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Month list appearing in Recurrence rule to CRecurrenceRule class

setMonth

Parameters:
vector<short>,: Month list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Month list appearing in Recurrence rule to CRecurrenceRule class

References vByMonth.

vector< short > CRecurrenceRule::getMonth (  ) 

Parameters:
NONE 
Returns:
vector<short>: Month list on which the events should occur
Function used to get Month list appearing in CRecurrenceRule class

getMonth

Parameters:
NONE 
Returns:
vector<short>: Month list on which the events should occur
Function used to get Month list appearing in CRecurrenceRule class

References vByMonth.

bool CRecurrenceRule::setPos ( vector< short >  vPosition  ) 

Parameters:
vector<short>,: Position list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Position list appearing in Recurrence rule to CRecurrenceRule class eg : The BYSETPOS rule part specifies a COMMA character (US-ASCII decimal 44) separated list of values which corresponds to the nth occurrence within the set of events specified by the rule. Valid values are 1 to 366 or -366 to -1. It MUST only be used in conjunction with another BYxxx rule part. For example "the last work day of the month" could be represented as: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1

setPos

Parameters:
vector<short>,: Position list on which the events should occur
Returns:
boolean: staus of the operation
Function used to set Position list appearing in Recurrence rule to CRecurrenceRule class eg : The BYSETPOS rule part specifies a COMMA character (US-ASCII decimal 44) separated list of values which corresponds to the nth occurrence within the set of events specified by the rule. Valid values are 1 to 366 or -366 to -1. It MUST only be used in conjunction with another BYxxx rule part. For example "the last work day of the month" could be represented as: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1

References vBySetPos.

vector< short > CRecurrenceRule::getPos (  ) 

Parameters:
NONE 
Returns:
vector<short>: Position list on which the events should occur
Function used to get Position list from CRecurrenceRule class

getPos

Parameters:
NONE 
Returns:
vector<short>: Position list on which the events should occur
Function used to get Position list from CRecurrenceRule class

References vBySetPos.

bool CRecurrenceRule::setWeekStart ( icalrecurrencetype_weekday  start  ) 

Parameters:
int : weekstart offset day from which week starts in Calendar in our calendar it is either SUNDAY or MONDAY
Returns:
boolean: staus of the operation
Function used to set week start appearing in Recurrence rule to CRecurrenceRule class Eg: DTSTART;TZID=US-Eastern:19970805T090000 RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO ==> (1997 EDT)Aug 5,10,19,24 changing only WKST from MO to SU, yields different results... DTSTART;TZID=US-Eastern:19970805T090000 RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU ==> (1997 EDT)August 5,17,19,31

setPos

Parameters:
int : weekstart offset day from which week starts in Calendar in our calendar it is either SUNDAY or MONDAY
Returns:
boolean: staus of the operation
Function used to set week start appearing in Recurrence rule to CRecurrenceRule class Eg: DTSTART;TZID=US-Eastern:19970805T090000 RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO ==> (1997 EDT)Aug 5,10,19,24 changing only WKST from MO to SU, yields different results... DTSTART;TZID=US-Eastern:19970805T090000 RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU ==> (1997 EDT)August 5,17,19,31

References weekStart.

icalrecurrencetype_weekday CRecurrenceRule::getWeekStart (  ) 

@ int : weekstart offset day from which week starts in Calendar in our calendar it is either SUNDAY or MONDAY

Returns:
boolean: staus of the operation
Function used to get week start day from CRecurrenceRule class

getPos

Parameters:
int : weekstart offset day from which week starts in Calendar in our calendar it is either SUNDAY or MONDAY
Returns:
boolean: staus of the operation
Function used to get week start day from CRecurrenceRule class

References weekStart.

Referenced by toString().

bool CRecurrenceRule::setInterval ( short  interval  ) 

Parameters:
short : interval between two instances
Returns:
: bool status of the operation Function used to set the interval param
setInterval
Parameters:
short : interval between two instances
Returns:
: bool status of the operation Function used to set the interval param

short CRecurrenceRule::getInterval (  ) 

Parameters:
NONE 
Returns:
short: interval between instances
Function used to retrieve interval parameter

getInterval

Parameters:
NONE 
Returns:
short: interval between instances
Function used to retrieve interval parameter

References interval.

string CRecurrenceRule::toString (  ) 

bool CRecurrenceRule::checkRuleIsComplex (  ) 

Function used for checking whether rule is complex

References vByMonth, vByMonthDay, vBySetPos, vByWeekDay, vByWeekNumber, and vByYearDay.

Referenced by ICalConverter::importEventRecurrence().

vector< short > CRecurrenceRule::convertArrayToVector ( short  array[],
int  iLengthMax 
) [private]

Parameters:
array of short
Returns:
vector of short;
function to convert array to vector

convertArrayToVector()

Parameters:
array of short
Returns:
vector of short;
function to convert array to vector

After parsing Recurrence rule using ICAL API all arrays are populated with default value of 32639 , to save memory consumption we have filtered out default values

Referenced by rruleParser().


Field Documentation

FREQUENCY CRecurrenceRule::iFreq [private]

string CRecurrenceRule::szRule [private]

RRule or Exception Rule

Referenced by CRecurrenceRule(), getRrule(), operator=(), and setRrule().

int CRecurrenceRule::iCount [private]

integer value

Referenced by CRecurrenceRule(), getCount(), operator=(), rruleParser(), and toString().

short CRecurrenceRule::interval [private]

interval appearing in rrule

Referenced by CRecurrenceRule(), getInterval(), operator=(), rruleParser(), and toString().

time_t CRecurrenceRule::iUntil [private]

Until value

Referenced by CRecurrenceRule(), getUntil(), operator=(), and toString().

RuleType CRecurrenceRule::iType [private]

Rule type

Referenced by CRecurrenceRule(), getRuleType(), and operator=().

icalrecurrencetype_weekday CRecurrenceRule::weekStart [private]

week start as per rfc Ical is week day from which recuurenc has to start. Our Calendar app supports SU or MO for week start.

Referenced by CRecurrenceRule(), getWeekStart(), operator=(), and setWeekStart().

vector< short > CRecurrenceRule::vBySecond [private]

(0-60) second values

Referenced by CRecurrenceRule(), getSecond(), operator=(), rruleParser(), setSecond(), and toString().

vector< short > CRecurrenceRule::vByMinute [private]

(0-60) Minute values

Referenced by CRecurrenceRule(), getMinute(), operator=(), rruleParser(), setMinute(), and toString().

vector< short > CRecurrenceRule::vByHour [private]

(0-24) Hour values

Referenced by CRecurrenceRule(), getHour(), operator=(), rruleParser(), setHour(), and toString().

vector< short > CRecurrenceRule::vByWeekDay [private]

(SU,MO,TU,WE,TH,FR,ST) WeekDay values

Referenced by checkRuleIsComplex(), CRecurrenceRule(), getWeekDay(), operator=(), rruleParser(), and toString().

vector< short > CRecurrenceRule::vByMonthDay [private]

vector< short > CRecurrenceRule::vByYearDay [private]

vector< short > CRecurrenceRule::vByWeekNumber [private]

vector< short > CRecurrenceRule::vByMonth [private]

vector< short > CRecurrenceRule::vBySetPos [private]

(1-366) SetPosition values

Referenced by checkRuleIsComplex(), CRecurrenceRule(), getPos(), operator=(), rruleParser(), setPos(), and toString().


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