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 #ifndef VSDXTYPES_H
00032 #define VSDXTYPES_H
00033
00034 #include <libwpd/libwpd.h>
00035
00036 namespace libvisio
00037 {
00038 struct XForm
00039 {
00040 double pinX;
00041 double pinY;
00042 double height;
00043 double width;
00044 double pinLocX;
00045 double pinLocY;
00046 double angle;
00047 bool flipX;
00048 bool flipY;
00049 double x;
00050 double y;
00051 XForm() : pinX(0.0), pinY(0.0), height(0.0), width(0.0),
00052 pinLocX(0.0), pinLocY(0.0), angle(0.0),
00053 flipX(false), flipY(false), x(0.0), y(0.0) {}
00054 };
00055
00056
00057 struct ChunkHeader
00058 {
00059 unsigned chunkType;
00060 unsigned id;
00061 unsigned list;
00062 unsigned dataLength;
00063 unsigned short level;
00064 unsigned char unknown;
00065 unsigned trailer;
00066 };
00067
00068 struct Colour
00069 {
00070 Colour(unsigned red, unsigned char green, unsigned char blue, unsigned char alpha)
00071 : r(red), g(green), b(blue), a(alpha) {}
00072 Colour() : r(0), g(0), b(0), a(0) {}
00073 unsigned char r;
00074 unsigned char g;
00075 unsigned char b;
00076 unsigned char a;
00077 };
00078
00079 struct NURBSData
00080 {
00081 double lastKnot;
00082 unsigned degree;
00083 unsigned char xType;
00084 unsigned char yType;
00085 std::vector<double> knots;
00086 std::vector<double> weights;
00087 std::vector<std::pair<double, double> > points;
00088 NURBSData()
00089 : lastKnot(0.0),
00090 degree(0),
00091 xType(0x00),
00092 yType(0x00),
00093 knots(),
00094 weights(),
00095 points() {}
00096 NURBSData(const NURBSData &data)
00097 : lastKnot(data.lastKnot),
00098 degree(data.degree),
00099 xType(data.xType),
00100 yType(data.yType),
00101 knots(data.knots),
00102 weights(data.weights),
00103 points(data.points) {}
00104 NURBSData &operator=(const NURBSData &data)
00105 {
00106 lastKnot = data.lastKnot;
00107 degree = data.degree;
00108 xType = data.xType;
00109 yType = data.yType;
00110 knots = data.knots;
00111 weights = data.weights;
00112 points = data.points;
00113 return *this;
00114 }
00115 };
00116
00117 struct PolylineData
00118 {
00119 unsigned char xType;
00120 unsigned char yType;
00121 std::vector<std::pair<double, double> > points;
00122 PolylineData()
00123 : xType(0x00),
00124 yType(0x00),
00125 points() {}
00126 PolylineData(const PolylineData &data)
00127 : xType(data.xType),
00128 yType(data.yType),
00129 points(data.points) {}
00130 PolylineData &operator=(const PolylineData &data)
00131 {
00132 xType = data.xType;
00133 yType = data.yType;
00134 points = data.points;
00135 return *this;
00136 }
00137 };
00138
00139
00140 struct ForeignData
00141 {
00142 unsigned typeId;
00143 unsigned dataId;
00144 unsigned typeLevel;
00145 unsigned dataLevel;
00146 unsigned type;
00147 unsigned format;
00148 double offsetX;
00149 double offsetY;
00150 double width;
00151 double height;
00152 WPXBinaryData data;
00153 ForeignData()
00154 : typeId(0),
00155 dataId(0),
00156 typeLevel(0),
00157 dataLevel(0),
00158 type(0),
00159 format(0),
00160 offsetX(0.0),
00161 offsetY(0.0),
00162 width(0.0),
00163 height(0.0),
00164 data() {}
00165 ForeignData(const ForeignData &fd)
00166 : typeId(fd.typeId),
00167 dataId(fd.dataId),
00168 typeLevel(fd.typeLevel),
00169 dataLevel(fd.dataLevel),
00170 type(fd.type),
00171 format(fd.format),
00172 offsetX(fd.offsetX),
00173 offsetY(fd.offsetY),
00174 width(fd.width),
00175 height(fd.height),
00176 data(fd.data) {}
00177 };
00178
00179 enum TextFormat { VSD_TEXT_ANSI, VSD_TEXT_UTF16 };
00180
00181 class VSDXName
00182 {
00183 public:
00184 VSDXName(const WPXBinaryData &data, TextFormat format)
00185 : m_data(data),
00186 m_format(format) {}
00187 VSDXName() : m_data(), m_format(VSD_TEXT_ANSI) {}
00188 VSDXName(const VSDXName &element)
00189 : m_data(element.m_data),
00190 m_format(element.m_format) {}
00191 VSDXName &operator=(const VSDXName &element)
00192 {
00193 m_data = element.m_data;
00194 m_format = element.m_format;
00195 return *this;
00196 }
00197 WPXBinaryData m_data;
00198 TextFormat m_format;
00199 };
00200
00201 }
00202
00203 #endif
00204