CDRStylesCollector.h
Go to the documentation of this file.
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 
48 {
49 public:
51  virtual ~CDRStylesCollector();
52 
53  // collector functions
54  void collectPage(unsigned level);
55  void collectObject(unsigned) {}
56  void collectGroup(unsigned) {}
57  void collectVect(unsigned) {}
58  void collectOtherList() {}
59  void collectPath(const CDRPath &) {}
60  void collectLevel(unsigned) {}
61  void collectTransform(const CDRTransforms &, bool) {}
62  void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &) {}
63  void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &,
64  const std::vector<unsigned> &, const CDRPath &, const CDRPath &) {}
65  void collectRotate(double,double,double) {}
66  void collectFlags(unsigned, bool) {}
67  void collectPageSize(double width, double height, double offsetX, double offsetY);
68  void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
69  void collectBitmap(unsigned, double, double, double, double) {}
70  void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
71  void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
72  void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
73  void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
75  void collectFillOpacity(double) {}
76  void collectPolygon() {}
77  void collectSpline() {}
78  void collectColorProfile(const std::vector<unsigned char> &profile);
79  void collectBBox(double, double, double, double) {}
80  void collectSpnd(unsigned) {}
81  void collectVectorPattern(unsigned, const WPXBinaryData &) {}
82  void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
83  void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
84  const std::vector<unsigned char> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
85  void collectArtisticText(double, double) {}
86  void collectParagraphText(double, double, double, double) {}
87  void collectStld(unsigned id, const CDRCharacterStyle &charStyle);
88 
89 private:
92 
93  void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId);
94 
97  std::map<unsigned, CDRCharacterStyle> m_charStyles;
98 };
99 
100 } // namespace libcdr
101 
102 #endif /* __CDRCOLLECTOR_H__ */
103 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
void collectText(unsigned textId, unsigned styleId, const std::vector< unsigned char > &data, const std::vector< unsigned char > &charDescriptions, const std::map< unsigned, CDRCharacterStyle > &styleOverrides)
Definition: CDRStylesCollector.cpp:231
virtual ~CDRStylesCollector()
Definition: CDRStylesCollector.cpp:50
void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector< unsigned > &palette, const std::vector< unsigned char > &bitmap)
Definition: CDRStylesCollector.cpp:54
void collectGroup(unsigned)
Definition: CDRStylesCollector.h:56
Definition: CDRPath.h:54
void collectPath(const CDRPath &)
Definition: CDRStylesCollector.h:59
void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &)
Definition: CDRStylesCollector.h:62
void collectArtisticText(double, double)
Definition: CDRStylesCollector.h:85
Definition: CDRTypes.h:244
Definition: CDRTypes.h:103
void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color)
Definition: CDRStylesCollector.cpp:226
std::map< unsigned, CDRCharacterStyle > m_charStyles
Definition: CDRStylesCollector.h:97
CDRPage m_page
Definition: CDRStylesCollector.h:96
void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector< unsigned char > &pattern)
Definition: CDRStylesCollector.cpp:215
void collectTransform(const CDRTransforms &, bool)
Definition: CDRStylesCollector.h:61
Definition: CDRTypes.h:155
void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId)
Definition: CDRStylesCollector.cpp:290
void collectPolygon()
Definition: CDRStylesCollector.h:76
void collectStld(unsigned id, const CDRCharacterStyle &charStyle)
Definition: CDRStylesCollector.cpp:285
void collectBBox(double, double, double, double)
Definition: CDRStylesCollector.h:79
void collectOtherList()
Definition: CDRStylesCollector.h:58
void collectObject(unsigned)
Definition: CDRStylesCollector.h:55
void collectPageSize(double width, double height, double offsetX, double offsetY)
Definition: CDRStylesCollector.cpp:202
void collectRotate(double, double, double)
Definition: CDRStylesCollector.h:65
void collectPpdt(const std::vector< std::pair< double, double > > &, const std::vector< unsigned > &)
Definition: CDRStylesCollector.h:73
Definition: CDRStylesCollector.h:47
CDRStylesCollector(CDRParserState &ps)
Definition: CDRStylesCollector.cpp:45
void collectPage(unsigned level)
Definition: CDRStylesCollector.cpp:210
void collectLevel(unsigned)
Definition: CDRStylesCollector.h:60
CDRStylesCollector & operator=(const CDRStylesCollector &)
void collectVect(unsigned)
Definition: CDRStylesCollector.h:57
void collectPolygonTransform(unsigned, unsigned, double, double, double, double)
Definition: CDRStylesCollector.h:68
void collectBitmap(unsigned, double, double, double, double)
Definition: CDRStylesCollector.h:69
void collectSpline()
Definition: CDRStylesCollector.h:77
CDRParserState & m_ps
Definition: CDRStylesCollector.h:95
void collectFillTransform(const CDRTransforms &)
Definition: CDRStylesCollector.h:74
void collectVectorPattern(unsigned, const WPXBinaryData &)
Definition: CDRStylesCollector.h:81
void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &, const std::vector< unsigned > &, const CDRPath &, const CDRPath &)
Definition: CDRStylesCollector.h:63
Definition: CDRCollector.h:52
Definition: CDRTypes.h:71
void collectFlags(unsigned, bool)
Definition: CDRStylesCollector.h:66
void collectColorProfile(const std::vector< unsigned char > &profile)
Definition: CDRStylesCollector.cpp:220
Definition: CDRTypes.h:89
void collectSpnd(unsigned)
Definition: CDRStylesCollector.h:80
void collectParagraphText(double, double, double, double)
Definition: CDRStylesCollector.h:86
Definition: CDRTransforms.h:66
Definition: CDRCollector.h:79
void collectFillOpacity(double)
Definition: CDRStylesCollector.h:75

Generated for libcdr by doxygen 1.8.6