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 VSDCOLLECTOR_H
00032 #define VSDCOLLECTOR_H
00033
00034 #include <vector>
00035 #include <boost/optional.hpp>
00036 #include "VSDParser.h"
00037
00038 namespace libvisio
00039 {
00040
00041 class VSDCollector
00042 {
00043 public:
00044 VSDCollector() {};
00045 virtual ~VSDCollector() {}
00046
00047 virtual void collectEllipticalArcTo(unsigned id, unsigned level, double x3, double y3, double x2, double y2, double angle, double ecc) = 0;
00048 virtual void collectForeignData(unsigned level, const WPXBinaryData &binaryData) = 0;
00049 virtual void collectOLEList(unsigned id, unsigned level) = 0;
00050 virtual void collectOLEData(unsigned id, unsigned level, const WPXBinaryData &oleData) = 0;
00051 virtual void collectEllipse(unsigned id, unsigned level, double cx, double cy, double xleft, double yleft, double xtop, double ytop) = 0;
00052 virtual void collectLine(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern,
00053 const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker,
00054 const boost::optional<unsigned char> &lineCap) = 0;
00055 virtual void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG,
00056 const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency,
00057 const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern,
00058 const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY) = 0;
00059 virtual void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG,
00060 const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency,
00061 const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern,
00062 const boost::optional<Colour> &shfgc) = 0;
00063 virtual void collectGeometry(unsigned id, unsigned level, bool noFill, bool noLine, bool noShow) = 0;
00064 virtual void collectMoveTo(unsigned id, unsigned level, double x, double y) = 0;
00065 virtual void collectLineTo(unsigned id, unsigned level, double x, double y) = 0;
00066 virtual void collectArcTo(unsigned id, unsigned level, double x2, double y2, double bow) = 0;
00067 virtual void collectNURBSTo(unsigned id, unsigned level, double x2, double y2, unsigned char xType, unsigned char yType, unsigned degree,
00068 std::vector<std::pair<double, double> > controlPoints, std::vector<double> knotVector, std::vector<double> weights) = 0;
00069 virtual void collectNURBSTo(unsigned id, unsigned level, double x2, double y2, double knot, double knotPrev, double weight, double weightPrev, unsigned dataID) = 0;
00070 virtual void collectNURBSTo(unsigned id, unsigned level, double x2, double y2, double knot, double knotPrev, double weight, double weightPrev, const NURBSData &data) = 0;
00071 virtual void collectPolylineTo(unsigned id, unsigned level, double x, double y, unsigned char xType, unsigned char yType, const std::vector<std::pair<double, double> > &points) = 0;
00072 virtual void collectPolylineTo(unsigned id, unsigned level, double x, double y, unsigned dataID) = 0;
00073 virtual void collectPolylineTo(unsigned id, unsigned level, double x, double y, const PolylineData &data) = 0;
00074 virtual void collectShapeData(unsigned id, unsigned level, unsigned char xType, unsigned char yType, unsigned degree, double lastKnot,
00075 std::vector<std::pair<double, double> > controlPoints, std::vector<double> knotVector, std::vector<double> weights) = 0;
00076 virtual void collectShapeData(unsigned id, unsigned level, unsigned char xType, unsigned char yType, std::vector<std::pair<double, double> > points) = 0;
00077 virtual void collectXFormData(unsigned level, const XForm &xform) = 0;
00078 virtual void collectTxtXForm(unsigned level, const XForm &txtxform) = 0;
00079 virtual void collectShapesOrder(unsigned id, unsigned level, const std::vector<unsigned> &shapeIds) = 0;
00080 virtual void collectForeignDataType(unsigned level, unsigned foreignType, unsigned foreignFormat, double offsetX, double offsetY, double width, double height) = 0;
00081 virtual void collectPageProps(unsigned id, unsigned level, double pageWidth, double pageHeight, double shadowOffsetX, double shadowOffsetY, double scale) = 0;
00082 virtual void collectPage(unsigned id, unsigned level, unsigned backgroundPageID, bool isBackgroundPage) = 0;
00083 virtual void collectShape(unsigned id, unsigned level, unsigned parent, unsigned masterPage, unsigned masterShape, unsigned lineStyle, unsigned fillStyle, unsigned textStyle) = 0;
00084 virtual void collectSplineStart(unsigned id, unsigned level, double x, double y, double secondKnot, double firstKnot, double lastKnot, unsigned degree) = 0;
00085 virtual void collectSplineKnot(unsigned id, unsigned level, double x, double y, double knot) = 0;
00086 virtual void collectSplineEnd() = 0;
00087 virtual void collectInfiniteLine(unsigned id, unsigned level, double x1, double y1, double x2, double y2) = 0;
00088 virtual void collectRelCubBezTo(unsigned id, unsigned level, double x, double y, double a, double b, double c, double d) = 0;
00089 virtual void collectRelEllipticalArcTo(unsigned id, unsigned level, double x, double y, double a, double b, double c, double d) = 0;
00090 virtual void collectRelLineTo(unsigned id, unsigned level, double x, double y) = 0;
00091 virtual void collectRelMoveTo(unsigned id, unsigned level, double x, double y) = 0;
00092 virtual void collectRelQuadBezTo(unsigned id, unsigned level, double x, double y, double a, double b) = 0;
00093
00094 virtual void collectUnhandledChunk(unsigned id, unsigned level) = 0;
00095
00096 virtual void collectText(unsigned level, const ::WPXBinaryData &textStream, TextFormat format) = 0;
00097 virtual void collectCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font,
00098 const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold,
00099 const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline,
00100 const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps,
00101 const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript,
00102 const boost::optional<bool> &subscript) = 0;
00103 virtual void collectDefaultCharStyle(unsigned charCount, const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour,
00104 const boost::optional<double> &fontSize, const boost::optional<bool> &bold, const boost::optional<bool> &italic,
00105 const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout,
00106 const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps,
00107 const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, const boost::optional<bool> &subscript) = 0;
00108 virtual void collectParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst,
00109 const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine,
00110 const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align,
00111 const boost::optional<unsigned> &flags) = 0;
00112 virtual void collectDefaultParaStyle(unsigned charCount, const boost::optional<double> &indFirst, const boost::optional<double> &indLeft,
00113 const boost::optional<double> &indRight, const boost::optional<double> &spLine, const boost::optional<double> &spBefore,
00114 const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, const boost::optional<unsigned> &flags) = 0;
00115 virtual void collectTextBlock(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin,
00116 const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin,
00117 const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled,
00118 const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop,
00119 const boost::optional<unsigned char> &textDirection) = 0;
00120 virtual void collectNameList(unsigned id, unsigned level) = 0;
00121 virtual void collectName(unsigned id, unsigned level, const ::WPXBinaryData &name, TextFormat format) = 0;
00122 virtual void collectPageSheet(unsigned id, unsigned level) = 0;
00123
00124
00125 virtual void collectStyleSheet(unsigned id, unsigned level,unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle) = 0;
00126 virtual void collectLineStyle(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern,
00127 const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker,
00128 const boost::optional<unsigned char> &lineCap) = 0;
00129 virtual void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG,
00130 const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency,
00131 const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern,
00132 const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY) = 0;
00133 virtual void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG,
00134 const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency,
00135 const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern,
00136 const boost::optional<Colour> &shfgc) = 0;
00137 virtual void collectCharIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font,
00138 const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold,
00139 const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline,
00140 const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps,
00141 const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript,
00142 const boost::optional<bool> &subscript) = 0;
00143 virtual void collectParaIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst,
00144 const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine,
00145 const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align,
00146 const boost::optional<unsigned> &flags) = 0;
00147 virtual void collectTextBlockStyle(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin,
00148 const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin,
00149 const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled,
00150 const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop,
00151 const boost::optional<unsigned char> &textDirection) = 0;
00152
00153 virtual void collectFieldList(unsigned id, unsigned level) = 0;
00154 virtual void collectTextField(unsigned id, unsigned level, int nameId, int formatStringId) = 0;
00155 virtual void collectNumericField(unsigned id, unsigned level, unsigned short format, double number, int formatStringId) = 0;
00156
00157
00158 virtual void startPage(unsigned pageId) = 0;
00159 virtual void endPage() = 0;
00160 virtual void endPages() = 0;
00161
00162 private:
00163 VSDCollector(const VSDCollector &);
00164 VSDCollector &operator=(const VSDCollector &);
00165 };
00166
00167 }
00168
00169 #endif
00170