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 std::vector<UnknownField> 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
00103 unsigned short TimeZoneCode;
00104
00105
00106
00107
00108 bool TimeZoneValid;
00109
00110
00111
00112 UnknownsType Unknowns;
00113
00114 protected:
00115 static FreeBusyFlagType FreeBusyFlagProto2Rec(uint8_t f);
00116 static uint8_t FreeBusyFlagRec2Proto(FreeBusyFlagType f);
00117
00118 static ClassFlagType ClassFlagProto2Rec(uint8_t f);
00119 static uint8_t ClassFlagRec2Proto(ClassFlagType f);
00120
00121 public:
00122 const unsigned char* ParseField(const unsigned char *begin,
00123 const unsigned char *end, const IConverter *ic = 0);
00124
00125 public:
00126 Calendar();
00127 ~Calendar();
00128
00129
00130 uint8_t GetRecType() const { return RecType; }
00131 uint32_t GetUniqueId() const { return RecordId; }
00132 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00133 void ParseHeader(const Data &data, size_t &offset);
00134 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00135 void BuildHeader(Data &data, size_t &offset) const;
00136 void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
00137
00138 void Clear();
00139
00140 void Dump(std::ostream &os) const;
00141
00142
00143 bool operator<(const Calendar &other) const { return StartTime < other.StartTime; }
00144
00145
00146 static const char * GetDBName() { return "Calendar"; }
00147 static uint8_t GetDefaultRecType() { return 5; }
00148 };
00149
00150 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Calendar &msg) {
00151 msg.Dump(os);
00152 return os;
00153 }
00154
00155
00156
00157 }
00158
00159 #endif
00160