00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __CDRSTYLESCOLLECTOR_H__
00011 #define __CDRSTYLESCOLLECTOR_H__
00012
00013 #include <map>
00014 #include <vector>
00015 #include <stack>
00016 #include <librevenge/librevenge.h>
00017 #include <lcms2.h>
00018 #include "CDRTypes.h"
00019 #include "CDRPath.h"
00020 #include "CDROutputElementList.h"
00021 #include "CDRCollector.h"
00022 #include "libcdr_utils.h"
00023
00024 namespace libcdr
00025 {
00026
00027 class CDRStylesCollector : public CDRCollector
00028 {
00029 public:
00030 CDRStylesCollector(CDRParserState &ps);
00031 virtual ~CDRStylesCollector();
00032
00033
00034 void collectPage(unsigned level);
00035 void collectObject(unsigned) {}
00036 void collectGroup(unsigned) {}
00037 void collectVect(unsigned) {}
00038 void collectOtherList() {}
00039 void collectPath(const CDRPath &) {}
00040 void collectLevel(unsigned) {}
00041 void collectTransform(const CDRTransforms &, bool) {}
00042 void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &) {}
00043 void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &,
00044 const std::vector<unsigned> &, const CDRPath &, const CDRPath &) {}
00045 void collectRotate(double,double,double) {}
00046 void collectFlags(unsigned, bool) {}
00047 void collectPageSize(double width, double height, double offsetX, double offsetY);
00048 void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
00049 void collectBitmap(unsigned, double, double, double, double) {}
00050 void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
00051 void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
00052 void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
00053 void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
00054 void collectFillTransform(const CDRTransforms &) {}
00055 void collectFillOpacity(double) {}
00056 void collectPolygon() {}
00057 void collectSpline() {}
00058 void collectColorProfile(const std::vector<unsigned char> &profile);
00059 void collectBBox(double, double, double, double) {}
00060 void collectSpnd(unsigned) {}
00061 void collectVectorPattern(unsigned, const librevenge::RVNGBinaryData &) {}
00062 void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
00063 void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
00064 const std::vector<unsigned char> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
00065 void collectArtisticText(double, double) {}
00066 void collectParagraphText(double, double, double, double) {}
00067 void collectStld(unsigned id, const CDRCharacterStyle &charStyle);
00068
00069 private:
00070 CDRStylesCollector(const CDRStylesCollector &);
00071 CDRStylesCollector &operator=(const CDRStylesCollector &);
00072
00073 void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId);
00074
00075 CDRParserState &m_ps;
00076 CDRPage m_page;
00077 std::map<unsigned, CDRCharacterStyle> m_charStyles;
00078 };
00079
00080 }
00081
00082 #endif
00083