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