MWAWGraphicListener Class Reference

This class contains the minimal code needed to write a Graphic sub document. More...

#include <MWAWGraphicListener.hxx>

Inheritance diagram for MWAWGraphicListener:
MWAWListener

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 &paragraph)
 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 &section)
 open a section if possible More...
 
bool closeSection ()
 close a section More...
 
void insertBreak (BreakType breakType)
 inserts a break type: ColumBreak, PageBreak, .. More...
 
- Public Member Functions inherited from MWAWListener
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...
 
MWAWParserStatem_parserState
 the parser state More...
 

Private Member Functions

 MWAWGraphicListener (const MWAWGraphicListener &)
 
MWAWGraphicListeneroperator= (const MWAWGraphicListener &)
 

Additional Inherited Members

- Public Types inherited from MWAWListener
enum  BreakType { PageBreak =0, SoftPageBreak, ColumnBreak }
 the different break type More...
 

Detailed Description

This class contains the minimal code needed to write a Graphic sub document.

Note
it will be probably be enhanced in some near/far futur... All units are specicified in WPX_POINT

Constructor & Destructor Documentation

MWAWGraphicListener::MWAWGraphicListener ( MWAWParserState parserState)

constructor

MWAWGraphicListener::~MWAWGraphicListener ( )
virtual

destructor

MWAWGraphicListener::MWAWGraphicListener ( const MWAWGraphicListener )
private

Member Function Documentation

void MWAWGraphicListener::_changeList ( )
protected

update the list so that it corresponds to the actual level

Referenced by _endSubDocument(), _openSpan(), and endGraphic().

void MWAWGraphicListener::_closeListElement ( )
protected

close a list level

Referenced by _closeParagraph().

void MWAWGraphicListener::_closeParagraph ( )
protected
void MWAWGraphicListener::_closeSpan ( )
protected
void MWAWGraphicListener::_endSubDocument ( )
protected

Referenced by handleSubDocument().

void MWAWGraphicListener::_flushText ( )
protected
int MWAWGraphicListener::_getListId ( ) const
protected

low level: find a list id which corresponds to actual list and a change of level.

Note
called when the list id is not set

Referenced by _changeList().

void MWAWGraphicListener::_handleFrameParameters ( WPXPropertyList &  propList,
Box2f const &  pos,
MWAWGraphicStyle const &  style 
)
protected
void MWAWGraphicListener::_openListElement ( )
protected

open a list level

Referenced by _openSpan().

void MWAWGraphicListener::_openParagraph ( )
protected

Referenced by _openSpan().

void MWAWGraphicListener::_openSpan ( )
protected
void MWAWGraphicListener::_popParsingState ( )
protected

resets the previous parsing state

Referenced by handleSubDocument().

shared_ptr< MWAWGraphicListenerInternal::State > MWAWGraphicListener::_pushParsingState ( )
protected

creates a new parsing state (copy of the actual state)

Returns
the old one

Referenced by handleSubDocument().

void MWAWGraphicListener::_resetParagraphState ( const bool  isListElement = false)
protected

Referenced by _openListElement(), and _openParagraph().

void MWAWGraphicListener::_startSubDocument ( )
protected

Referenced by handleSubDocument().

bool MWAWGraphicListener::canOpenSectionAddBreak ( ) const
inlinevirtual

returns true if we can add open a section, add page break, ...

Implements MWAWListener.

bool MWAWGraphicListener::canWriteText ( ) const
virtual

returns true if a text zone is opened

Implements MWAWListener.

void MWAWGraphicListener::closeFrame ( )
protected
bool MWAWGraphicListener::closeSection ( )
inlinevirtual

close a section

Implements MWAWListener.

bool MWAWGraphicListener::endGraphic ( WPXBinaryData &  data,
std::string &  mimeType 
)

ends the actual graphic and fill the final WPXBinaryData, ...

MWAWFont const & MWAWGraphicListener::getFont ( ) const
virtual

returns the actual font

Implements MWAWListener.

Box2f const & MWAWGraphicListener::getGraphicBdBox ( )

returns the graphic bdbox.

MWAWParagraph const & MWAWGraphicListener::getParagraph ( ) const
virtual

returns the actual paragraph

Implements MWAWListener.

MWAWSection const & MWAWGraphicListener::getSection ( ) const
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().

void MWAWGraphicListener::insertBreak ( BreakType  breakType)
virtual

inserts a break type: ColumBreak, PageBreak, ..

Implements MWAWListener.

void MWAWGraphicListener::insertChar ( uint8_t  character)
virtual

adds a basic character, ..

Implements MWAWListener.

Referenced by insertCharacter().

void MWAWGraphicListener::insertCharacter ( unsigned char  c)
virtual

insert a character using the font converter to find the utf8 character

Implements MWAWListener.

int MWAWGraphicListener::insertCharacter ( unsigned char  c,
MWAWInputStreamPtr input,
long  endPos = -1 
)
virtual

insert a character using the font converter to find the utf8 character and if needed, input to read extra character.

Returns
the number of extra character read

Implements MWAWListener.

void MWAWGraphicListener::insertEOL ( bool  softBreak = false)
virtual

adds an end of line ( by default an hard one)

Implements MWAWListener.

void MWAWGraphicListener::insertField ( MWAWField const &  field)
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

void MWAWGraphicListener::insertTab ( )
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().

void MWAWGraphicListener::insertUnicode ( uint32_t  character)
virtual

adds an unicode character.

By convention if character=0xfffd(undef), no character is added

Implements MWAWListener.

Referenced by insertChar(), and insertCharacter().

void MWAWGraphicListener::insertUnicodeString ( WPXString const &  str)
virtual

adds a unicode string

Implements MWAWListener.

Referenced by insertField().

bool MWAWGraphicListener::isDocumentStarted ( ) const
virtual

returns true if a document is opened

Implements MWAWListener.

bool MWAWGraphicListener::isParagraphOpened ( ) const
virtual

returns true if a paragraph or a list is opened

Implements MWAWListener.

bool MWAWGraphicListener::isSectionOpened ( ) const
inlinevirtual

returns true if a section is opened

Implements MWAWListener.

bool MWAWGraphicListener::isSubDocumentOpened ( libmwaw::SubDocumentType subdocType) const
virtual

returns try if a subdocument is open

Implements MWAWListener.

bool MWAWGraphicListener::openFrame ( )
protected
bool MWAWGraphicListener::openSection ( MWAWSection const &  section)
virtual

open a section if possible

Implements MWAWListener.

MWAWGraphicListener& MWAWGraphicListener::operator= ( const MWAWGraphicListener )
private
void MWAWGraphicListener::setFont ( MWAWFont const &  font)
virtual

sets the font

Implements MWAWListener.

void MWAWGraphicListener::setParagraph ( MWAWParagraph const &  paragraph)
virtual

sets the paragraph

Implements MWAWListener.

void MWAWGraphicListener::startGraphic ( Box2f const &  bdbox)

starts a new graphic

Member Data Documentation

MWAWParserState& MWAWGraphicListener::m_parserState
protected

the parser state

Referenced by _changeList(), _getListId(), _openSpan(), and insertCharacter().

std::vector<shared_ptr<MWAWGraphicListenerInternal::State> > MWAWGraphicListener::m_psStack
protected

stack of local state

Referenced by _popParsingState(), and _pushParsingState().


The documentation for this class was generated from the following files:

Generated on Tue Mar 10 2015 17:32:10 for libmwaw by doxygen 1.8.5