r_calendar.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BARRY_RECORD_CALENDAR_H__
00023 #define __BARRY_RECORD_CALENDAR_H__
00024
00025 #include "dll.h"
00026 #include "record.h"
00027 #include "r_recur_base.h"
00028 #include <iosfwd>
00029 #include <string>
00030 #include <vector>
00031 #include <map>
00032 #include <stdint.h>
00033
00034 namespace Barry {
00035
00036
00037 class IConverter;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class BXEXPORT Calendar : public RecurBase
00050 {
00051 public:
00052 typedef Barry::UnknownsType UnknownsType;
00053
00054 uint8_t RecType;
00055 uint32_t RecordId;
00056
00057
00058 bool AllDayEvent;
00059 std::string Subject;
00060 std::string Notes;
00061 std::string Location;
00062 time_t NotificationTime;
00063 time_t StartTime;
00064 time_t EndTime;
00065 EmailAddressList Organizer;
00066 EmailAddressList AcceptedBy;
00067 EmailAddressList Invited;
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 enum FreeBusyFlagType {
00079 Free = 0,
00080 Tentative,
00081 Busy,
00082 OutOfOffice
00083 };
00084 FreeBusyFlagType FreeBusyFlag;
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 enum ClassFlagType {
00095 Public = 0,
00096 Confidential,
00097 Private
00098 };
00099
00100 ClassFlagType ClassFlag;
00101
00102 uint64_t CalendarID;
00103
00104 unsigned short TimeZoneCode;
00105
00106
00107
00108
00109 bool TimeZoneValid;
00110
00111
00112
00113 UnknownsType Unknowns;
00114
00115 protected:
00116 static FreeBusyFlagType FreeBusyFlagProto2Rec(uint8_t f);
00117 static uint8_t FreeBusyFlagRec2Proto(FreeBusyFlagType f);
00118
00119 static ClassFlagType ClassFlagProto2Rec(uint8_t f);
00120 static uint8_t ClassFlagRec2Proto(ClassFlagType f);
00121
00122 virtual void DumpSpecialFields(std::ostream &os) const;
00123
00124 public:
00125 const unsigned char* ParseField(const unsigned char *begin,
00126 const unsigned char *end, const IConverter *ic = 0);
00127
00128 public:
00129 Calendar();
00130 ~Calendar();
00131
00132
00133 uint8_t GetRecType() const { return RecType; }
00134 uint32_t GetUniqueId() const { return RecordId; }
00135 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00136 void ParseHeader(const Data &data, size_t &offset);
00137 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00138 void BuildHeader(Data &data, size_t &offset) const;
00139 void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
00140
00141
00142 void Clear();
00143 void Dump(std::ostream &os) const;
00144 std::string GetDescription() const;
00145
00146
00147 bool operator<(const Calendar &other) const;
00148
00149
00150 static const char * GetDBName() { return "Calendar"; }
00151 static uint8_t GetDefaultRecType() { return 5; }
00152 };
00153
00154 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Calendar &msg) {
00155 msg.Dump(os);
00156 return os;
00157 }
00158
00159
00160 class BXEXPORT CalendarAll : public Calendar
00161 {
00162 protected:
00163 virtual void DumpSpecialFields(std::ostream &os) const;
00164
00165 public:
00166 std::string MailAccount;
00167
00168 public:
00169
00170 void ParseHeader(const Data &data, size_t &offset);
00171
00172 void Clear();
00173
00174 public:
00175
00176 static const char * GetDBName() { return "Calendar - All"; }
00177 };
00178
00179 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const CalendarAll &msg) {
00180 msg.Dump(os);
00181 return os;
00182 }
00183
00184
00185
00186
00187 }
00188
00189 #endif
00190