00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef INCL_CLIENTRECURRENCE
00037 #define INCL_CLIENTRECURRENCE
00038
00043 #include "outlook/defs.h"
00044 #include "outlook/ClientAppException.h"
00045
00046 #include <string>
00047 #include <list>
00048
00049 typedef std::list<ClientAppException> clientExceptionList;
00050 typedef clientExceptionList::iterator clientExceptionIterator;
00051
00052
00070 class ClientRecurrence {
00071
00072 private:
00073
00074
00075 int recurrenceType;
00076 int interval;
00077 int monthOfYear;
00078 int dayOfMonth;
00079 int dayOfWeekMask;
00080 int instance;
00081 std::wstring patternStartDate;
00082 BOOL noEndDate;
00083 std::wstring patternEndDate;
00084 int occurrences;
00085
00086 std::wstring startTime;
00087 std::wstring endTime;
00088
00089 bool hasTimezone;
00090
00091
00092
00093 std::wstring start;
00094 BOOL isAllDay;
00097 std::wstring end;
00098
00099
00101 RecurrencePatternPtr pRec;
00102
00104 clientExceptionList appExceptions;
00105
00106
00110 bool recurring;
00111
00115 bool isUpdated;
00116
00118 int numRecursions;
00119
00120
00121
00123 void checkIfRecIsCorrect();
00124
00126 bool changeDay(const std::wstring dest);
00127
00128
00129
00130
00131
00133 ClientAppException* getExceptionOnClient(const int index);
00134 const int getExceptionsCountOnClient();
00135 int saveException(ClientAppException* cException);
00136
00137
00138
00139
00144 TIME_ZONE_INFORMATION timeZoneInfo;
00145
00146 public:
00147
00149 ClientRecurrence();
00150
00152 ~ClientRecurrence();
00153
00155 void setCOMPtr(RecurrencePatternPtr& ptr);
00156
00157
00158
00165 int read();
00166
00173 int refresh();
00174
00183 int save();
00184
00185
00186
00188 bool isRecurring();
00189
00192 void setRecurrence();
00193
00196 void clearRecurrence();
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206 const int getRecurrenceType ();
00207 const int getInterval ();
00208 const int getMonthOfYear ();
00209 const int getDayOfMonth ();
00210 const int getDayOfWeekMask ();
00211 const int getInstance ();
00212 const std::wstring& getPatternStartDate();
00213 const BOOL getNoEndDate ();
00214 const std::wstring& getPatternEndDate ();
00215 const int getOccurrences ();
00216
00217 const std::wstring& getStartTime ();
00218 const std::wstring& getEndTime ();
00219
00220 bool getHasTimezone () { return hasTimezone; }
00221 void setHasTimezone (bool v) { hasTimezone = v; }
00222
00223
00224 const std::wstring getProperty(const std::wstring& propertyName);
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 void setRecurrenceType (const int val);
00237 void setInterval (const int val);
00238 void setMonthOfYear (const int val);
00239 void setDayOfMonth (const int val);
00240 void setDayOfWeekMask (const int val);
00241 void setInstance (const int val);
00242 void setPatternStartDate(const std::wstring& val);
00243 void setNoEndDate (const BOOL val);
00244 void setPatternEndDate (const std::wstring& val);
00245 void setOccurrences (const int val);
00246
00247 void setStartTime (const std::wstring& val);
00248 void setEndTime (const std::wstring& val);
00249
00251 void setStart (const std::wstring& val);
00252 void setIsAllDay (const BOOL val);
00253
00254
00255 void setEnd (const std::wstring& val);
00256
00257
00258
00259 int setProperty(const std::wstring& propertyName, const std::wstring& propertyValue);
00260
00261
00262
00263
00264
00265
00266 ClientAppException* getException(const int index);
00267 const int getExceptionsCount();
00268 int addException(ClientAppException* cException);
00269 void resetExceptions();
00270 int saveAllExceptions();
00271 int removeDuplicatedExceptions();
00272
00273 _AppointmentItemPtr getOccurrence(const DATE originalDate);
00274
00275
00276 void setRecurringTimezone(const TIME_ZONE_INFORMATION* tz) {timeZoneInfo = *tz; }
00277
00278 const TIME_ZONE_INFORMATION& getRecurringTimezone() const { return timeZoneInfo; }
00279
00280
00281 };
00282
00285 #endif