00001
00020 #ifndef __CCOMPONENT_H__
00021 #define __CCOMPONENT_H__
00022
00023
00024 #include <string>
00025 #include<sstream>
00026 #include <vector>
00027 using namespace::std;
00028 using std::string;
00029 using std::vector;
00030
00031 class CAlarm;
00032 class CRecurrence;
00033 class CRecurrenceRule;
00034 class CAttendee;
00035 class COrganizer;
00036 #include <sys/time.h>
00037
00038
00039 typedef enum {
00040 NEEDSACTION_STATUS = 0,
00041 COMPLETED_STATUS,
00042 INPROCESS_STATUS,
00043 CANCELLED_STATUS,
00044 CONFIRMED_STATUS,
00045 TENTATIVE_STATUS,
00046 DRAFT_STATUS,
00047 FINAL_STATUS,
00048 SENT_STATUS,
00049 DECLINED_STATUS,
00050 DELEGATED_STATUS,
00051 ACCEPTED_STATUS,
00052 }statusParam;
00053
00059 class CComponent {
00060
00061 public:
00062
00066 CComponent();
00067
00071 CComponent(CComponent &);
00072
00076 CComponent(string description);
00077
00081 CComponent(string summary, time_t tododue, int status);
00082
00086 CComponent(string summary, string description, string location, time_t dateStart, time_t dateEnd);
00087
00091 CComponent(string szuid, string szDescription, time_t stDateStart);
00092
00101 vector < CRecurrenceRule * >retrieveRecurreceRuleObject();
00102
00110 const CComponent & operator=(const CComponent & right);
00111
00128 CComponent(string id, int type,int flags, string summary, string description,
00129 string location, int status, time_t dateStart, time_t dateEnd,
00130 time_t lastModified,time_t iCreatedTime);
00131
00132
00139 bool setId(string sId);
00140
00147 string getId();
00148
00159 bool setType(int num);
00160
00167 int getType();
00172 bool setFlags(int iflag);
00173
00174
00181 int getFlags();
00182
00190 bool setSummary(string szSummary);
00191
00199 string getSummary();
00200
00201
00209 bool setDescription(string strDescription);
00210
00218 string getDescription();
00219
00220
00228 bool setLocation(string szLocation);
00229
00237 string getLocation();
00238
00239
00246 bool setStatus(int iStatus);
00247
00248
00255 int getStatus();
00256
00257
00264 bool setDateStart(time_t dateStart);
00265
00266
00273 time_t getDateStart();
00274
00275
00276
00283 bool setDateEnd(time_t dateEnd);
00284
00285
00292 time_t getDateEnd();
00293
00294
00301 bool setLastModified(time_t lastModified);
00302
00303
00310 bool setRecurrence(CRecurrence * ptrRecur);
00317 CRecurrence *getRecurrence();
00318
00319
00326 time_t getLastModified();
00327
00334 bool setUntil(time_t iuntil);
00341 time_t getUntil();
00342
00351 bool setGUid(string szuid);
00360 string getGUid();
00372 bool setRtype(int irtype);
00373
00386 int getRtype();
00387
00394 bool setAlarm(CAlarm * uAlarm);
00395
00402 CAlarm *getAlarm();
00403
00410 int getAllDay();
00411
00418 bool setAllDay(int iAllDay);
00419
00427 vector < time_t > generateInstanceTimes(time_t viewBegin, time_t viewEnd);
00428
00429
00437 vector < time_t > getInstanceTimes(time_t viewBegin, time_t viewEnd);
00438
00447 int getInstanceNumber(time_t viewBegin, time_t viewEnd);
00448
00449
00456 int getDuration();
00463 bool getRecurrenceProperties();
00470 bool getAlarmProperties();
00471
00475 virtual ~ CComponent();
00476
00483 void setCreatedTime(time_t iCreatedTime);
00484
00492 time_t getCreatedTime();
00496 void removeAlarm();
00500 void removeRecurrence();
00501
00502
00503
00504 string getTzid();
00505
00506
00507
00508
00509 void setTzid(string sZone);
00513 time_t getTzOffset(void);
00514
00518 void setTzOffset(time_t);
00519
00523 string toString();
00527 vector < string > extractSubStrings(string SourceString, string byField);
00538 void updateUntilInDB(time_t until,int& pErrorCode);
00539
00540 private:
00541
00550
00551
00552 string sId;
00554 int iType;
00556 int iFlags;
00558 int iStatus;
00560 time_t iDateStart;
00562 time_t iDateEnd;
00564 time_t iLastModified;
00566 time_t iCreatedTime;
00568 time_t iuntil;
00570 int iAllDay;
00572 string szSummary;
00574 string szDescription;
00576 string szLocation;
00578 string szuid;
00580 CRecurrence *pRecurrence;
00582 CAlarm *pAlarm;
00584 string sTzid ;
00585
00586 time_t tzOffset;
00587
00588
00589 time_t iStDate;
00591 time_t iEndDate;
00593 vector < time_t > rTimes;
00596 };
00597
00598 #endif