31 #ifndef VSDCONTENTCOLLECTOR_H
32 #define VSDCONTENTCOLLECTOR_H
41 #include <libwpg/libwpg.h>
56 libwpg::WPGPaintInterface *painter,
57 std::vector<std::map<unsigned, XForm> > &groupXFormsSequence,
58 std::vector<std::map<unsigned, unsigned> > &groupMembershipsSequence,
59 std::vector<std::list<unsigned> > &documentPageShapeOrders,
67 void collectEllipticalArcTo(
unsigned id,
unsigned level,
double x3,
double y3,
double x2,
double y2,
double angle,
double ecc);
70 void collectOLEData(
unsigned id,
unsigned level,
const WPXBinaryData &oleData);
71 void collectEllipse(
unsigned id,
unsigned level,
double cx,
double cy,
double xleft,
double yleft,
double xtop,
double ytop);
72 void collectLine(
unsigned level,
const boost::optional<double> &strokeWidth,
const boost::optional<Colour> &c,
const boost::optional<unsigned char> &linePattern,
73 const boost::optional<unsigned char> &startMarker,
const boost::optional<unsigned char> &endMarker,
74 const boost::optional<unsigned char> &lineCap);
75 void collectFillAndShadow(
unsigned level,
const boost::optional<Colour> &colourFG,
const boost::optional<Colour> &colourBG,
76 const boost::optional<unsigned char> &fillPattern,
const boost::optional<double> &fillFGTransparency,
77 const boost::optional<double> &fillBGTransparency,
const boost::optional<unsigned char> &shadowPattern,
78 const boost::optional<Colour> &shfgc,
const boost::optional<double> &shadowOffsetX,
const boost::optional<double> &shadowOffsetY);
79 void collectFillAndShadow(
unsigned level,
const boost::optional<Colour> &colourFG,
const boost::optional<Colour> &colourBG,
80 const boost::optional<unsigned char> &fillPattern,
const boost::optional<double> &fillFGTransparency,
81 const boost::optional<double> &fillBGTransparency,
const boost::optional<unsigned char> &shadowPattern,
82 const boost::optional<Colour> &shfgc);
83 void collectGeometry(
unsigned id,
unsigned level,
bool noFill,
bool noLine,
bool noShow);
84 void collectMoveTo(
unsigned id,
unsigned level,
double x,
double y);
85 void collectLineTo(
unsigned id,
unsigned level,
double x,
double y);
86 void collectArcTo(
unsigned id,
unsigned level,
double x2,
double y2,
double bow);
87 void collectNURBSTo(
unsigned id,
unsigned level,
double x2,
double y2,
unsigned char xType,
unsigned char yType,
unsigned degree,
88 std::vector<std::pair<double, double> > controlPoints, std::vector<double> knotVector, std::vector<double> weights);
89 void collectNURBSTo(
unsigned id,
unsigned level,
double x2,
double y2,
double knot,
double knotPrev,
double weight,
double weightPrev,
unsigned dataID);
90 void collectNURBSTo(
unsigned id,
unsigned level,
double x2,
double y2,
double knot,
double knotPrev,
double weight,
double weightPrev,
const NURBSData &data);
91 void collectPolylineTo(
unsigned id,
unsigned level,
double x,
double y,
unsigned char xType,
unsigned char yType,
92 const std::vector<std::pair<double, double> > &points);
93 void collectPolylineTo(
unsigned id,
unsigned level,
double x,
double y,
unsigned dataID);
95 void collectShapeData(
unsigned id,
unsigned level,
unsigned char xType,
unsigned char yType,
unsigned degree,
double lastKnot,
96 std::vector<std::pair<double, double> > controlPoints, std::vector<double> knotVector, std::vector<double> weights);
97 void collectShapeData(
unsigned id,
unsigned level,
unsigned char xType,
unsigned char yType, std::vector<std::pair<double, double> > points);
100 void collectShapesOrder(
unsigned id,
unsigned level,
const std::vector<unsigned> &shapeIds);
101 void collectForeignDataType(
unsigned level,
unsigned foreignType,
unsigned foreignFormat,
double offsetX,
double offsetY,
double width,
double height);
102 void collectPageProps(
unsigned id,
unsigned level,
double pageWidth,
double pageHeight,
double shadowOffsetX,
double shadowOffsetY,
double scale);
103 void collectPage(
unsigned id,
unsigned level,
unsigned backgroundPageID,
bool isBackgroundPage);
104 void collectShape(
unsigned id,
unsigned level,
unsigned parent,
unsigned masterPage,
unsigned masterShape,
unsigned lineStyle,
unsigned fillStyle,
unsigned textStyle);
105 void collectSplineStart(
unsigned id,
unsigned level,
double x,
double y,
double secondKnot,
double firstKnot,
double lastKnot,
unsigned degree);
106 void collectSplineKnot(
unsigned id,
unsigned level,
double x,
double y,
double knot);
108 void collectInfiniteLine(
unsigned id,
unsigned level,
double x1,
double y1,
double x2,
double y2);
109 void collectRelCubBezTo(
unsigned id,
unsigned level,
double x,
double y,
double a,
double b,
double c,
double d);
113 void collectRelQuadBezTo(
unsigned id,
unsigned level,
double x,
double y,
double a,
double b);
118 void collectCharIX(
unsigned id,
unsigned level,
unsigned charCount,
const boost::optional<VSDName> &font,
119 const boost::optional<Colour> &fontColour,
const boost::optional<double> &fontSize,
const boost::optional<bool> &bold,
120 const boost::optional<bool> &italic,
const boost::optional<bool> &underline,
const boost::optional<bool> &doubleunderline,
121 const boost::optional<bool> &strikeout,
const boost::optional<bool> &doublestrikeout,
const boost::optional<bool> &allcaps,
122 const boost::optional<bool> &initcaps,
const boost::optional<bool> &smallcaps,
const boost::optional<bool> &superscript,
123 const boost::optional<bool> &subscript);
124 void collectDefaultCharStyle(
unsigned charCount,
const boost::optional<VSDName> &font,
const boost::optional<Colour> &fontColour,
125 const boost::optional<double> &fontSize,
const boost::optional<bool> &bold,
const boost::optional<bool> &italic,
126 const boost::optional<bool> &underline,
const boost::optional<bool> &doubleunderline,
const boost::optional<bool> &strikeout,
127 const boost::optional<bool> &doublestrikeout,
const boost::optional<bool> &allcaps,
const boost::optional<bool> &initcaps,
128 const boost::optional<bool> &smallcaps,
const boost::optional<bool> &superscript,
const boost::optional<bool> &subscript);
129 void collectParaIX(
unsigned id,
unsigned level,
unsigned charCount,
const boost::optional<double> &indFirst,
130 const boost::optional<double> &indLeft,
const boost::optional<double> &indRight,
const boost::optional<double> &spLine,
131 const boost::optional<double> &spBefore,
const boost::optional<double> &spAfter,
const boost::optional<unsigned char> &align,
132 const boost::optional<unsigned> &flags);
133 void collectDefaultParaStyle(
unsigned charCount,
const boost::optional<double> &indFirst,
const boost::optional<double> &indLeft,
134 const boost::optional<double> &indRight,
const boost::optional<double> &spLine,
const boost::optional<double> &spBefore,
135 const boost::optional<double> &spAfter,
const boost::optional<unsigned char> &align,
const boost::optional<unsigned> &flags);
136 void collectTextBlock(
unsigned level,
const boost::optional<double> &leftMargin,
const boost::optional<double> &rightMargin,
137 const boost::optional<double> &topMargin,
const boost::optional<double> &bottomMargin,
138 const boost::optional<unsigned char> &verticalAlign,
const boost::optional<bool> &isBgFilled,
139 const boost::optional<Colour> &bgColour,
const boost::optional<double> &defaultTabStop,
140 const boost::optional<unsigned char> &textDirection);
147 void collectStyleSheet(
unsigned id,
unsigned level,
unsigned parentLineStyle,
unsigned parentFillStyle,
unsigned parentTextStyle);
148 void collectLineStyle(
unsigned level,
const boost::optional<double> &strokeWidth,
const boost::optional<Colour> &c,
const boost::optional<unsigned char> &linePattern,
149 const boost::optional<unsigned char> &startMarker,
const boost::optional<unsigned char> &endMarker,
150 const boost::optional<unsigned char> &lineCap);
151 void collectFillStyle(
unsigned level,
const boost::optional<Colour> &colourFG,
const boost::optional<Colour> &colourBG,
152 const boost::optional<unsigned char> &fillPattern,
const boost::optional<double> &fillFGTransparency,
153 const boost::optional<double> &fillBGTransparency,
const boost::optional<unsigned char> &shadowPattern,
154 const boost::optional<Colour> &shfgc,
const boost::optional<double> &shadowOffsetX,
const boost::optional<double> &shadowOffsetY);
155 void collectFillStyle(
unsigned level,
const boost::optional<Colour> &colourFG,
const boost::optional<Colour> &colourBG,
156 const boost::optional<unsigned char> &fillPattern,
const boost::optional<double> &fillFGTransparency,
157 const boost::optional<double> &fillBGTransparency,
const boost::optional<unsigned char> &shadowPattern,
158 const boost::optional<Colour> &shfgc);
159 void collectCharIXStyle(
unsigned id,
unsigned level,
unsigned charCount,
const boost::optional<VSDName> &font,
160 const boost::optional<Colour> &fontColour,
const boost::optional<double> &fontSize,
const boost::optional<bool> &bold,
161 const boost::optional<bool> &italic,
const boost::optional<bool> &underline,
const boost::optional<bool> &doubleunderline,
162 const boost::optional<bool> &strikeout,
const boost::optional<bool> &doublestrikeout,
const boost::optional<bool> &allcaps,
163 const boost::optional<bool> &initcaps,
const boost::optional<bool> &smallcaps,
const boost::optional<bool> &superscript,
164 const boost::optional<bool> &subscript);
165 void collectParaIXStyle(
unsigned id,
unsigned level,
unsigned charCount,
const boost::optional<double> &indFirst,
166 const boost::optional<double> &indLeft,
const boost::optional<double> &indRight,
const boost::optional<double> &spLine,
167 const boost::optional<double> &spBefore,
const boost::optional<double> &spAfter,
const boost::optional<unsigned char> &align,
168 const boost::optional<unsigned> &flags);
169 void collectTextBlockStyle(
unsigned level,
const boost::optional<double> &leftMargin,
const boost::optional<double> &rightMargin,
170 const boost::optional<double> &topMargin,
const boost::optional<double> &bottomMargin,
171 const boost::optional<unsigned char> &verticalAlign,
const boost::optional<bool> &isBgFilled,
172 const boost::optional<Colour> &bgColour,
const boost::optional<double> &defaultTabStop,
173 const boost::optional<unsigned char> &textDirection);
177 void collectTextField(
unsigned id,
unsigned level,
int nameId,
int formatStringId);
178 void collectNumericField(
unsigned id,
unsigned level,
unsigned short format,
double number,
int formatStringId);
196 double _NURBSBasis(
unsigned knot,
unsigned degree,
double point,
const std::vector<double> &knotVector);
216 void appendCharacters(WPXString &text,
const std::vector<unsigned char> &characters);
218 bool parseFormatId(
const char *formatString,
unsigned short &result );