r_bookmark.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
00023 #ifndef __BARRY_RECORD_BOOKMARK_H__
00024 #define __BARRY_RECORD_BOOKMARK_H__
00025
00026 #include "dll.h"
00027 #include "record.h"
00028 #include <vector>
00029 #include <string>
00030 #include <stdint.h>
00031
00032 namespace Barry {
00033
00034
00035 class IConverter;
00036
00037 class BXEXPORT Bookmark
00038 {
00039 public:
00040 typedef Barry::UnknownsType UnknownsType;
00041
00042 uint8_t RecType;
00043 uint32_t RecordId;
00044
00045 uint8_t Index;
00046
00047 std::string Name;
00048 std::string Icon;
00049 std::string Url;
00050
00051 enum BrowserIdentityType
00052 {
00053 IdentityAuto = 0,
00054 IdentityBlackBerry,
00055 IdentityFireFox,
00056 IdentityInternetExplorer,
00057 IdentityUnknown
00058 };
00059 BrowserIdentityType BrowserIdentity;
00060
00061 enum DisplayModeType
00062 {
00063 DisplayAuto = 0,
00064 DisplayColomn,
00065 DisplayPage,
00066 DisplayUnknown
00067 };
00068 DisplayModeType DisplayMode;
00069
00070 enum JavaScriptModeType
00071 {
00072 JavaScriptAuto = 0,
00073 JavaScriptEnabled,
00074 JavaScriptDisabled,
00075 JavaScriptUnknown
00076 };
00077 JavaScriptModeType JavaScriptMode;
00078
00079 UnknownsType Unknowns;
00080
00081 protected:
00082 const unsigned char* ParseStruct1Field(const unsigned char *begin,
00083 const unsigned char *end, const IConverter *ic = 0);
00084 const unsigned char* ParseStruct2(const unsigned char *begin,
00085 const unsigned char *end, const IConverter *ic = 0);
00086
00087 public:
00088 Bookmark();
00089 ~Bookmark();
00090
00091
00092 const unsigned char* ParseField(const unsigned char *begin,
00093 const unsigned char *end, const IConverter *ic = 0);
00094 uint8_t GetRecType() const { return RecType; }
00095 uint32_t GetUniqueId() const { return RecordId; }
00096 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00097 void ParseHeader(const Data &data, size_t &offset);
00098 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00099 void BuildHeader(Data &data, size_t &offset) const;
00100 void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
00101
00102
00103 void Clear();
00104 void Dump(std::ostream &os) const;
00105 std::string GetDescription() const;
00106
00107
00108
00109 bool operator<(const Bookmark &other) const;
00110
00111
00112 static const char * GetDBName() { return "Browser Bookmarks"; }
00113 static uint8_t GetDefaultRecType() { return 1; }
00114 };
00115
00116 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Bookmark &msg) {
00117 msg.Dump(os);
00118 return os;
00119 }
00120
00121 }
00122
00123 #endif
00124