Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* libcdr
3 : * Version: MPL 1.1 / GPLv2+ / LGPLv2+
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License or as specified alternatively below. You may obtain a copy of
8 : * the License at http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * Major Contributor(s):
16 : * Copyright (C) 2012 Fridrich Strba <fridrich.strba@bluewin.ch>
17 : *
18 : *
19 : * All Rights Reserved.
20 : *
21 : * For minor contributions see the git repository.
22 : *
23 : * Alternatively, the contents of this file may be used under the terms of
24 : * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
25 : * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
26 : * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
27 : * instead of those above.
28 : */
29 :
30 : #ifndef __CDRSTYLESCOLLECTOR_H__
31 : #define __CDRSTYLESCOLLECTOR_H__
32 :
33 : #include <map>
34 : #include <vector>
35 : #include <stack>
36 : #include <libwpg/libwpg.h>
37 : #include <lcms2.h>
38 : #include "CDRTypes.h"
39 : #include "CDRPath.h"
40 : #include "CDROutputElementList.h"
41 : #include "CDRCollector.h"
42 : #include "libcdr_utils.h"
43 :
44 : namespace libcdr
45 : {
46 :
47 : class CDRStylesCollector : public CDRCollector
48 : {
49 : public:
50 : CDRStylesCollector(CDRParserState &ps);
51 : virtual ~CDRStylesCollector();
52 :
53 : // collector functions
54 : void collectPage(unsigned level);
55 0 : void collectObject(unsigned) {}
56 0 : void collectGroup(unsigned) {}
57 0 : void collectVect(unsigned) {}
58 0 : void collectOtherList() {}
59 0 : void collectCubicBezier(double, double, double, double, double, double) {}
60 0 : void collectQuadraticBezier(double, double, double, double) {}
61 0 : void collectMoveTo(double, double) {}
62 0 : void collectLineTo(double, double) {}
63 0 : void collectArcTo(double, double, bool, bool, double, double) {}
64 0 : void collectClosePath() {}
65 0 : void collectLevel(unsigned) {}
66 0 : void collectTransform(const CDRTransforms &, bool) {}
67 0 : void collectFildId(unsigned) {}
68 0 : void collectOutlId(unsigned) {}
69 : void collectFild(unsigned id, unsigned short fillType, const CDRColor &color1, const CDRColor &color2, const CDRGradient &gradient, const CDRImageFill &imageFill);
70 : void collectOutl(unsigned id, unsigned short lineType, unsigned short capsType, unsigned short joinType, double lineWidth,
71 : double stretch, double angle, const CDRColor &color, const std::vector<unsigned> &dashArray,
72 : unsigned startMarkerId, unsigned endMarkerId);
73 0 : void collectRotate(double,double,double) {}
74 0 : void collectFlags(unsigned, bool) {}
75 : void collectPageSize(double width, double height, double offsetX, double offsetY);
76 0 : void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
77 0 : void collectBitmap(unsigned, double, double, double, double) {}
78 : void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
79 : void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
80 : void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
81 0 : void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
82 0 : void collectFillTransform(const CDRTransforms &) {}
83 0 : void collectFillOpacity(double) {}
84 0 : void collectPolygon() {}
85 0 : void collectSpline() {}
86 : void collectColorProfile(const std::vector<unsigned char> &profile);
87 0 : void collectBBox(double, double, double, double) {}
88 0 : void collectSpnd(unsigned) {}
89 0 : void collectVectorPattern(unsigned, const WPXBinaryData &) {}
90 : void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
91 : void collectFont(unsigned fontId, unsigned short fontEncoding, const WPXString &font);
92 : void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
93 : const std::vector<uint64_t> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
94 0 : void collectArtisticText() {}
95 0 : void collectParagraphText() {}
96 : void collectStlt(const std::map<unsigned, CDRCharacterStyle> &charStyles);
97 :
98 : private:
99 : CDRStylesCollector(const CDRStylesCollector &);
100 : CDRStylesCollector &operator=(const CDRStylesCollector &);
101 :
102 : CDRParserState &m_ps;
103 : CDRPage m_page;
104 : std::map<unsigned, CDRCharacterStyle> m_charStyles;
105 : };
106 :
107 : } // namespace libcdr
108 :
109 : #endif /* __CDRCOLLECTOR_H__ */
110 : /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
|