This class contains the code needed to create Graphic document. More...
#include <MWAWGraphicListener.hxx>
 
  
| Public Member Functions | |
| MWAWGraphicListener (MWAWParserState &parserState, std::vector< MWAWPageSpan > const &pageList, librevenge::RVNGDrawingInterface *documentInterface) | |
| constructor  More... | |
| MWAWGraphicListener (MWAWParserState &parserState, MWAWBox2f const &box, librevenge::RVNGDrawingInterface *documentInterface) | |
| simplified constructor (can be used for a embedded graphic with one page).  More... | |
| ~MWAWGraphicListener () final | |
| destructor  More... | |
| Type | getType () const final | 
| returns the listener type  More... | |
| void | setDocumentMetaData (librevenge::RVNGPropertyList const &metadata) final | 
| sets the documents metadata  More... | |
| void | setDocumentLanguage (std::string const &locale) final | 
| sets the documents language  More... | |
| void | startDocument () final | 
| starts a new document  More... | |
| void | endDocument (bool delayed=true) final | 
| ends the actual document  More... | |
| bool | canWriteText () const final | 
| returns true if a text zone is opened  More... | |
| bool | isDocumentStarted () const final | 
| returns true if a document is opened  More... | |
| void | handleSubDocument (MWAWVec2f const &orig, MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType) | 
| function called to add a subdocument and modify the origin  More... | |
| void | handleSubDocument (MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType) final | 
| function called to add a subdocument  More... | |
| bool | isSubDocumentOpened (libmwaw::SubDocumentType &subdocType) const final | 
| returns try if a subdocument is open  More... | |
| 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 openTable)  More... | |
| void | closeFrame () final | 
| close a frame  More... | |
| bool | openGroup (MWAWPosition const &pos) final | 
| open a group  More... | |
| void | closeGroup () final | 
| close a group  More... | |
| bool | openLayer (librevenge::RVNGString const &name) | 
| open a layer  More... | |
| void | closeLayer () | 
| close a layer  More... | |
| bool | openMasterPage (MWAWPageSpan &masterPage) | 
| opens a master page  More... | |
| void | closeMasterPage () | 
| close a master page  More... | |
| bool | isPageSpanOpened () const final | 
| returns true if a page is opened  More... | |
| MWAWPageSpan const & | getPageSpan () final | 
| returns the current page span  More... | |
| bool | insertHeader (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final | 
| insert a header  More... | |
| bool | insertFooter (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final | 
| insert a footer  More... | |
| bool | isHeaderFooterOpened () const final | 
| returns true if the header/footer is open  More... | |
| void | insertChar (uint8_t character) final | 
| adds a basic character, ..  More... | |
| void | insertCharacter (unsigned char c) final | 
| insert a character using the font converter to find the utf8 character  More... | |
| int | insertCharacter (unsigned char c, MWAWInputStreamPtr &input, long endPos=-1) final | 
| insert a character using the font converter to find the utf8 character and if needed, input to read extra character.  More... | |
| void | insertUnicode (uint32_t character) final | 
| adds an unicode character.  More... | |
| void | insertUnicodeString (librevenge::RVNGString const &str) final | 
| adds a unicode string  More... | |
| void | insertTab () final | 
| adds a tab  More... | |
| void | insertEOL (bool softBreak=false) final | 
| adds an end of line ( by default an hard one)  More... | |
| void | setFont (MWAWFont const &font) final | 
| sets the font  More... | |
| MWAWFont const & | getFont () const final | 
| returns the actual font  More... | |
| bool | isParagraphOpened () const final | 
| returns true if a paragraph or a list is opened  More... | |
| void | setParagraph (MWAWParagraph const ¶graph) final | 
| sets the paragraph  More... | |
| MWAWParagraph const & | getParagraph () const final | 
| returns the actual paragraph  More... | |
| void | insertField (MWAWField const &field) final | 
| adds a field type  More... | |
| void | openLink (MWAWLink const &link) final | 
| open a link  More... | |
| void | closeLink () final | 
| close a link  More... | |
| void | insertPicture (MWAWPosition const &pos, MWAWEmbeddedObject const &picture, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final | 
| adds a picture with potential various representationin given position  More... | |
| void | insertShape (MWAWPosition const &pos, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style) final | 
| adds a shape picture in given position  More... | |
| void | insertTextBox (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicStyle const &style) final | 
| adds a textbox in given position  More... | |
| void | insertGroup (MWAWBox2f const &bdbox, MWAWSubDocumentPtr const &subDocument) | 
| adds a group: ie.  More... | |
| void | insertNote (MWAWNote const ¬e, MWAWSubDocumentPtr &subDocument) final | 
| insert a note  More... | |
| void | insertComment (MWAWSubDocumentPtr &subDocument) final | 
| adds comment  More... | |
| void | insertTable (MWAWPosition const &pos, MWAWTable &table, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) | 
| adds a table in given position  More... | |
| void | openTable (MWAWTable const &table) final | 
| open a table (using the last parameters of openFrame for the position )  More... | |
| void | openTable (MWAWPosition const &pos, MWAWTable const &table, MWAWGraphicStyle const &style) | 
| open a table in a given position  More... | |
| void | closeTable () final | 
| closes this table  More... | |
| 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 )  More... | |
| void | closeTableRow () final | 
| closes this row  More... | |
| void | openTableCell (MWAWCell const &cell) final | 
| open a cell  More... | |
| void | closeTableCell () final | 
| close a cell  More... | |
| void | addEmptyTableCell (MWAWVec2i const &pos, MWAWVec2i span=MWAWVec2i(1, 1)) final | 
| add empty cell  More... | |
| bool | canOpenSectionAddBreak () const final | 
| returns true if we can add open a section, add page break, ...  More... | |
| bool | isSectionOpened () const final | 
| returns true if a section is opened  More... | |
| MWAWSection const & | getSection () const final | 
| returns the actual section  More... | |
| bool | openSection (MWAWSection const §ion) final | 
| open a section if possible  More... | |
| bool | closeSection () final | 
| close a section  More... | |
| void | insertBreak (BreakType breakType) final | 
| inserts a break type: ColumBreak, PageBreak, ..  More... | |
|  Public Member Functions inherited from MWAWListener | |
| virtual | ~MWAWListener () | 
| destructor  More... | |
| virtual void | insertTextBoxInShape (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicShape const &, MWAWGraphicStyle const &frameStyle=MWAWGraphicStyle::emptyStyle()) | 
| adds a textbox in given position  More... | |
| Protected Member Functions | |
| void | _openPageSpan (bool sendHeaderFooters=true) | 
| does open a new page (low level)  More... | |
| void | _closePageSpan (bool masterPage=false) | 
| does close a page (low level)  More... | |
| void | _startSubDocument () | 
| void | _endSubDocument () | 
| void | _handleFrameParameters (librevenge::RVNGPropertyList &propList, MWAWPosition const &pos, MWAWGraphicStyle const &style) | 
| adds in propList the frame parameters.  More... | |
| void | _openParagraph () | 
| void | _closeParagraph () | 
| void | _resetParagraphState (const bool isListElement=false) | 
| void | _openListElement () | 
| open a list level  More... | |
| void | _closeListElement () | 
| close a list level  More... | |
| void | _changeList () | 
| update the list so that it corresponds to the actual level  More... | |
| int | _getListId () const | 
| low level: find a list id which corresponds to actual list and a change of level.  More... | |
| void | _openSpan () | 
| void | _closeSpan () | 
| void | _flushText () | 
| std::shared_ptr< MWAWGraphicListenerInternal::State > | _pushParsingState () | 
| creates a new parsing state (copy of the actual state)  More... | |
| void | _popParsingState () | 
| resets the previous parsing state  More... | |
| Protected Attributes | |
| std::shared_ptr< MWAWGraphicListenerInternal::GraphicState > | m_ds | 
| the actual global state  More... | |
| std::shared_ptr< MWAWGraphicListenerInternal::State > | m_ps | 
| the actual local parse state  More... | |
| std::vector< std::shared_ptr< MWAWGraphicListenerInternal::State > > | m_psStack | 
| stack of local state  More... | |
| MWAWParserState & | m_parserState | 
| the parser state  More... | |
| librevenge::RVNGDrawingInterface * | m_documentInterface | 
| the document interface  More... | |
| Private Member Functions | |
| MWAWGraphicListener (const MWAWGraphicListener &)=delete | |
| MWAWGraphicListener & | operator= (const MWAWGraphicListener &)=delete | 
| Additional Inherited Members | |
|  Public Types inherited from MWAWListener | |
| enum | Type { Graphic, Presentation, Spreadsheet, Text } | 
| the listener type  More... | |
| enum | BreakType { PageBreak =0, SoftPageBreak, ColumnBreak } | 
| the different break type  More... | |
This class contains the code needed to create Graphic document.
| MWAWGraphicListener::MWAWGraphicListener | ( | MWAWParserState & | parserState, | 
| std::vector< MWAWPageSpan > const & | pageList, | ||
| librevenge::RVNGDrawingInterface * | documentInterface | ||
| ) | 
constructor
| MWAWGraphicListener::MWAWGraphicListener | ( | MWAWParserState & | parserState, | 
| MWAWBox2f const & | box, | ||
| librevenge::RVNGDrawingInterface * | documentInterface | ||
| ) | 
simplified constructor (can be used for a embedded graphic with one page).
| 
 | final | 
destructor
| 
 | privatedelete | 
| 
 | protected | 
update the list so that it corresponds to the actual level
Referenced by _closePageSpan(), _endSubDocument(), _openSpan(), and closeTableCell().
| 
 | protected | 
close a list level
Referenced by _closeParagraph().
| 
 | protected | 
does close a page (low level)
Referenced by closeMasterPage(), endDocument(), insertBreak(), and openMasterPage().
| 
 | protected | 
Referenced by _changeList(), _closePageSpan(), _endSubDocument(), closeTableCell(), insertEOL(), and openTable().
| 
 | protected | 
Referenced by _closeListElement(), _closeParagraph(), and setFont().
| 
 | protected | 
Referenced by _closePageSpan(), closeGroup(), closeLayer(), closeTable(), and handleSubDocument().
| 
 | protected | 
Referenced by _closeSpan(), insertEOL(), insertField(), and insertTab().
| 
 | protected | 
low level: find a list id which corresponds to actual list and a change of level.
Referenced by _changeList().
| 
 | protected | 
adds in propList the frame parameters.
Referenced by insertFooter(), insertHeader(), insertPicture(), openGroup(), and openTable().
| 
 | protected | 
open a list level
Referenced by _openSpan().
| 
 | protected | 
does open a new page (low level)
Referenced by endDocument(), getPageSpan(), handleSubDocument(), insertBreak(), insertGroup(), insertPicture(), openFrame(), openGroup(), and openLayer().
| 
 | protected | 
Referenced by _openSpan(), insertComment(), and insertNote().
| 
 | protected | 
Referenced by insertChar(), insertEOL(), insertField(), insertTab(), insertUnicode(), insertUnicodeString(), and openLink().
| 
 | protected | 
resets the previous parsing state
Referenced by _closePageSpan(), closeGroup(), closeLayer(), closeLink(), closeTable(), and handleSubDocument().
| 
 | protected | 
creates a new parsing state (copy of the actual state)
Referenced by handleSubDocument(), openGroup(), openLayer(), openLink(), and openTable().
| 
 | protected | 
Referenced by _openListElement(), and _openParagraph().
| 
 | protected | 
Referenced by handleSubDocument(), openGroup(), openLayer(), and openTable().
| 
 | finalvirtual | 
add empty cell
Implements MWAWListener.
| 
 | inlinefinalvirtual | 
returns true if we can add open a section, add page break, ...
Implements MWAWListener.
| 
 | finalvirtual | 
returns true if a text zone is opened
Implements MWAWListener.
Referenced by insertComment(), and insertNote().
| 
 | finalvirtual | 
| 
 | finalvirtual | 
close a group
Implements MWAWListener.
| void MWAWGraphicListener::closeLayer | ( | ) | 
close a layer
| 
 | finalvirtual | 
close a link
Implements MWAWListener.
| 
 | inline | 
close a master page
| 
 | inlinefinalvirtual | 
close a section
Implements MWAWListener.
| 
 | finalvirtual | 
| 
 | finalvirtual | 
| 
 | finalvirtual | 
closes this row
Implements MWAWListener.
| 
 | finalvirtual | 
ends the actual document
Implements MWAWListener.
Referenced by MWAWTextListener::insertShape(), MsWksGraph::send(), HanMacWrdKGraph::sendEmptyPicture(), HanMacWrdJGraph::sendEmptyPicture(), HanMacWrdKGraph::sendFrame(), HanMacWrdJGraph::sendFrame(), ClarisWksGraph::sendGroupChild(), and MarinerWrtGraph::sendRule().
| 
 | finalvirtual | 
returns the actual font
Implements MWAWListener.
| 
 | finalvirtual | 
returns the current page span
Implements MWAWListener.
Referenced by insertFooter().
| 
 | finalvirtual | 
returns the actual paragraph
Implements MWAWListener.
| 
 | finalvirtual | 
returns the actual section
Implements MWAWListener.
| 
 | inlinefinalvirtual | 
returns the listener type
Implements MWAWListener.
| void MWAWGraphicListener::handleSubDocument | ( | MWAWVec2f const & | orig, | 
| MWAWSubDocumentPtr const & | subDocument, | ||
| libmwaw::SubDocumentType | subDocumentType | ||
| ) | 
function called to add a subdocument and modify the origin
Referenced by handleSubDocument(), insertComment(), insertFooter(), insertGroup(), insertHeader(), and insertNote().
| 
 | inlinefinalvirtual | 
function called to add a subdocument
Implements MWAWListener.
| 
 | finalvirtual | 
inserts a break type: ColumBreak, PageBreak, ..
Implements MWAWListener.
| 
 | finalvirtual | 
adds a basic character, ..
Implements MWAWListener.
Referenced by insertCharacter(), insertComment(), and insertNote().
| 
 | finalvirtual | 
insert a character using the font converter to find the utf8 character
Implements MWAWListener.
| 
 | finalvirtual | 
insert a character using the font converter to find the utf8 character and if needed, input to read extra character.
Implements MWAWListener.
| 
 | finalvirtual | 
adds comment
Implements MWAWListener.
| 
 | finalvirtual | 
adds an end of line ( by default an hard one)
Implements MWAWListener.
| 
 | finalvirtual | 
adds a field type
Implements MWAWListener.
| 
 | finalvirtual | 
insert a footer
Implements MWAWListener.
| void MWAWGraphicListener::insertGroup | ( | MWAWBox2f const & | bdbox, | 
| MWAWSubDocumentPtr const & | subDocument | ||
| ) | 
adds a group: ie.
next insertion will be done relative to this bdbox[0] position
| 
 | finalvirtual | 
insert a header
Implements MWAWListener.
| 
 | finalvirtual | 
insert a note
Implements MWAWListener.
| 
 | finalvirtual | 
adds a picture with potential various representationin given position
Implements MWAWListener.
| 
 | finalvirtual | 
adds a shape picture in given position
Implements MWAWListener.
Referenced by MWAWTextListener::insertShape(), HanMacWrdKGraph::sendEmptyPicture(), HanMacWrdJGraph::sendEmptyPicture(), and MarinerWrtGraph::sendRule().
| 
 | finalvirtual | 
adds a tab
Implements MWAWListener.
| void MWAWGraphicListener::insertTable | ( | MWAWPosition const & | pos, | 
| MWAWTable & | table, | ||
| MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() | ||
| ) | 
adds a table in given position
| 
 | finalvirtual | 
adds a textbox in given position
Implements MWAWListener.
Referenced by MsWksGraph::send(), HanMacWrdJGraph::sendFrame(), HanMacWrdKGraph::sendFrame(), and ClarisWksGraph::sendGroupChild().
| 
 | finalvirtual | 
adds an unicode character.
By convention if character=0xfffd(undef), no character is added
Implements MWAWListener.
Referenced by insertChar(), insertCharacter(), insertComment(), and insertNote().
| 
 | finalvirtual | 
| 
 | finalvirtual | 
returns true if a document is opened
Implements MWAWListener.
| 
 | finalvirtual | 
returns true if the header/footer is open
Implements MWAWListener.
| 
 | finalvirtual | 
returns true if a page is opened
Implements MWAWListener.
| 
 | finalvirtual | 
returns true if a paragraph or a list is opened
Implements MWAWListener.
| 
 | inlinefinalvirtual | 
returns true if a section is opened
Implements MWAWListener.
| 
 | finalvirtual | 
returns try if a subdocument is open
Implements MWAWListener.
| 
 | finalvirtual | 
store the position and the style (which will be needed further to insert a textbox or a table with openTable)
Implements MWAWListener.
Referenced by insertFooter(), and insertHeader().
| 
 | finalvirtual | 
open a group
Implements MWAWListener.
| bool MWAWGraphicListener::openLayer | ( | librevenge::RVNGString const & | name | ) | 
open a layer
| 
 | finalvirtual | 
open a link
Implements MWAWListener.
| bool MWAWGraphicListener::openMasterPage | ( | MWAWPageSpan & | masterPage | ) | 
opens a master page
| 
 | finalvirtual | 
open a section if possible
Implements MWAWListener.
| 
 | finalvirtual | 
open a table (using the last parameters of openFrame for the position )
Implements MWAWListener.
| void MWAWGraphicListener::openTable | ( | MWAWPosition const & | pos, | 
| MWAWTable const & | table, | ||
| MWAWGraphicStyle const & | style | ||
| ) | 
open a table in a given position
| 
 | finalvirtual | 
open a cell
Implements MWAWListener.
| 
 | finalvirtual | 
open a row with given height ( if h < 0.0, set min-row-height = -h )
Implements MWAWListener.
| 
 | privatedelete | 
| 
 | finalvirtual | 
sets the documents language
Implements MWAWListener.
| 
 | finalvirtual | 
sets the documents metadata
Implements MWAWListener.
| 
 | finalvirtual | 
sets the font
Implements MWAWListener.
| 
 | finalvirtual | 
sets the paragraph
Implements MWAWListener.
| 
 | finalvirtual | 
starts a new document
Implements MWAWListener.
Referenced by _openPageSpan(), MWAWTextListener::insertShape(), openMasterPage(), MsWksGraph::send(), HanMacWrdKGraph::sendEmptyPicture(), HanMacWrdJGraph::sendEmptyPicture(), HanMacWrdKGraph::sendFrame(), HanMacWrdJGraph::sendFrame(), ClarisWksGraph::sendGroupChild(), and MarinerWrtGraph::sendRule().
| 
 | protected | 
the document interface
Referenced by _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSpan(), _flushText(), _handleFrameParameters(), _openListElement(), _openPageSpan(), _openParagraph(), _openSpan(), addEmptyTableCell(), closeGroup(), closeLayer(), closeLink(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), insertEOL(), insertField(), insertFooter(), insertHeader(), insertPicture(), insertTab(), openGroup(), openLayer(), openLink(), openMasterPage(), openTable(), openTableCell(), openTableRow(), and startDocument().
| 
 | protected | 
the actual global state
Referenced by _changeList(), _closePageSpan(), _endSubDocument(), _handleFrameParameters(), _openPageSpan(), _startSubDocument(), canWriteText(), endDocument(), getPageSpan(), getSection(), handleSubDocument(), insertBreak(), insertFooter(), insertGroup(), insertHeader(), insertPicture(), isDocumentStarted(), isHeaderFooterOpened(), isPageSpanOpened(), isSubDocumentOpened(), MWAWGraphicListener(), openFrame(), openGroup(), openLayer(), openMasterPage(), setDocumentLanguage(), setDocumentMetaData(), and startDocument().
| 
 | protected | 
the parser state
Referenced by _changeList(), _getListId(), _openSpan(), insertCharacter(), and openTableCell().
| 
 | protected | 
the actual local parse state
Referenced by _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSpan(), _endSubDocument(), _flushText(), _getListId(), _handleFrameParameters(), _openListElement(), _openPageSpan(), _openParagraph(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), addEmptyTableCell(), canWriteText(), closeFrame(), closeGroup(), closeLayer(), closeLink(), closeTable(), closeTableCell(), closeTableRow(), getFont(), getParagraph(), handleSubDocument(), insertBreak(), insertChar(), insertCharacter(), insertComment(), insertEOL(), insertField(), insertGroup(), insertNote(), insertPicture(), insertTab(), insertUnicode(), insertUnicodeString(), isParagraphOpened(), isSubDocumentOpened(), MWAWGraphicListener(), openFrame(), openGroup(), openLayer(), openLink(), openTable(), openTableCell(), openTableRow(), setFont(), and setParagraph().
| 
 | protected | 
stack of local state
Referenced by _popParsingState(), and _pushParsingState().