This class contains the minimal code needed to write a Graphic sub document. More...
#include <MWAWGraphicListener.hxx>
Public Member Functions | |
MWAWGraphicListener (MWAWParserState &parserState) | |
constructor More... | |
virtual | ~MWAWGraphicListener () |
destructor More... | |
void | startGraphic (Box2f const &bdbox) |
starts a new graphic More... | |
bool | endGraphic (WPXBinaryData &data, std::string &mimeType) |
ends the actual graphic and fill the final WPXBinaryData, ... More... | |
bool | isDocumentStarted () const |
returns true if a document is opened More... | |
void | handleSubDocument (Vec2f const &orig, MWAWSubDocumentPtr subDocument, libmwaw::SubDocumentType subDocumentType) |
function called to add a subdocument More... | |
bool | isSubDocumentOpened (libmwaw::SubDocumentType &subdocType) const |
returns try if a subdocument is open More... | |
bool | canWriteText () const |
returns true if a text zone is opened More... | |
Box2f const & | getGraphicBdBox () |
returns the graphic bdbox. More... | |
void | insertChar (uint8_t character) |
adds a basic character, .. More... | |
void | insertCharacter (unsigned char c) |
insert a character using the font converter to find the utf8 character More... | |
int | insertCharacter (unsigned char c, MWAWInputStreamPtr &input, long endPos=-1) |
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) |
adds an unicode character. More... | |
void | insertUnicodeString (WPXString const &str) |
adds a unicode string More... | |
void | insertTab () |
adds a tab More... | |
void | insertEOL (bool softBreak=false) |
adds an end of line ( by default an hard one) More... | |
void | setFont (MWAWFont const &font) |
sets the font More... | |
MWAWFont const & | getFont () const |
returns the actual font More... | |
bool | isParagraphOpened () const |
returns true if a paragraph or a list is opened More... | |
void | setParagraph (MWAWParagraph const ¶graph) |
sets the paragraph More... | |
MWAWParagraph const & | getParagraph () const |
returns the actual paragraph More... | |
void | insertField (MWAWField const &field) |
adds a field type More... | |
void | insertPicture (Box2f const &bdbox, MWAWGraphicStyle const &style, const WPXBinaryData &binaryData, std::string type="image/pict") |
adds a picture in given position More... | |
void | insertPicture (Box2f const &bdbox, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style) |
adds a shape picture in given position More... | |
void | insertTextBox (Box2f const &bdbox, MWAWSubDocumentPtr subDocument, MWAWGraphicStyle const &style) |
adds a textbox in given position More... | |
void | insertGroup (Box2f const &bdbox, MWAWSubDocumentPtr subDocument) |
adds a group: ie. More... | |
bool | canOpenSectionAddBreak () const |
returns true if we can add open a section, add page break, ... More... | |
bool | isSectionOpened () const |
returns true if a section is opened More... | |
MWAWSection const & | getSection () const |
returns the actual section More... | |
bool | openSection (MWAWSection const §ion) |
open a section if possible More... | |
bool | closeSection () |
close a section More... | |
void | insertBreak (BreakType breakType) |
inserts a break type: ColumBreak, PageBreak, .. More... | |
![]() | |
virtual | ~MWAWListener () |
Protected Member Functions | |
void | _startSubDocument () |
void | _endSubDocument () |
void | _handleFrameParameters (WPXPropertyList &propList, Box2f const &pos, MWAWGraphicStyle const &style) |
bool | openFrame () |
void | closeFrame () |
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 () |
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 | |
shared_ptr < MWAWGraphicListenerInternal::GraphicState > | m_gs |
the actual global state More... | |
shared_ptr < MWAWGraphicListenerInternal::State > | m_ps |
the actual local parse state More... | |
std::vector< shared_ptr < MWAWGraphicListenerInternal::State > > | m_psStack |
stack of local state More... | |
MWAWParserState & | m_parserState |
the parser state More... | |
Private Member Functions | |
MWAWGraphicListener (const MWAWGraphicListener &) | |
MWAWGraphicListener & | operator= (const MWAWGraphicListener &) |
Additional Inherited Members | |
![]() | |
enum | BreakType { PageBreak =0, SoftPageBreak, ColumnBreak } |
the different break type More... | |
This class contains the minimal code needed to write a Graphic sub document.
MWAWGraphicListener::MWAWGraphicListener | ( | MWAWParserState & | parserState | ) |
constructor
|
virtual |
destructor
|
private |
|
protected |
update the list so that it corresponds to the actual level
Referenced by _endSubDocument(), _openSpan(), and endGraphic().
|
protected |
close a list level
Referenced by _closeParagraph().
|
protected |
Referenced by _changeList(), _endSubDocument(), endGraphic(), and insertEOL().
|
protected |
Referenced by _closeListElement(), _closeParagraph(), and setFont().
|
protected |
Referenced by 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 |
|
protected |
open a list level
Referenced by _openSpan().
|
protected |
Referenced by _openSpan().
|
protected |
Referenced by insertChar(), insertEOL(), insertField(), insertTab(), insertUnicode(), and insertUnicodeString().
|
protected |
resets the previous parsing state
Referenced by handleSubDocument().
|
protected |
creates a new parsing state (copy of the actual state)
Referenced by handleSubDocument().
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
Referenced by handleSubDocument().
|
inlinevirtual |
returns true if we can add open a section, add page break, ...
Implements MWAWListener.
|
virtual |
returns true if a text zone is opened
Implements MWAWListener.
|
protected |
|
inlinevirtual |
close a section
Implements MWAWListener.
bool MWAWGraphicListener::endGraphic | ( | WPXBinaryData & | data, |
std::string & | mimeType | ||
) |
ends the actual graphic and fill the final WPXBinaryData, ...
|
virtual |
returns the actual font
Implements MWAWListener.
Box2f const & MWAWGraphicListener::getGraphicBdBox | ( | ) |
returns the graphic bdbox.
|
virtual |
returns the actual paragraph
Implements MWAWListener.
|
virtual |
returns the actual section
Implements MWAWListener.
void MWAWGraphicListener::handleSubDocument | ( | Vec2f const & | orig, |
MWAWSubDocumentPtr | subDocument, | ||
libmwaw::SubDocumentType | subDocumentType | ||
) |
function called to add a subdocument
Referenced by insertGroup().
|
virtual |
inserts a break type: ColumBreak, PageBreak, ..
Implements MWAWListener.
|
virtual |
|
virtual |
insert a character using the font converter to find the utf8 character
Implements MWAWListener.
|
virtual |
insert a character using the font converter to find the utf8 character and if needed, input to read extra character.
Implements MWAWListener.
|
virtual |
adds an end of line ( by default an hard one)
Implements MWAWListener.
|
virtual |
adds a field type
Implements MWAWListener.
void MWAWGraphicListener::insertGroup | ( | Box2f const & | bdbox, |
MWAWSubDocumentPtr | subDocument | ||
) |
adds a group: ie.
next insertion will be done relative to this bdbox[0] position
Referenced by CWGraph::sendGroup().
void MWAWGraphicListener::insertPicture | ( | Box2f const & | bdbox, |
MWAWGraphicStyle const & | style, | ||
const WPXBinaryData & | binaryData, | ||
std::string | type = "image/pict" |
||
) |
adds a picture in given position
Referenced by CWGraph::sendGroup().
void MWAWGraphicListener::insertPicture | ( | Box2f const & | bdbox, |
MWAWGraphicShape const & | shape, | ||
MWAWGraphicStyle const & | style | ||
) |
adds a shape picture in given position
|
virtual |
adds a tab
Implements MWAWListener.
void MWAWGraphicListener::insertTextBox | ( | Box2f const & | bdbox, |
MWAWSubDocumentPtr | subDocument, | ||
MWAWGraphicStyle const & | style | ||
) |
adds a textbox in given position
Referenced by CWGraph::sendGroup().
|
virtual |
adds an unicode character.
By convention if character=0xfffd(undef), no character is added
Implements MWAWListener.
Referenced by insertChar(), and insertCharacter().
|
virtual |
|
virtual |
returns true if a document is opened
Implements MWAWListener.
|
virtual |
returns true if a paragraph or a list is opened
Implements MWAWListener.
|
inlinevirtual |
returns true if a section is opened
Implements MWAWListener.
|
virtual |
returns try if a subdocument is open
Implements MWAWListener.
|
protected |
|
virtual |
open a section if possible
Implements MWAWListener.
|
private |
|
virtual |
sets the font
Implements MWAWListener.
|
virtual |
sets the paragraph
Implements MWAWListener.
void MWAWGraphicListener::startGraphic | ( | Box2f const & | bdbox | ) |
starts a new graphic
|
protected |
the actual global state
Referenced by _changeList(), _closeListElement(), _closeParagraph(), _closeSpan(), _flushText(), _handleFrameParameters(), _openListElement(), _openParagraph(), _openSpan(), endGraphic(), getGraphicBdBox(), handleSubDocument(), insertEOL(), insertField(), insertTab(), and startGraphic().
|
protected |
the parser state
Referenced by _changeList(), _getListId(), _openSpan(), and insertCharacter().
|
protected |
the actual local parse state
Referenced by _changeList(), _closeListElement(), _closeParagraph(), _closeSpan(), _endSubDocument(), _flushText(), _getListId(), _handleFrameParameters(), _openListElement(), _openParagraph(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), canWriteText(), closeFrame(), endGraphic(), getFont(), getParagraph(), handleSubDocument(), insertChar(), insertCharacter(), insertEOL(), insertField(), insertGroup(), insertTab(), insertUnicode(), insertUnicodeString(), isDocumentStarted(), isParagraphOpened(), isSubDocumentOpened(), openFrame(), setFont(), setParagraph(), and startGraphic().
|
protected |
stack of local state
Referenced by _popParsingState(), and _pushParsingState().