- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CDRStylesCollector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libcdr project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef __CDRSTYLESCOLLECTOR_H__
11 #define __CDRSTYLESCOLLECTOR_H__
12
13 #include <map>
14 #include <vector>
15 #include <stack>
16 #include <librevenge/librevenge.h>
17 #include <lcms2.h>
18 #include "CDRTypes.h"
19 #include "CDRPath.h"
20 #include "CDROutputElementList.h"
21 #include "CDRCollector.h"
22 #include "libcdr_utils.h"
23
24 namespace libcdr
25 {
26
27 class CDRStylesCollector : public CDRCollector
28 {
29 public:
30 CDRStylesCollector(CDRParserState &ps);
31 virtual ~CDRStylesCollector();
32
33 // collector functions
34 void collectPage(unsigned level);
35 void collectObject(unsigned) {}
36 void collectGroup(unsigned) {}
37 void collectVect(unsigned) {}
38 void collectOtherList() {}
39 void collectPath(const CDRPath &) {}
40 void collectLevel(unsigned) {}
41 void collectTransform(const CDRTransforms &, bool) {}
42 void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &) {}
43 void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &,
44 const std::vector<unsigned> &, const CDRPath &, const CDRPath &) {}
45 void collectRotate(double,double,double) {}
46 void collectFlags(unsigned, bool) {}
47 void collectPageSize(double width, double height, double offsetX, double offsetY);
48 void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
49 void collectBitmap(unsigned, double, double, double, double) {}
50 void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
51 void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
52 void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
53 void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
54 void collectFillTransform(const CDRTransforms &) {}
55 void collectFillOpacity(double) {}
56 void collectPolygon() {}
57 void collectSpline() {}
58 void collectColorProfile(const std::vector<unsigned char> &profile);
59 void collectBBox(double, double, double, double) {}
60 void collectSpnd(unsigned) {}
61 void collectVectorPattern(unsigned, const librevenge::RVNGBinaryData &) {}
62 void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
63 void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
64 const std::vector<unsigned char> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
65 void collectArtisticText(double, double) {}
66 void collectParagraphText(double, double, double, double) {}
67 void collectStld(unsigned id, const CDRCharacterStyle &charStyle);
68
69 private:
70 CDRStylesCollector(const CDRStylesCollector &);
71 CDRStylesCollector &operator=(const CDRStylesCollector &);
72
73 void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId);
74
75 CDRParserState &m_ps;
76 CDRPage m_page;
77 std::map<unsigned, CDRCharacterStyle> m_charStyles;
78 };
79
80 } // namespace libcdr
81
82 #endif /* __CDRCOLLECTOR_H__ */
83 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRStylesCollector::collectText
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:211
libcdr::CDRStylesCollector::~CDRStylesCollector
virtual ~CDRStylesCollector()
Definition: CDRStylesCollector.cpp:30
libcdr::CDRStylesCollector::collectBmp
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:34
libcdr::CDRStylesCollector::collectGroup
void collectGroup(unsigned)
Definition: CDRStylesCollector.h:36
libcdr::CDRPath
Definition: CDRPath.h:34
libcdr::CDRStylesCollector::collectPath
void collectPath(const CDRPath &)
Definition: CDRStylesCollector.h:39
libcdr::CDRStylesCollector::collectFillStyle
void collectFillStyle(unsigned short, const CDRColor &, const CDRColor &, const CDRGradient &, const CDRImageFill &)
Definition: CDRStylesCollector.h:42
libcdr::CDRStylesCollector::collectArtisticText
void collectArtisticText(double, double)
Definition: CDRStylesCollector.h:65
libcdr::CDRPage
Definition: CDRTypes.h:225
libcdr::CDRImageFill
Definition: CDRTypes.h:84
libcdr::CDRStylesCollector::collectPaletteEntry
void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color)
Definition: CDRStylesCollector.cpp:206
libcdr::CDRStylesCollector::m_charStyles
std::map< unsigned, CDRCharacterStyle > m_charStyles
Definition: CDRStylesCollector.h:77
libcdr::CDRStylesCollector::m_page
CDRPage m_page
Definition: CDRStylesCollector.h:76
libcdr::CDRStylesCollector::collectBmpf
void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector< unsigned char > &pattern)
Definition: CDRStylesCollector.cpp:195
libcdr::CDRStylesCollector::collectTransform
void collectTransform(const CDRTransforms &, bool)
Definition: CDRStylesCollector.h:41
libcdr::CDRCharacterStyle
Definition: CDRTypes.h:136
libcdr::CDRStylesCollector::getRecursedStyle
void getRecursedStyle(CDRCharacterStyle &charStyle, unsigned styleId)
Definition: CDRStylesCollector.cpp:270
libcdr::CDRStylesCollector::collectPolygon
void collectPolygon()
Definition: CDRStylesCollector.h:56
libcdr::CDRStylesCollector::collectStld
void collectStld(unsigned id, const CDRCharacterStyle &charStyle)
Definition: CDRStylesCollector.cpp:265
libcdr::CDRStylesCollector::collectBBox
void collectBBox(double, double, double, double)
Definition: CDRStylesCollector.h:59
libcdr::CDRStylesCollector::collectOtherList
void collectOtherList()
Definition: CDRStylesCollector.h:38
libcdr::CDRStylesCollector::collectObject
void collectObject(unsigned)
Definition: CDRStylesCollector.h:35
libcdr::CDRStylesCollector::collectPageSize
void collectPageSize(double width, double height, double offsetX, double offsetY)
Definition: CDRStylesCollector.cpp:182
libcdr_utils.h
libcdr::CDRStylesCollector::collectRotate
void collectRotate(double, double, double)
Definition: CDRStylesCollector.h:45
libcdr
Definition: CDRCollector.h:29
libcdr::CDRStylesCollector::collectPpdt
void collectPpdt(const std::vector< std::pair< double, double > > &, const std::vector< unsigned > &)
Definition: CDRStylesCollector.h:53
libcdr::CDRStylesCollector::collectVectorPattern
void collectVectorPattern(unsigned, const librevenge::RVNGBinaryData &)
Definition: CDRStylesCollector.h:61
CDROutputElementList.h
libcdr::CDRStylesCollector
Definition: CDRStylesCollector.h:27
libcdr::CDRStylesCollector::CDRStylesCollector
CDRStylesCollector(CDRParserState &ps)
Definition: CDRStylesCollector.cpp:25
libcdr::CDRStylesCollector::collectPage
void collectPage(unsigned level)
Definition: CDRStylesCollector.cpp:190
libcdr::CDRStylesCollector::collectLevel
void collectLevel(unsigned)
Definition: CDRStylesCollector.h:40
libcdr::CDRStylesCollector::operator=
CDRStylesCollector & operator=(const CDRStylesCollector &)
libcdr::CDRStylesCollector::collectVect
void collectVect(unsigned)
Definition: CDRStylesCollector.h:37
libcdr::CDRStylesCollector::collectPolygonTransform
void collectPolygonTransform(unsigned, unsigned, double, double, double, double)
Definition: CDRStylesCollector.h:48
libcdr::CDRStylesCollector::collectBitmap
void collectBitmap(unsigned, double, double, double, double)
Definition: CDRStylesCollector.h:49
libcdr::CDRStylesCollector::collectSpline
void collectSpline()
Definition: CDRStylesCollector.h:57
libcdr::CDRStylesCollector::m_ps
CDRParserState & m_ps
Definition: CDRStylesCollector.h:75
libcdr::CDRStylesCollector::collectFillTransform
void collectFillTransform(const CDRTransforms &)
Definition: CDRStylesCollector.h:54
CDRCollector.h
CDRTypes.h
libcdr::CDRStylesCollector::collectLineStyle
void collectLineStyle(unsigned short, unsigned short, unsigned short, double, double, double, const CDRColor &, const std::vector< unsigned > &, const CDRPath &, const CDRPath &)
Definition: CDRStylesCollector.h:43
libcdr::CDRParserState
Definition: CDRCollector.h:32
libcdr::CDRColor
Definition: CDRTypes.h:52
libcdr::CDRStylesCollector::collectFlags
void collectFlags(unsigned, bool)
Definition: CDRStylesCollector.h:46
libcdr::CDRStylesCollector::collectColorProfile
void collectColorProfile(const std::vector< unsigned char > &profile)
Definition: CDRStylesCollector.cpp:200
libcdr::CDRGradient
Definition: CDRTypes.h:70
libcdr::CDRStylesCollector::collectSpnd
void collectSpnd(unsigned)
Definition: CDRStylesCollector.h:60
CDRPath.h
libcdr::CDRStylesCollector::collectParagraphText
void collectParagraphText(double, double, double, double)
Definition: CDRStylesCollector.h:66
libcdr::CDRTransforms
Definition: CDRTransforms.h:39
libcdr::CDRCollector
Definition: CDRCollector.h:59
libcdr::CDRStylesCollector::collectFillOpacity
void collectFillOpacity(double)
Definition: CDRStylesCollector.h:55