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 #ifndef __CDRSTYLESCOLLECTOR_H__
00031 #define __CDRSTYLESCOLLECTOR_H__
00032
00033 #include <map>
00034 #include <vector>
00035 #include <stack>
00036 #include <libwpg/libwpg.h>
00037 #include <lcms2.h>
00038 #include "CDRTypes.h"
00039 #include "CDRPath.h"
00040 #include "CDROutputElementList.h"
00041 #include "CDRCollector.h"
00042 #include "libcdr_utils.h"
00043
00044 namespace libcdr
00045 {
00046
00047 class CDRStylesCollector : public CDRCollector
00048 {
00049 public:
00050 CDRStylesCollector(CDRParserState &ps);
00051 virtual ~CDRStylesCollector();
00052
00053
00054 void collectPage(unsigned level);
00055 void collectObject(unsigned) {}
00056 void collectGroup(unsigned) {}
00057 void collectVect(unsigned) {}
00058 void collectOtherList() {}
00059 void collectCubicBezier(double, double, double, double, double, double) {}
00060 void collectQuadraticBezier(double, double, double, double) {}
00061 void collectMoveTo(double, double) {}
00062 void collectLineTo(double, double) {}
00063 void collectArcTo(double, double, bool, bool, double, double) {}
00064 void collectClosePath() {}
00065 void collectLevel(unsigned) {}
00066 void collectTransform(const CDRTransforms &, bool) {}
00067 void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &) {}
00068 void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &,
00069 const std::vector<unsigned> &, unsigned, unsigned) {}
00070 void collectRotate(double,double,double) {}
00071 void collectFlags(unsigned, bool) {}
00072 void collectPageSize(double width, double height, double offsetX, double offsetY);
00073 void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
00074 void collectBitmap(unsigned, double, double, double, double) {}
00075 void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
00076 void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
00077 void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
00078 void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
00079 void collectFillTransform(const CDRTransforms &) {}
00080 void collectFillOpacity(double) {}
00081 void collectPolygon() {}
00082 void collectSpline() {}
00083 void collectColorProfile(const std::vector<unsigned char> &profile);
00084 void collectBBox(double, double, double, double) {}
00085 void collectSpnd(unsigned) {}
00086 void collectVectorPattern(unsigned, const WPXBinaryData &) {}
00087 void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
00088 void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
00089 const std::vector<unsigned char> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
00090 void collectArtisticText(double, double) {}
00091 void collectParagraphText(double, double, double, double) {}
00092 void collectStld(unsigned id, const CDRCharacterStyle &charStyle);
00093
00094 private:
00095 CDRStylesCollector(const CDRStylesCollector &);
00096 CDRStylesCollector &operator=(const CDRStylesCollector &);
00097
00098 void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId);
00099
00100 CDRParserState &m_ps;
00101 CDRPage m_page;
00102 std::map<unsigned, CDRCharacterStyle> m_charStyles;
00103 };
00104
00105 }
00106
00107 #endif
00108