MWAWGraphicListener.hxx Source File documentation

MWAWGraphicListener.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 #ifndef MWAW_GRAPHIC_LISTENER_H
35 #define MWAW_GRAPHIC_LISTENER_H
36
37 #include <vector>
38
39 #include <librevenge/librevenge.h>
40
41 #include "libmwaw_internal.hxx"
42
43 #include "MWAWGraphicStyle.hxx"
44
45 #include "MWAWListener.hxx"
46
47 class MWAWGraphicShape;
48
49 namespace MWAWGraphicListenerInternal
50 {
51 struct GraphicState;
52 struct State;
53 }
54
59 class MWAWGraphicListener final : public MWAWListener
60 {
61 public:
63 MWAWGraphicListener(MWAWParserState &parserState, std::vector<MWAWPageSpan> const &pageList, librevenge::RVNGDrawingInterface *documentInterface);
67 MWAWGraphicListener(MWAWParserState &parserState, MWAWBox2f const &box, librevenge::RVNGDrawingInterface *documentInterface);
69 ~MWAWGraphicListener() final;
70
72 Type getType() const final
73 {
74 return Graphic;
75 }
76
78 void setDocumentMetaData(librevenge::RVNGPropertyList const &metadata) final;
80 void setDocumentLanguage(std::string const &locale) final;
82 void startDocument() final;
84 void endDocument(bool delayed=true) final;
85
86 // ------ general information --------
88 bool canWriteText() const final;
90 bool isDocumentStarted() const final;
91
93 void handleSubDocument(MWAWVec2f const &orig, MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType);
95 void handleSubDocument(MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType) final
96 {
97 handleSubDocument(MWAWVec2f(0,0), subDocument, subDocumentType);
98 }
100 bool isSubDocumentOpened(libmwaw::SubDocumentType &subdocType) const final;
102 bool openFrame(MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final;
104 void closeFrame() final;
106 bool openGroup(MWAWPosition const &pos) final;
108 void closeGroup() final;
110 bool openLayer(librevenge::RVNGString const &name);
112 void closeLayer();
113
114 // ------ page --------
116 bool openMasterPage(MWAWPageSpan &masterPage);
118 void closeMasterPage()
119 {
120 _closePageSpan(true);
121 }
123 bool isPageSpanOpened() const final;
127 MWAWPageSpan const &getPageSpan() final;
128
129 // ------ header/footer --------
131 bool insertHeader(MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final;
133 bool insertFooter(MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final;
135 bool isHeaderFooterOpened() const final;
136
137 // ------ text data -----------
139 void insertChar(uint8_t character) final;
142 void insertCharacter(unsigned char c) final;
148 int insertCharacter(unsigned char c, MWAWInputStreamPtr &input, long endPos=-1) final;
151 void insertUnicode(uint32_t character) final;
153 void insertUnicodeString(librevenge::RVNGString const &str) final;
154
156 void insertTab() final;
158 void insertEOL(bool softBreak=false) final;
159
160 // ------ text format -----------
162 void setFont(MWAWFont const &font) final;
164 MWAWFont const &getFont() const final;
165
166 // ------ paragraph format -----------
168 bool isParagraphOpened() const final;
170 void setParagraph(MWAWParagraph const &paragraph) final;
172 MWAWParagraph const &getParagraph() const final;
173
174 // ------- fields ----------------
176 void insertField(MWAWField const &field) final;
177
178 // ------- link ----------------
180 void openLink(MWAWLink const &link) final;
182 void closeLink() final;
183
184 // ------- subdocument -----------------
186 void insertPicture(MWAWPosition const &pos, MWAWEmbeddedObject const &picture,
187 MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final;
189 void insertShape(MWAWPosition const &pos, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style) final;
191 void insertTextBox(MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicStyle const &style) final;
193 void insertGroup(MWAWBox2f const &bdbox, MWAWSubDocumentPtr const &subDocument);
197 void insertNote(MWAWNote const &note, MWAWSubDocumentPtr &subDocument) final;
201 void insertComment(MWAWSubDocumentPtr &subDocument) final;
202
203 // ------- table -----------------
204
206 void insertTable(MWAWPosition const &pos, MWAWTable &table, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle());
208 void openTable(MWAWTable const &table) final;
210 void openTable(MWAWPosition const &pos, MWAWTable const &table, MWAWGraphicStyle const &style);
212 void closeTable() final;
214 void openTableRow(float h, librevenge::RVNGUnit unit, bool headerRow=false) final;
216 void closeTableRow() final;
218 void openTableCell(MWAWCell const &cell) final;
220 void closeTableCell() final;
222 void addEmptyTableCell(MWAWVec2i const &pos, MWAWVec2i span=MWAWVec2i(1,1)) final;
223
224 // ------- section ---------------
225
227 bool canOpenSectionAddBreak() const final
228 {
229 return false;
230 }
232 bool isSectionOpened() const final
233 {
234 return false;
235 }
237 MWAWSection const &getSection() const final;
239 bool openSection(MWAWSection const &section) final;
241 bool closeSection() final
242 {
243 return false;
244 }
246 void insertBreak(BreakType breakType) final;
247
248 protected:
250 void _openPageSpan(bool sendHeaderFooters=true);
252 void _closePageSpan(bool masterPage=false);
253
254 void _startSubDocument();
255 void _endSubDocument();
256
260 void _handleFrameParameters(librevenge::RVNGPropertyList &propList, MWAWPosition const &pos, MWAWGraphicStyle const &style);
261
262 void _openParagraph();
263 void _closeParagraph();
264 void _resetParagraphState(const bool isListElement=false);
265
267 void _openListElement();
269 void _closeListElement();
271 void _changeList();
276 int _getListId() const;
277
278 void _openSpan();
279 void _closeSpan();
280
281 void _flushText();
282
286 std::shared_ptr<MWAWGraphicListenerInternal::State> _pushParsingState();
288 void _popParsingState();
289
290 protected:
292 std::shared_ptr<MWAWGraphicListenerInternal::GraphicState> m_ds;
294 std::shared_ptr<MWAWGraphicListenerInternal::State> m_ps;
296 std::vector<std::shared_ptr<MWAWGraphicListenerInternal::State> > m_psStack;
298 MWAWParserState &m_parserState;
300 librevenge::RVNGDrawingInterface *m_documentInterface;
301
302 private:
303 MWAWGraphicListener(const MWAWGraphicListener &) = delete;
304 MWAWGraphicListener &operator=(const MWAWGraphicListener &) = delete;
305 };
306
307 #endif
308 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWEmbeddedObject::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist
Definition: libmwaw_internal.cxx:579
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
MWAWListener::BreakType
BreakType
the different break type
Definition: MWAWListener.hxx:58
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false std::shared_ptr
Definition: libmwaw_internal.hxx:101
MWAWGraphicListenerInternal::State::m_frameStyle
MWAWGraphicStyle m_frameStyle
the frame style
Definition: MWAWGraphicListener.cxx:142
MWAWGraphicListenerInternal::State::m_isParagraphOpened
bool m_isParagraphOpened
Definition: MWAWGraphicListener.cxx:151
MWAWGraphicListener::_pushParsingState
std::shared_ptr< MWAWGraphicListenerInternal::State > _pushParsingState()
creates a new parsing state (copy of the actual state)
Definition: MWAWGraphicListener.cxx:1693
MWAWPosition::naturalSize
MWAWVec2f const & naturalSize() const
returns the natural size (if known)
Definition: MWAWPosition.hxx:140
MWAWGraphicListener::setDocumentMetaData
void setDocumentMetaData(librevenge::RVNGPropertyList const &metadata) final
sets the documents metadata
Definition: MWAWGraphicListener.cxx:501
MWAWGraphicListener::isParagraphOpened
bool isParagraphOpened() const final
returns true if a paragraph or a list is opened
Definition: MWAWGraphicListener.cxx:392
MWAWNote
a note
Definition: libmwaw_internal.hxx:445
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
MWAWField::m_type
Type m_type
the type
Definition: libmwaw_internal.hxx:420
MWAWPosition::getInvUnitScale
float getInvUnitScale(librevenge::RVNGUnit fromUnit) const
returns a float which can be used to scale some data in object unit
Definition: MWAWPosition.hxx:199
MWAWGraphicListener::closeTableRow
void closeTableRow() final
closes this row
Definition: MWAWGraphicListener.cxx:1262
MWAWGraphicListener::closeMasterPage
void closeMasterPage()
close a master page
Definition: MWAWGraphicListener.hxx:118
MWAWGraphicListener::isSubDocumentOpened
bool isSubDocumentOpened(libmwaw::SubDocumentType &subdocType) const final
returns try if a subdocument is open
Definition: MWAWGraphicListener.cxx:1661
MWAWGraphicListener::_flushText
void _flushText()
Definition: MWAWGraphicListener.cxx:866
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWGraphicListener::setDocumentLanguage
void setDocumentLanguage(std::string const &locale) final
sets the documents language
Definition: MWAWGraphicListener.cxx:508
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
MWAWListener::ColumnBreak
@ ColumnBreak
Definition: MWAWListener.hxx:58
MWAWGraphicShape::C_Polygon
@ C_Polygon
Definition: MWAWGraphicShape.hxx:51
MWAWGraphicListenerInternal::GraphicState::~GraphicState
~GraphicState()
destructor
Definition: MWAWGraphicListener.cxx:84
MWAWGraphicListenerInternal::State::m_framePosition
MWAWPosition m_framePosition
the frame position
Definition: MWAWGraphicListener.cxx:140
MWAWParserState::m_listManager
MWAWListManagerPtr m_listManager
the list manager
Definition: MWAWParser.hxx:80
MWAWGraphicShape::C_Path
@ C_Path
Definition: MWAWGraphicShape.hxx:51
MWAWPosition::XFull
@ XFull
Definition: MWAWPosition.hxx:55
MWAWGraphicListener::insertTable
void insertTable(MWAWPosition const &pos, MWAWTable &table, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
adds a table in given position
Definition: MWAWGraphicListener.cxx:1162
MWAWGraphicListener::_closeParagraph
void _closeParagraph()
Definition: MWAWGraphicListener.cxx:673
MWAWGraphicListener::MWAWGraphicListener
MWAWGraphicListener(const MWAWGraphicListener &)=delete
libmwaw::DOC_COMMENT_ANNOTATION
@ DOC_COMMENT_ANNOTATION
Definition: libmwaw_internal.hxx:188
MWAWHeaderFooter::EVEN
@ EVEN
Definition: MWAWPageSpan.hxx:50
MWAWFont::id
int id() const
returns the font id
Definition: MWAWFont.hxx:259
MWAWGraphicListener::_openPageSpan
void _openPageSpan(bool sendHeaderFooters=true)
does open a new page (low level)
Definition: MWAWGraphicListener.cxx:562
MWAWGraphicListener::_openSpan
void _openSpan()
Definition: MWAWGraphicListener.cxx:820
MWAWGraphicListener::insertCharacter
void insertCharacter(unsigned char c) final
insert a character using the font converter to find the utf8 character
Definition: MWAWGraphicListener.cxx:257
MWAWPosition::order
int order() const
returns background/foward order
Definition: MWAWPosition.hxx:259
MWAWGraphicListenerInternal::GraphicState::m_isPageSpanOpened
bool m_isPageSpanOpened
true if a page is open
Definition: MWAWGraphicListener.cxx:94
MWAWTable.hxx
MWAWGraphicListener::getPageSpan
MWAWPageSpan const & getPageSpan() final
returns the current page span
Definition: MWAWGraphicListener.cxx:532
MWAWGraphicListener::openFrame
bool openFrame(MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final
store the position and the style (which will be needed further to insert a textbox or a table with op...
Definition: MWAWGraphicListener.cxx:1326
MWAWGraphicListenerInternal::GraphicState::operator=
GraphicState & operator=(GraphicState const &)=default
MWAWPosition::m_xPos
XPos m_xPos
X relative position.
Definition: MWAWPosition.hxx:274
MWAWPosition::WBackground
@ WBackground
Definition: MWAWPosition.hxx:53
MWAWGraphicListener::_handleFrameParameters
void _handleFrameParameters(librevenge::RVNGPropertyList &propList, MWAWPosition const &pos, MWAWGraphicStyle const &style)
adds in propList the frame parameters.
Definition: MWAWGraphicListener.cxx:1431
MWAWGraphicListener::getParagraph
MWAWParagraph const & getParagraph() const final
returns the actual paragraph
Definition: MWAWGraphicListener.cxx:408
MWAWGraphicShape
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
MWAWPosition::YCenter
@ YCenter
Definition: MWAWPosition.hxx:57
MWAWFontConverter.hxx
libmwaw::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:63
MWAWGraphicListener::m_ps
std::shared_ptr< MWAWGraphicListenerInternal::State > m_ps
the actual local parse state
Definition: MWAWGraphicListener.hxx:294
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MWAWTable::sendTable
bool sendTable(MWAWListenerPtr listener, bool inFrame=true)
try to send the table
Definition: MWAWTable.cxx:471
MWAWGraphicListener::addEmptyTableCell
void addEmptyTableCell(MWAWVec2i const &pos, MWAWVec2i span=MWAWVec2i(1, 1)) final
add empty cell
Definition: MWAWGraphicListener.cxx:1272
MWAWSubDocumentPtr
std::shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:565
MWAWField::getString
librevenge::RVNGString getString() const
returns a string corresponding to the field (if possible) *‍/
Definition: libmwaw_internal.cxx:294
MWAWGraphicListenerInternal::GraphicState::m_subDocuments
std::vector< MWAWSubDocumentPtr > m_subDocuments
the list of actual subdocument
Definition: MWAWGraphicListener.cxx:106
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:85
MWAWPosition::WDynamic
@ WDynamic
Definition: MWAWPosition.hxx:53
MWAWListener::Graphic
@ Graphic
Definition: MWAWListener.hxx:56
MWAWGraphicListenerInternal::State::m_isListElementOpened
bool m_isListElementOpened
Definition: MWAWGraphicListener.cxx:152
MWAW_FALLTHROUGH
#define MWAW_FALLTHROUGH
Definition: libmwaw_internal.hxx:118
MWAWGraphicListener::insertPicture
void insertPicture(MWAWPosition const &pos, MWAWEmbeddedObject const &picture, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final
adds a picture with potential various representationin given position
Definition: MWAWGraphicListener.cxx:1076
MWAWLink
a link
Definition: libmwaw_internal.hxx:430
MWAWGraphicListenerInternal::State::m_firstParagraphInPageSpan
bool m_firstParagraphInPageSpan
Definition: MWAWGraphicListener.cxx:154
MWAWGraphicListener::insertGroup
void insertGroup(MWAWBox2f const &bdbox, MWAWSubDocumentPtr const &subDocument)
adds a group: ie.
Definition: MWAWGraphicListener.cxx:1147
MWAWGraphicListener::isDocumentStarted
bool isDocumentStarted() const final
returns true if a document is opened
Definition: MWAWGraphicListener.cxx:514
MWAWGraphicListenerInternal::State::m_isTableOpened
bool m_isTableOpened
a stack used to know what is open
Definition: MWAWGraphicListener.cxx:158
MWAWGraphicListener::insertUnicodeString
void insertUnicodeString(librevenge::RVNGString const &str) final
adds a unicode string
Definition: MWAWGraphicListener.cxx:324
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
MWAWGraphicListener::insertComment
void insertComment(MWAWSubDocumentPtr &subDocument) final
adds comment
Definition: MWAWGraphicListener.cxx:991
MWAWGraphicListener::openSection
bool openSection(MWAWSection const &section) final
open a section if possible
Definition: MWAWGraphicListener.cxx:956
MWAWGraphicListener::closeLayer
void closeLayer()
close a layer
Definition: MWAWGraphicListener.cxx:1420
MWAWPageSpan::getPageProperty
void getPageProperty(librevenge::RVNGPropertyList &pList, bool isPresentation=false) const
add the page properties in pList
Definition: MWAWPageSpan.cxx:310
MWAWPosition::XCenter
@ XCenter
Definition: MWAWPosition.hxx:55
MWAWGraphicListenerInternal::GraphicState::m_pageList
std::vector< MWAWPageSpan > m_pageList
the pages definition
Definition: MWAWGraphicListener.cxx:88
MWAWGraphicListenerInternal::State::State
State()
constructor
Definition: MWAWGraphicListener.cxx:177
MWAWGraphicListener::getFont
MWAWFont const & getFont() const final
returns the actual font
Definition: MWAWGraphicListener.cxx:387
MWAWGraphicListener::insertHeader
bool insertHeader(MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final
insert a header
Definition: MWAWGraphicListener.cxx:902
MWAWGraphicListener::isSectionOpened
bool isSectionOpened() const final
returns true if a section is opened
Definition: MWAWGraphicListener.hxx:232
MWAWCell.hxx
Defines MWAWCell (cell content and format)
MWAWCell::addTo
void addTo(librevenge::RVNGPropertyList &propList, std::shared_ptr< MWAWFontConverter > fontConverter) const
adds to the propList
Definition: MWAWCell.cxx:255
MWAWGraphicListenerInternal::GraphicState
the global graphic state of MWAWGraphicListener
Definition: MWAWGraphicListener.cxx:65
MWAWGraphicListenerInternal::State::m_numPagesRemainingInSpan
int m_numPagesRemainingInSpan
Definition: MWAWGraphicListener.cxx:164
MWAWGraphicListener::canWriteText
bool canWriteText() const final
returns true if a text zone is opened
Definition: MWAWGraphicListener.cxx:519
MWAWListener::SoftPageBreak
@ SoftPageBreak
Definition: MWAWListener.hxx:58
MWAWSubDocument.hxx
MWAWGraphicListenerInternal::GraphicState::m_pageSpan
MWAWPageSpan m_pageSpan
! the current page span
Definition: MWAWGraphicListener.cxx:102
MWAWPosition::size
MWAWVec2f const & size() const
returns the frame size
Definition: MWAWPosition.hxx:135
MWAWPageSpan::setFormLength
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
MWAWPageSpan::getPageSpan
int getPageSpan() const
Definition: MWAWPageSpan.hxx:170
MWAWGraphicShape::getType
Type getType() const
returns the type corresponding to a shape
Definition: MWAWGraphicShape.hxx:192
MWAWPosition::YFull
@ YFull
Definition: MWAWPosition.hxx:57
MWAWGraphicListener::_resetParagraphState
void _resetParagraphState(const bool isListElement=false)
Definition: MWAWGraphicListener.cxx:695
MWAWLink::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist (if needed )
Definition: libmwaw_internal.cxx:423
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:188
MWAWGraphicListener::_openParagraph
void _openParagraph()
Definition: MWAWGraphicListener.cxx:652
MWAWGraphicListenerInternal::State::m_isFrameOpened
bool m_isFrameOpened
a flag to know if openFrame was called
Definition: MWAWGraphicListener.cxx:138
MWAWGraphicStyle::emptyStyle
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:401
MWAWGraphicListener::m_documentInterface
librevenge::RVNGDrawingInterface * m_documentInterface
the document interface
Definition: MWAWGraphicListener.hxx:300
MWAWGraphicListenerInternal::State::operator=
State & operator=(const State &)=delete
MWAWParagraph.hxx
MWAWGraphicEncoder.hxx
MWAWGraphicListenerInternal::State::m_isTableRowOpened
bool m_isTableRowOpened
Definition: MWAWGraphicListener.cxx:159
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:673
MWAWPageSpan::sendHeaderFooters
void sendHeaderFooters(MWAWListener *listener) const
send the page's headers/footers if some exists
Definition: MWAWPageSpan.cxx:283
MWAWGraphicListenerInternal::GraphicState::GraphicState
GraphicState(std::vector< MWAWPageSpan > const &pageList)
constructor
Definition: MWAWGraphicListener.cxx:67
MWAWGraphicListener::setFont
void setFont(MWAWFont const &font) final
sets the font
Definition: MWAWGraphicListener.cxx:367
libmwaw_internal.hxx
MWAWListener
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:50
MWAWGraphicListener::insertUnicode
void insertUnicode(uint32_t character) final
adds an unicode character.
Definition: MWAWGraphicListener.cxx:311
MWAWGraphicListener::endDocument
void endDocument(bool delayed=true) final
ends the actual document
Definition: MWAWGraphicListener.cxx:481
MWAWPageSpan::setFormWidth
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
MWAWPosition.hxx
MWAWGraphicShape::C_Bad
@ C_Bad
Definition: MWAWGraphicShape.hxx:51
MWAWGraphicListenerInternal::State::m_inNote
bool m_inNote
Definition: MWAWGraphicListener.cxx:168
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:668
MWAWGraphicListener::MWAWGraphicListener
MWAWGraphicListener(MWAWParserState &parserState, std::vector< MWAWPageSpan > const &pageList, librevenge::RVNGDrawingInterface *documentInterface)
constructor
Definition: MWAWGraphicListener.cxx:209
MWAWGraphicListener::insertField
void insertField(MWAWField const &field) final
adds a field type
Definition: MWAWGraphicListener.cxx:416
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
MWAWGraphicListener::closeSection
bool closeSection() final
close a section
Definition: MWAWGraphicListener.hxx:241
MWAWGraphicStyle::m_flip
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:560
MWAWGraphicListener::openTableRow
void openTableRow(float h, librevenge::RVNGUnit unit, bool headerRow=false) final
open a row with given height ( if h < 0.0, set min-row-height = -h )
Definition: MWAWGraphicListener.cxx:1241
MWAWGraphicListenerInternal::State::m_isLayerOpened
bool m_isLayerOpened
a flag to know if openLayer was called
Definition: MWAWGraphicListener.cxx:149
MWAWGraphicListener::isPageSpanOpened
bool isPageSpanOpened() const final
returns true if a page is opened
Definition: MWAWGraphicListener.cxx:527
MWAWPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:278
libmwaw::DOC_HEADER_FOOTER
@ DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:188
MWAWGraphicListener::handleSubDocument
void handleSubDocument(MWAWVec2f const &orig, MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType)
function called to add a subdocument and modify the origin
Definition: MWAWGraphicListener.cxx:1604
MWAWGraphicListener::insertTab
void insertTab() final
adds a tab
Definition: MWAWGraphicListener.cxx:353
MWAWPageSpan::getFormWidth
double getFormWidth() const
returns the page width
Definition: MWAWPageSpan.hxx:122
libmwaw::DOC_GRAPHIC_GROUP
@ DOC_GRAPHIC_GROUP
Definition: libmwaw_internal.hxx:188
MWAWListener::PageBreak
@ PageBreak
Definition: MWAWListener.hxx:58
MWAWTable
a class used to recreate the table structure using cell informations, ....
Definition: MWAWTable.hxx:52
MWAWGraphicListener::_startSubDocument
void _startSubDocument()
Definition: MWAWGraphicListener.cxx:1669
MWAWVec2< float >
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:270
MWAWHeaderFooter::ODD
@ ODD
Definition: MWAWPageSpan.hxx:50
MWAWGraphicListener::_getListId
int _getListId() const
low level: find a list id which corresponds to actual list and a change of level.
Definition: MWAWGraphicListener.cxx:743
MWAWGraphicListener.hxx
MWAWGraphicListener::openLayer
bool openLayer(librevenge::RVNGString const &name)
open a layer
Definition: MWAWGraphicListener.cxx:1393
MWAWGraphicShape.hxx
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:46
libmwaw::ParseException
Definition: libmwaw_internal.hxx:144
MWAWGraphicListener::insertNote
void insertNote(MWAWNote const &note, MWAWSubDocumentPtr &subDocument) final
insert a note
Definition: MWAWGraphicListener.cxx:1009
MWAWGraphicListener::openTable
void openTable(MWAWTable const &table) final
open a table (using the last parameters of openFrame for the position )
Definition: MWAWGraphicListener.cxx:1187
MWAWGraphicListener::insertShape
void insertShape(MWAWPosition const &pos, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style) final
adds a shape picture in given position
Definition: MWAWGraphicListener.cxx:1032
MWAWGraphicListenerInternal::State::State
State(const State &)=delete
MWAWGraphicListenerInternal::GraphicState::m_section
MWAWSection m_section
a section used to return a bad section
Definition: MWAWGraphicListener.cxx:108
MWAWGraphicListenerInternal::State::m_currentPageNumber
int m_currentPageNumber
Definition: MWAWGraphicListener.cxx:165
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
MWAWGraphicShape::C_Polyline
@ C_Polyline
Definition: MWAWGraphicShape.hxx:51
MWAWGraphicListenerInternal::State::~State
~State()
destructor
Definition: MWAWGraphicListener.cxx:116
MWAWGraphicListener::_endSubDocument
void _endSubDocument()
Definition: MWAWGraphicListener.cxx:1675
MWAWGraphicListener::operator=
MWAWGraphicListener & operator=(const MWAWGraphicListener &)=delete
MWAWField
a field
Definition: libmwaw_internal.hxx:399
MWAWGraphicListener::insertTextBox
void insertTextBox(MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicStyle const &style) final
adds a textbox in given position
Definition: MWAWGraphicListener.cxx:1111
MWAWGraphicListener::closeFrame
void closeFrame() final
close a frame
Definition: MWAWGraphicListener.cxx:1348
MWAWGraphicListenerInternal::GraphicState::m_isMasterPageSpanOpened
bool m_isMasterPageSpanOpened
true if a masterpage is open
Definition: MWAWGraphicListener.cxx:96
MWAWGraphicListener::_closeListElement
void _closeListElement()
close a list level
Definition: MWAWGraphicListener.cxx:730
MWAWGraphicListenerInternal::State::m_isTableCellOpened
bool m_isTableCellOpened
Definition: MWAWGraphicListener.cxx:161
MWAWGraphicListener::getSection
MWAWSection const & getSection() const final
returns the actual section
Definition: MWAWGraphicListener.cxx:950
MWAWGraphicListener::_changeList
void _changeList()
update the list so that it corresponds to the actual level
Definition: MWAWGraphicListener.cxx:759
libmwaw::DOC_TABLE
@ DOC_TABLE
Definition: libmwaw_internal.hxx:188
MWAWParserState::m_fontConverter
MWAWFontConverterPtr m_fontConverter
the font converter
Definition: MWAWParser.hxx:74
libmwaw::DOC_TEXT_BOX
@ DOC_TEXT_BOX
Definition: libmwaw_internal.hxx:188
MWAWGraphicListenerInternal::State::m_currentPage
unsigned m_currentPage
Definition: MWAWGraphicListener.cxx:163
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MWAWGraphicListener::getType
Type getType() const final
returns the listener type
Definition: MWAWGraphicListener.hxx:72
MWAWList.hxx
libmwaw::DOC_NOTE
@ DOC_NOTE
Definition: libmwaw_internal.hxx:188
MWAWPosition::rightBottomClipping
MWAWVec2f const & rightBottomClipping() const
returns the right bottom clipping
Definition: MWAWPosition.hxx:150
MWAWGraphicShape::Line
@ Line
Definition: MWAWGraphicShape.hxx:49
MWAWGraphicListener::_openListElement
void _openListElement()
open a list level
Definition: MWAWGraphicListener.cxx:704
MWAWListener::Type
Type
the listener type
Definition: MWAWListener.hxx:56
MWAWGraphicListener::closeTableCell
void closeTableCell() final
close a cell
Definition: MWAWGraphicListener.cxx:1308
MWAWGraphicListenerInternal::State::m_origin
MWAWVec2f m_origin
the origin position
Definition: MWAWGraphicListener.cxx:126
MWAWGraphicListenerInternal::State::m_isSpanOpened
bool m_isSpanOpened
Definition: MWAWGraphicListener.cxx:150
MWAWGraphicListenerInternal::State::m_subDocumentType
libmwaw::SubDocumentType m_subDocumentType
Definition: MWAWGraphicListener.cxx:170
MWAWGraphicListenerInternal::GraphicState::operator=
GraphicState & operator=(GraphicState &&)=default
MWAWGraphicStyle.hxx
MWAWGraphicListenerInternal::GraphicState::m_isDocumentStarted
bool m_isDocumentStarted
a flag to know if the document is open
Definition: MWAWGraphicListener.cxx:92
MWAWGraphicListener::startDocument
void startDocument() final
starts a new document
Definition: MWAWGraphicListener.cxx:470
MWAWGraphicShape::C_Ellipse
@ C_Ellipse
Definition: MWAWGraphicShape.hxx:51
MWAWParserState
a class to define the parser state
Definition: MWAWParser.hxx:50
MWAWGraphicListener::insertFooter
bool insertFooter(MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final
insert a footer
Definition: MWAWGraphicListener.cxx:923
MWAWGraphicListener::canOpenSectionAddBreak
bool canOpenSectionAddBreak() const final
returns true if we can add open a section, add page break, ...
Definition: MWAWGraphicListener.hxx:227
MWAWGraphicListener::setParagraph
void setParagraph(MWAWParagraph const &paragraph) final
sets the paragraph
Definition: MWAWGraphicListener.cxx:397
MWAWGraphicListenerInternal::State::m_listOrderedLevels
std::vector< bool > m_listOrderedLevels
Definition: MWAWGraphicListener.cxx:156
MWAWGraphicListenerInternal::State::m_font
MWAWFont m_font
the font
Definition: MWAWGraphicListener.cxx:131
MWAWGraphicListenerInternal::State::m_isTextBoxOpened
bool m_isTextBoxOpened
a flag to know if we are in a textbox
Definition: MWAWGraphicListener.cxx:145
MWAWGraphicListenerInternal::GraphicState::m_isHeaderFooterStarted
bool m_isHeaderFooterStarted
a flag to know if the header footer is started
Definition: MWAWGraphicListener.cxx:100
MWAWGraphicListenerInternal::State::m_list
std::shared_ptr< MWAWList > m_list
the list of list
Definition: MWAWGraphicListener.cxx:135
MWAWPosition::Page
@ Page
Definition: MWAWPosition.hxx:51
MWAWPosition::WForeground
@ WForeground
Definition: MWAWPosition.hxx:53
MWAWSection.hxx
MWAWGraphicListener::closeLink
void closeLink() final
close a link
Definition: MWAWGraphicListener.cxx:457
MWAWGraphicStyle::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:437
MWAWParserState::m_fontManager
MWAWFontManagerPtr m_fontManager
the font manager
Definition: MWAWParser.hxx:76
MWAWGraphicListenerInternal::GraphicState::m_metaData
librevenge::RVNGPropertyList m_metaData
the document meta data
Definition: MWAWGraphicListener.cxx:90
MWAWPosition::origin
MWAWVec2f const & origin() const
return the frame origin
Definition: MWAWPosition.hxx:130
MWAWGraphicShape::addTo
Command addTo(MWAWVec2f const &orig, bool asSurface, librevenge::RVNGPropertyList &propList) const
updates the propList to send to an interface
Definition: MWAWGraphicShape.cxx:458
MWAWGraphicListener::closeGroup
void closeGroup() final
close a group
Definition: MWAWGraphicListener.cxx:1382
MWAWPosition::YTop
@ YTop
Definition: MWAWPosition.hxx:57
MWAWGraphicListenerInternal::State
the state of a MWAWGraphicListener
Definition: MWAWGraphicListener.cxx:112
MWAWGraphicListener::openLink
void openLink(MWAWLink const &link) final
open a link
Definition: MWAWGraphicListener.cxx:437
MWAWGraphicListener::isHeaderFooterOpened
bool isHeaderFooterOpened() const final
returns true if the header/footer is open
Definition: MWAWGraphicListener.cxx:897
MWAWGraphicListenerInternal::State::m_isGroupOpened
bool m_isGroupOpened
a flag to know if openGroup was called
Definition: MWAWGraphicListener.cxx:147
MWAWListener.hxx
MWAWGraphicListenerInternal::State::m_inSubDocument
bool m_inSubDocument
Definition: MWAWGraphicListener.cxx:169
MWAWPosition::unit
librevenge::RVNGUnit unit() const
returns the unit
Definition: MWAWPosition.hxx:155
MWAWPosition::m_yPos
YPos m_yPos
Y relative position.
Definition: MWAWPosition.hxx:276
MWAWPosition::XRight
@ XRight
Definition: MWAWPosition.hxx:55
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
MWAWGraphicListener::_closeSpan
void _closeSpan()
Definition: MWAWGraphicListener.cxx:847
MWAWPosition::WRunThrough
@ WRunThrough
Definition: MWAWPosition.hxx:53
MWAWGraphicListenerInternal::GraphicState::m_isAtLeastOnePageOpened
bool m_isAtLeastOnePageOpened
true if the first page has been open
Definition: MWAWGraphicListener.cxx:98
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
MWAWPosition::XLeft
@ XLeft
Definition: MWAWPosition.hxx:55
libmwaw.hxx
libmwaw API: main libmwaw interface header
libmwaw
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:51
MWAWPosition::YBottom
@ YBottom
Definition: MWAWPosition.hxx:57
MWAWPosition::leftTopClipping
MWAWVec2f const & leftTopClipping() const
returns the left top clipping
Definition: MWAWPosition.hxx:145
MWAWInputStream.hxx
MWAWGraphicListenerInternal::GraphicState::m_sentListMarkers
std::vector< int > m_sentListMarkers
the list of marker corresponding to sent list
Definition: MWAWGraphicListener.cxx:104
MWAWGraphicListener::openMasterPage
bool openMasterPage(MWAWPageSpan &masterPage)
opens a master page
Definition: MWAWGraphicListener.cxx:539
MWAWFont.hxx
MWAWPosition::m_anchorTo
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:270
librevenge
Definition: MWAWDocument.hxx:57
MWAWGraphicStyle::m_rotate
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:544
MWAWGraphicListenerInternal::State::m_textBuffer
librevenge::RVNGString m_textBuffer
a buffer to stored the text
Definition: MWAWGraphicListener.cxx:128
MWAWGraphicStyle::addTo
void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const
add all the parameters to the propList excepted the frame parameter: the background and the borders
Definition: MWAWGraphicStyle.cxx:251
MWAWPageSpan::setMargins
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
MWAWGraphicListenerInternal::State::m_inLink
bool m_inLink
Definition: MWAWGraphicListener.cxx:167
MWAWBox2< float >
MWAWGraphicListener::_closePageSpan
void _closePageSpan(bool masterPage=false)
does close a page (low level)
Definition: MWAWGraphicListener.cxx:613
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWCell
a structure used to define a cell and its format
Definition: MWAWCell.hxx:53
MWAWGraphicListenerInternal
Internal and low level namespace to define the states of MWAWGraphicListener.
Definition: MWAWGraphicListener.cxx:63
MWAWField::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist (if possible)
Definition: libmwaw_internal.cxx:240
MWAWGraphicListener::_popParsingState
void _popParsingState()
resets the previous parsing state
Definition: MWAWGraphicListener.cxx:1701
MWAWPosition::WParallel
@ WParallel
Definition: MWAWPosition.hxx:53
libmwaw::DOC_NONE
@ DOC_NONE
Definition: libmwaw_internal.hxx:188
MWAWGraphicStyle::hasSurface
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:442
MWAWGraphicListener::openTableCell
void openTableCell(MWAWCell const &cell) final
open a cell
Definition: MWAWGraphicListener.cxx:1291
MWAWPageSpan::getFormLength
double getFormLength() const
returns the page length
Definition: MWAWPageSpan.hxx:117
MWAWGraphicListener::m_psStack
std::vector< std::shared_ptr< MWAWGraphicListenerInternal::State > > m_psStack
stack of local state
Definition: MWAWGraphicListener.hxx:296
MWAWGraphicListener::openGroup
bool openGroup(MWAWPosition const &pos) final
open a group
Definition: MWAWGraphicListener.cxx:1357
MWAWTable::addTablePropertiesTo
void addTablePropertiesTo(librevenge::RVNGPropertyList &propList) const
adds the table properties to propList
Definition: MWAWTable.cxx:131
MWAWGraphicListenerInternal::State::isInTextZone
bool isInTextZone() const
returns true if we are in a text zone, ie. either in a textbox or a table cell
Definition: MWAWGraphicListener.cxx:121
MWAWGraphicListenerInternal::State::m_isTableColumnOpened
bool m_isTableColumnOpened
Definition: MWAWGraphicListener.cxx:160
MWAWParser.hxx
MWAWGraphicListener::closeTable
void closeTable() final
closes this table
Definition: MWAWGraphicListener.cxx:1227
MWAWGraphicListenerInternal::State::m_paragraph
MWAWParagraph m_paragraph
the paragraph
Definition: MWAWGraphicListener.cxx:133
MWAWGraphicListener::insertChar
void insertChar(uint8_t character) final
adds a basic character, ..
Definition: MWAWGraphicListener.cxx:243
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
MWAWGraphicListener::m_parserState
MWAWParserState & m_parserState
the parser state
Definition: MWAWGraphicListener.hxx:298
MWAWGraphicShape::C_Rectangle
@ C_Rectangle
Definition: MWAWGraphicShape.hxx:51
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:60
MWAWGraphicListener::insertEOL
void insertEOL(bool softBreak=false) final
adds an end of line ( by default an hard one)
Definition: MWAWGraphicListener.cxx:334
MWAWGraphicListener::~MWAWGraphicListener
~MWAWGraphicListener() final
destructor
Definition: MWAWGraphicListener.cxx:236
MWAWGraphicListener::insertBreak
void insertBreak(BreakType breakType) final
inserts a break type: ColumBreak, PageBreak, ..
Definition: MWAWGraphicListener.cxx:962
MWAWGraphicListener::m_ds
std::shared_ptr< MWAWGraphicListenerInternal::GraphicState > m_ds
the actual global state
Definition: MWAWGraphicListener.hxx:292