PMDCollector.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

PMDCollector.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 libpagemaker 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 __PMDCOLLECTOR_H__
11 #define __PMDCOLLECTOR_H__
12
13 #include <stdint.h>
14
15 #include <vector>
16 #include <string>
17
18 #include <boost/optional.hpp>
19 #include <boost/shared_ptr.hpp>
20
21
22 #include "geometry.h"
23 #include "PMDPage.h"
24 #include "PMDExceptions.h"
25 #include "Units.h"
26 #include "OutputShape.h"
27 #include "PMDTypes.h"
28
29 namespace libpagemaker
30 {
31
32
40 class PMDCollector
41 {
42 typedef std::vector<boost::shared_ptr<const OutputShape> > PageShapes_t;
43 typedef std::vector<PageShapes_t> PageShapesList_t;
44
45 /*
46 * Height and width in PMD page units.
47 * One PMD page unit is 1/20 of a point (1/720 inch)
48 */
49 boost::optional<PMDPageUnit> m_pageWidth;
50 boost::optional<PMDPageUnit> m_pageHeight;
51
52 std::vector<PMDPage> m_pages;
53 std::vector<PMDColor> m_color;
54 std::vector<PMDFont> m_font;
55 bool m_doubleSided;
56
57 void writePage(const PMDPage &,
58 librevenge::RVNGDrawingInterface *,
59 const std::vector<boost::shared_ptr<const OutputShape> > &) const;
60
61 void paintShape(const OutputShape &shape,
62 librevenge::RVNGDrawingInterface *) const;
63
64 void fillOutputShapesByPage_OneSided(PageShapesList_t &pageShapes) const;
65 void fillOutputShapesByPage_TwoSided(PageShapesList_t &pageShapes) const;
66 void fillOutputShapesByPage(PageShapesList_t &pageShapes) const;
67 public:
68 PMDCollector();
69
70 /* State-mutating functions */
71 void setPageWidth(PMDPageUnit);
72 void setPageHeight(PMDPageUnit);
73 void setDoubleSided(bool);
74 void addShapeToPage(unsigned pageID, const boost::shared_ptr<PMDLineSet> &shape);
75 void addColor(const PMDColor &color);
76 void addFont(const PMDFont &font);
77
78 unsigned addPage();
79
80 /* Output functions */
81 void draw(librevenge::RVNGDrawingInterface *) const;
82 };
83
84 }
85
86 #endif /* __PMDCOLLECTOR_H__ */
87 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libpagemaker::PMDCollector::fillOutputShapesByPage
void fillOutputShapesByPage(PageShapesList_t &pageShapes) const
Definition: PMDCollector.cpp:759
PMDExceptions.h
libpagemaker::PMDCollector::setDoubleSided
void setDoubleSided(bool)
Definition: PMDCollector.cpp:100
libpagemaker::PMDCollector::m_color
std::vector< PMDColor > m_color
Definition: PMDCollector.h:53
PMDPage.h
libpagemaker::PMDCollector::draw
void draw(librevenge::RVNGDrawingInterface *) const
Definition: PMDCollector.cpp:768
libpagemaker::PMDCollector::PMDCollector
PMDCollector()
Definition: PMDCollector.cpp:95
libpagemaker::PMDCollector::m_doubleSided
bool m_doubleSided
Definition: PMDCollector.h:55
libpagemaker::PMDCollector::setPageWidth
void setPageWidth(PMDPageUnit)
Definition: PMDCollector.cpp:106
libpagemaker::PMDColor
Definition: PMDTypes.h:17
libpagemaker::PMDCollector::paintShape
void paintShape(const OutputShape &shape, librevenge::RVNGDrawingInterface *) const
Definition: PMDCollector.cpp:137
libpagemaker::PMDCollector::writePage
void writePage(const PMDPage &, librevenge::RVNGDrawingInterface *, const std::vector< boost::shared_ptr< const OutputShape > > &) const
Definition: PMDCollector.cpp:680
libpagemaker::PMDPage
Definition: PMDPage.h:22
libpagemaker::PMDCollector::addFont
void addFont(const PMDFont &font)
Definition: PMDCollector.cpp:127
libpagemaker::PMDCollector::m_pages
std::vector< PMDPage > m_pages
Definition: PMDCollector.h:52
OutputShape.h
libpagemaker::PMDCollector::fillOutputShapesByPage_TwoSided
void fillOutputShapesByPage_TwoSided(PageShapesList_t &pageShapes) const
Definition: PMDCollector.cpp:703
libpagemaker::PMDCollector::m_pageWidth
boost::optional< PMDPageUnit > m_pageWidth
Definition: PMDCollector.h:49
libpagemaker::PMDCollector::addColor
void addColor(const PMDColor &color)
Definition: PMDCollector.cpp:122
Units.h
libpagemaker::LengthUnit
Definition: Units.h:20
libpagemaker::PMDCollector::fillOutputShapesByPage_OneSided
void fillOutputShapesByPage_OneSided(PageShapesList_t &pageShapes) const
Definition: PMDCollector.cpp:740
libpagemaker::PMDCollector::m_pageHeight
boost::optional< PMDPageUnit > m_pageHeight
Definition: PMDCollector.h:50
libpagemaker::OutputShape
Definition: OutputShape.h:21
libpagemaker::PMDCollector::PageShapesList_t
std::vector< PageShapes_t > PageShapesList_t
Definition: PMDCollector.h:43
libpagemaker
Definition: geometry.h:20
libpagemaker::PMDFont
Definition: PMDTypes.h:29
geometry.h
PMDTypes.h
libpagemaker::PMDCollector
Builder class for PMD Documents.
Definition: PMDCollector.h:40
libpagemaker::PMDCollector::PageShapes_t
std::vector< boost::shared_ptr< const OutputShape > > PageShapes_t
Definition: PMDCollector.h:42
libpagemaker::PMDCollector::m_font
std::vector< PMDFont > m_font
Definition: PMDCollector.h:54
libpagemaker::PMDCollector::addPage
unsigned addPage()
Definition: PMDCollector.cpp:116
libpagemaker::PMDCollector::addShapeToPage
void addShapeToPage(unsigned pageID, const boost::shared_ptr< PMDLineSet > &shape)
Definition: PMDCollector.cpp:132
libpagemaker::PMDCollector::setPageHeight
void setPageHeight(PMDPageUnit)
Definition: PMDCollector.cpp:111