00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __CCOMPONENT_H__
00025 #define __CCOMPONENT_H__
00026
00027
00028 #include <string>
00029 #include<sstream>
00030 #include <vector>
00031 using namespace::std;
00032 using std::string;
00033 using std::vector;
00034
00035 class CAlarm;
00036 class CRecurrence;
00037 class CRecurrenceRule;
00038 class CAttendee;
00039 class COrganizer;
00040 #include <sys/time.h>
00041
00042
00043 typedef enum {
00044 NEEDSACTION_STATUS = 0,
00045 COMPLETED_STATUS,
00046 INPROCESS_STATUS,
00047 CANCELLED_STATUS,
00048 CONFIRMED_STATUS,
00049 TENTATIVE_STATUS,
00050 DRAFT_STATUS,
00051 FINAL_STATUS,
00052 SENT_STATUS,
00053 DECLINED_STATUS,
00054 DELEGATED_STATUS,
00055 ACCEPTED_STATUS,
00056 }statusParam;
00057
00063 class CComponent {
00064
00065 public:
00066
00070 CComponent();
00071
00075 CComponent(CComponent &);
00076
00080 CComponent(string description);
00081
00085 CComponent(string summary, time_t tododue, int status);
00086
00090 CComponent(string summary, string description, string location, time_t dateStart, time_t dateEnd);
00091
00095 CComponent(string szuid, string szDescription, time_t stDateStart);
00096
00105 vector < CRecurrenceRule * >retrieveRecurreceRuleObject();
00106
00114 const CComponent & operator=(const CComponent & right);
00115
00132 CComponent(string id, int type,int flags, string summary, string description,
00133 string location, int status, time_t dateStart, time_t dateEnd,
00134 time_t lastModified,time_t iCreatedTime);
00135
00136
00143 bool setId(string sId);
00144
00151 string getId();
00152
00163 bool setType(int num);
00164
00171 int getType();
00176 bool setFlags(int iflag);
00177
00178
00185 int getFlags();
00186
00194 bool setSummary(string szSummary);
00195
00203 string getSummary();
00204
00205
00213 bool setDescription(string strDescription);
00214
00222 string getDescription();
00223
00224
00232 bool setLocation(string szLocation);
00233
00241 string getLocation();
00242
00243
00250 bool setStatus(int iStatus);
00251
00252
00259 int getStatus();
00260
00261
00268 bool setDateStart(time_t dateStart);
00269
00270
00277 time_t getDateStart();
00278
00279
00280
00287 bool setDateEnd(time_t dateEnd);
00288
00289
00296 time_t getDateEnd();
00297
00298
00305 bool setLastModified(time_t lastModified);
00306
00307
00314 bool setRecurrence(CRecurrence * ptrRecur);
00321 CRecurrence *getRecurrence();
00322
00323
00330 time_t getLastModified();
00331
00338 bool setUntil(time_t iuntil);
00345 time_t getUntil();
00346
00355 bool setGUid(string szuid);
00364 string getGUid();
00376 bool setRtype(int irtype);
00377
00390 int getRtype();
00391
00398 bool setAlarm(CAlarm * uAlarm);
00399
00406 CAlarm *getAlarm();
00407
00414 int getAllDay();
00415
00422 bool setAllDay(int iAllDay);
00423
00431 vector < time_t > generateInstanceTimes(time_t viewBegin, time_t viewEnd);
00432
00433
00441 vector < time_t > getInstanceTimes(time_t viewBegin, time_t viewEnd);
00442
00451 int getInstanceNumber(time_t viewBegin, time_t viewEnd);
00452
00453
00460 int getDuration();
00467 bool getRecurrenceProperties();
00474 bool getAlarmProperties();
00475
00479 virtual ~ CComponent();
00480
00487 void setCreatedTime(time_t iCreatedTime);
00488
00496 time_t getCreatedTime();
00500 void removeAlarm();
00504 void removeRecurrence();
00505
00506
00507
00508 string getTzid();
00509
00510
00511
00512
00513 void setTzid(string sZone);
00517 time_t getTzOffset(void);
00518
00522 void setTzOffset(time_t);
00523
00527 string toString();
00531 vector < string > extractSubStrings(string SourceString, string byField);
00542 void updateUntilInDB(time_t until,int& pErrorCode);
00543
00544
00545
00552 void setCalendarId(int iId);
00553
00560 int getCalendarId();
00561 private:
00562
00571
00572
00573 string sId;
00575 int iCalId;
00577 int iType;
00579 int iFlags;
00581 int iStatus;
00583 time_t iDateStart;
00585 time_t iDateEnd;
00587 time_t iLastModified;
00589 time_t iCreatedTime;
00591 time_t iuntil;
00593 int iAllDay;
00595 string szSummary;
00597 string szDescription;
00599 string szLocation;
00601 string szuid;
00603 CRecurrence *pRecurrence;
00605 CAlarm *pAlarm;
00607 string sTzid ;
00608
00609 time_t tzOffset;
00610
00611
00612 time_t iStDate;
00614 time_t iEndDate;
00616 vector < time_t > rTimes;
00619 };
00620
00621 #endif