Go to the documentation of this file.
10 #ifndef QXPCONTENTCOLLECTOR_H_INCLUDED
11 #define QXPCONTENTCOLLECTOR_H_INCLUDED
15 #include <unordered_map>
19 #include <type_traits>
44 void collectLine(
const std::shared_ptr<Line> &line)
override;
45 void collectBox(
const std::shared_ptr<Box> &box)
override;
47 void collectTextPath(
const std::shared_ptr<TextPath> &textPath)
override;
48 void collectGroup(
const std::shared_ptr<Group> &group)
override;
50 void collectText(
const std::shared_ptr<Text> &text,
const unsigned linkId)
override;
58 template<
typename T,
typename TThis>
68 virtual unsigned zIndex()
const = 0;
69 virtual void setZIndex(
unsigned value) = 0;
75 static_assert(std::is_base_of<Object, T>::value,
"T is not Object");
77 const std::shared_ptr<T>
object;
94 return object->zIndex;
99 object->zIndex = value;
110 std::vector<std::shared_ptr<CollectedObject<Group>>>
groups;
112 std::map<unsigned, std::shared_ptr<CollectedObjectInterface>>
objects;
118 double getX(
const double x)
const;
119 double getX(
const std::shared_ptr<Object> &obj)
const;
120 double getY(
const double y)
const;
121 double getY(
const std::shared_ptr<Object> &obj)
const;
143 auto collectedObj = std::make_shared<CollectedObject<T>>(obj, std::bind(handler,
this, std::placeholders::_1, std::placeholders::_2));
149 void draw(
bool force =
false);
151 void collectTextObject(
const std::shared_ptr<TextObject> &textObj, CollectedPage &page);
155 void drawLine(
const std::shared_ptr<Line> &line,
const CollectedPage &page);
156 void drawBox(
const std::shared_ptr<Box> &box,
const CollectedPage &page);
157 void drawRectangle(
const std::shared_ptr<Box> &box,
const CollectedPage &page);
158 void drawOval(
const std::shared_ptr<Box> &oval,
const CollectedPage &page);
159 void drawPolygon(
const std::shared_ptr<Box> &polygon,
const CollectedPage &page);
160 void drawBezierBox(
const std::shared_ptr<Box> &box,
const CollectedPage &page);
161 void drawTextBox(
const std::shared_ptr<TextBox> &textbox,
const CollectedPage &page);
162 void drawTextPath(
const std::shared_ptr<TextPath> &textPath,
const CollectedPage &page);
164 void drawGroup(
const std::shared_ptr<Group> &group,
const CollectedPage &page);
166 void writeFill(librevenge::RVNGPropertyList &propList,
const boost::optional<Fill> &fill);
167 void writeFrame(librevenge::RVNGPropertyList &propList,
const Frame &frame,
const bool runaround,
const bool allowHairline =
false);
172 #endif // QXPCONTENTCOLLECTOR_H_INCLUDED
bool isStripe
Definition: QXPTypes.h:129
void drawTextPath(const std::shared_ptr< TextPath > &textPath, const CollectedPage &page)
Definition: QXPContentCollector.cpp:762
Definition: QXPTypes.h:545
LineJoinType joinType
Definition: QXPTypes.h:133
QXPDocumentProperties m_docProps
Definition: QXPContentCollector.h:136
Definition: QXPContentCollector.h:26
double width
Definition: QXPTypes.h:346
~QXPContentCollector()
Definition: QXPContentCollector.cpp:302
unsigned zIndex() const override
Definition: QXPContentCollector.h:92
double superscriptHScale
Definition: QXPTypes.h:576
void collectGroup(const std::shared_ptr< Group > &group) override
Definition: QXPContentCollector.cpp:392
#define QXP_ALMOST_ZERO(m)
Definition: libqxp_utils.h:27
double subscriptHScale
Definition: QXPTypes.h:579
bool m_isDocumentStarted
Definition: QXPContentCollector.h:127
void updateLinkedTexts()
Definition: QXPContentCollector.cpp:496
void drawRectangle(const std::shared_ptr< Box > &box, const CollectedPage &page)
Definition: QXPContentCollector.cpp:597
double subscriptVScale
Definition: QXPTypes.h:580
void endDocument() override
Definition: QXPContentCollector.cpp:320
void drawTextBox(const std::shared_ptr< TextBox > &textbox, const CollectedPage &page)
Definition: QXPContentCollector.cpp:712
Definition: libqxp_utils.cpp:24
std::vector< std::shared_ptr< TextObject > > linkedTextObjects
Definition: QXPContentCollector.h:111
std::vector< CollectedPage > m_unprocessedPages
Definition: QXPContentCollector.h:131
std::unordered_map< unsigned, std::unordered_map< unsigned, std::shared_ptr< TextObject > > > m_linkIndexedTextObjectsMap
Definition: QXPContentCollector.h:134
void collectTextBox(const std::shared_ptr< TextBox > &box) override
Definition: QXPContentCollector.cpp:368
Rect offset
Definition: QXPTypes.h:538
double getY(const double y) const
Definition: QXPContentCollector.cpp:1173
void draw(const CollectedPage &page) override
Definition: QXPContentCollector.h:83
void collectLine(const std::shared_ptr< Line > &line) override
Definition: QXPContentCollector.cpp:358
Definition: QXPContentCollector.h:107
void drawOval(const std::shared_ptr< Box > &oval, const CollectedPage &page)
Definition: QXPContentCollector.cpp:632
double superiorVScale
Definition: QXPTypes.h:582
const PageSettings settings
Definition: QXPContentCollector.h:109
Definition: QXPTypes.h:344
bool hasUnfinishedLinkedTexts()
Definition: QXPContentCollector.cpp:519
QXPContentCollector & operator=(const QXPContentCollector &other)=delete
std::vector< double > segmentLengths
Definition: QXPTypes.h:128
bool isFacing() const
Definition: QXPTypes.h:554
void collectTextPath(const std::shared_ptr< TextPath > &textPath) override
Definition: QXPContentCollector.cpp:380
std::unordered_map< unsigned, std::shared_ptr< Text > > m_linkTextMap
Definition: QXPContentCollector.h:133
double getX(const double x) const
Definition: QXPContentCollector.cpp:1163
double superscriptVScale
Definition: QXPTypes.h:577
double autoLeading() const
Definition: QXPTypes.cpp:171
Definition: QXPCollector.h:27
const Arrow * endArrow
Definition: QXPTypes.h:351
void draw(bool force=false)
Definition: QXPContentCollector.cpp:425
std::function< void(TThis *, const std::shared_ptr< T > &obj, const CollectedPage &)> ObjectHandlerMember
Definition: QXPContentCollector.h:59
boost::optional< unsigned > textLength
Definition: QXPTypes.h:367
double superscriptOffset
Definition: QXPTypes.h:575
void collectDocumentProperties(const QXPDocumentProperties &props) override
Definition: QXPContentCollector.cpp:353
double subscriptOffset
Definition: QXPTypes.h:578
void collectText(const std::shared_ptr< Text > &text, const unsigned linkId) override
Definition: QXPContentCollector.cpp:399
void drawBox(const std::shared_ptr< Box > &box, const CollectedPage &page)
Definition: QXPContentCollector.cpp:577
const Arrow * startArrow
Definition: QXPTypes.h:350
double normalizeDegAngle(double degAngle)
Definition: libqxp_utils.cpp:390
bool isIncrementalAutoLeading() const
Definition: QXPTypes.h:588
#define QXP_DEBUG_MSG(M)
Definition: libqxp_utils.h:53
Definition: QXPTypes.h:560
Definition: QXPTypes.h:536
std::shared_ptr< CollectedObject< T > > addObject(const std::shared_ptr< T > &obj, const ObjectHandlerMember< T, QXPContentCollector > &handler)
Definition: QXPContentCollector.h:141
virtual ~CollectedObjectInterface()=default
void drawGroup(const std::shared_ptr< Group > &group, const CollectedPage &page)
Definition: QXPContentCollector.cpp:1047
LineCapType endcapType
Definition: QXPTypes.h:132
std::vector< PageSettings > pageSettings
Definition: QXPTypes.h:547
std::vector< std::shared_ptr< CollectedObject< Group > > > groups
Definition: QXPContentCollector.h:110
boost::optional< Color > color
Definition: QXPTypes.h:347
virtual void draw(const CollectedPage &page)=0
double x
Definition: QXPTypes.h:26
Definition: QXPTypes.h:24
CollectedPage & getInsertionPage(const std::shared_ptr< Object > &obj)
Definition: QXPContentCollector.cpp:416
void drawText(const std::shared_ptr< Text > &text, const LinkedTextSettings &linkSettings)
Definition: QXPContentCollector.cpp:831
librevenge::RVNGDrawingInterface * m_painter
Definition: QXPContentCollector.h:125
void endPage() override
Definition: QXPContentCollector.cpp:347
void drawLine(const std::shared_ptr< Line > &line, const CollectedPage &page)
Definition: QXPContentCollector.cpp:535
void startPage(const Page &page) override
Definition: QXPContentCollector.cpp:336
unsigned offsetIntoText
Definition: QXPTypes.h:364
double superiorHScale
Definition: QXPTypes.h:581
void startDocument() override
Definition: QXPContentCollector.cpp:310
void appendCharacters(librevenge::RVNGString &text, const char *characters, const size_t size, const char *encoding)
Definition: libqxp_utils.cpp:398
void writeFrame(librevenge::RVNGPropertyList &propList, const Frame &frame, const bool runaround, const bool allowHairline=false)
Definition: QXPContentCollector.cpp:1090
void drawBezierBox(const std::shared_ptr< Box > &box, const CollectedPage &page)
Definition: QXPContentCollector.cpp:682
void setZIndex(unsigned value) override
Definition: QXPContentCollector.h:97
const ObjectHandler< T > m_handler
Definition: QXPContentCollector.h:103
void collectBox(const std::shared_ptr< Box > &box) override
Definition: QXPContentCollector.cpp:363
double left
Definition: QXPTypes.h:51
void collectTextObject(const std::shared_ptr< TextObject > &textObj, CollectedPage &page)
Definition: QXPContentCollector.cpp:474
virtual unsigned zIndex() const =0
std::map< unsigned, std::shared_ptr< CollectedObjectInterface > > objects
Definition: QXPContentCollector.h:112
virtual void setZIndex(unsigned value)=0
bool m_isCollectingFacingPage
Definition: QXPContentCollector.h:128
double y
Definition: QXPTypes.h:27
CollectedObject(const std::shared_ptr< T > &obj, const ObjectHandler< T > &handler)
Definition: QXPContentCollector.h:79
Definition: QXPContentCollector.h:61
unsigned m_currentObjectIndex
Definition: QXPContentCollector.h:129
QXPContentCollector(const QXPContentCollector &other)=delete
void drawPolygon(const std::shared_ptr< Box > &polygon, const CollectedPage &page)
Definition: QXPContentCollector.cpp:656
void writeFill(librevenge::RVNGPropertyList &propList, const boost::optional< Fill > &fill)
Definition: QXPContentCollector.cpp:1079
bool m_isProcessed
Definition: QXPContentCollector.h:104
std::function< void(const std::shared_ptr< T > &obj, const CollectedPage &)> ObjectHandler
Definition: QXPContentCollector.h:56
double patternLength
Definition: QXPTypes.h:131
Definition: QXPTypes.h:361
Point getPoint(const Point &p) const
Definition: QXPContentCollector.cpp:1183
Point rotateDeg(double rotationDeg, const Point ¢er) const
Definition: QXPTypes.cpp:33
bool isProportional
Definition: QXPTypes.h:130
librevenge::RVNGPropertyList & m_propList
Definition: QXPContentCollector.cpp:278
CollectedPage(const PageSettings &pageSettings)
Definition: QXPContentCollector.h:114
Definition: QXPContentCollector.h:73
const LineStyle * lineStyle
Definition: QXPTypes.h:349
const std::shared_ptr< T > object
Definition: QXPContentCollector.h:75
Generated for libqxp by
doxygen 1.8.16