MWAWListener Class Reference documentation

Public Types | Public Member Functions | List of all members
MWAWListener Class Referenceabstract

This class contains a virtual interface to all listener. More...

`#include <MWAWListener.hxx>`

Inheritance diagram for MWAWListener:

## Public Types
enum | Type { Graphic, Presentation, Spreadsheet, Text }
| the listener type More...
enum | BreakType { PageBreak =0, SoftPageBreak, ColumnBreak }
| the different break type More...

## Public Member Functions
virtual | ~MWAWListener ()
| destructor More...
virtual Type | getType () const =0
| returns the listener type More...
virtual bool | canWriteText () const =0
| returns true if we can add text data More...
virtual void | setDocumentMetaData (librevenge::RVNGPropertyList const &metadata)=0
| sets the documents metadata More...
virtual void | setDocumentLanguage (std::string const &locale)=0
| sets the documents language More...
virtual void | startDocument ()=0
| starts the document More...
virtual bool | isDocumentStarted () const =0
| returns true if a document is opened More...
virtual void | endDocument (bool sendDelayedSubDoc=true)=0
| ends the document More...
virtual bool | isPageSpanOpened () const =0
| returns true if a page is opened More...
virtual const MWAWPageSpan & | getPageSpan ()=0
| returns the current page span More...
virtual bool | insertHeader (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras)=0
| insert a header (interaction with MWAWPageSpan which fills the parameters for openHeader) More...
virtual bool | insertFooter (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras)=0
| insert a footer (interaction with MWAWPageSpan which fills the parameters for openFooter) More...
virtual bool | isHeaderFooterOpened () const =0
| returns true if the header/footer is open More...
virtual void | insertChar (uint8_t character)=0
| adds a basic character, .. More...
virtual void | insertCharacter (unsigned char c)=0
| insert a character using the font converter to find the utf8 character More...
virtual int | insertCharacter (unsigned char c, MWAWInputStreamPtr &input, long endPos=-1)=0
| insert a character using the font converter to find the utf8 character and if needed, input to read extra character. More...
virtual void | insertUnicode (uint32_t character)=0
| adds an unicode character. More...
virtual void | insertUnicodeString (librevenge::RVNGString const &str)=0
| adds a unicode string More...
virtual void | insertTab ()=0
| adds a tab More...
virtual void | insertEOL (bool softBreak=false)=0
| adds an end of line ( by default an hard one) More...
virtual void | setFont (MWAWFont const &font)=0
| sets the font More...
virtual const MWAWFont & | getFont () const =0
| returns the actual font More...
virtual bool | isParagraphOpened () const =0
| returns true if a paragraph or a list is opened More...
virtual void | setParagraph (MWAWParagraph const &paragraph)=0
| sets the paragraph More...
virtual const MWAWParagraph & | getParagraph () const =0
| returns the actual paragraph More...
virtual void | insertField (MWAWField const &field)=0
| adds a field type More...
virtual void | openLink (MWAWLink const &link)=0
| open a link More...
virtual void | closeLink ()=0
| close a link More...
virtual void | openTable (MWAWTable const &table)=0
| open a table More...
virtual void | closeTable ()=0
| closes this table More...
virtual void | openTableRow (float h, librevenge::RVNGUnit unit, bool headerRow=false)=0
| open a row with given height ( if h < 0.0, set min-row-height = -h ) More...
virtual void | closeTableRow ()=0
| closes this row More...
virtual void | openTableCell (MWAWCell const &cell)=0
| open a cell More...
virtual void | closeTableCell ()=0
| close a cell More...
virtual void | addEmptyTableCell (MWAWVec2i const &pos, MWAWVec2i span=MWAWVec2i(1, 1))=0
| add empty cell More...
virtual bool | canOpenSectionAddBreak () const =0
| returns true if we can add open a section, add page break, ... More...
virtual bool | isSectionOpened () const =0
| returns true if a section is opened More...
virtual const MWAWSection & | getSection () const =0
| returns the actual section More...
virtual bool | openSection (MWAWSection const &section)=0
| open a section if possible More...
virtual bool | closeSection ()=0
| close a section More...
virtual void | insertBreak (BreakType breakType)=0
| inserts a break type: ColumBreak, PageBreak, .. More...
virtual void | insertNote (MWAWNote const &note, MWAWSubDocumentPtr &subDocument)=0
| insert a note More...
virtual void | insertComment (MWAWSubDocumentPtr &subDocument)=0
| adds comment More...
virtual void | insertPicture (MWAWPosition const &pos, MWAWEmbeddedObject const &picture, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())=0
| adds a picture with various representationin given position. More...
virtual void | insertShape (MWAWPosition const &pos, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style)=0
| adds a shape picture in given position More...
virtual void | insertTextBox (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicStyle const &frameStyle=MWAWGraphicStyle::emptyStyle())=0
| adds a textbox in given position More...
virtual void | insertTextBoxInShape (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicShape const &, MWAWGraphicStyle const &frameStyle=MWAWGraphicStyle::emptyStyle())
| adds a textbox in given position More...
virtual bool | openFrame (MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())=0
| low level: tries to open a frame More...
virtual void | closeFrame ()=0
| low level: tries to close the last opened frame More...
virtual bool | openGroup (MWAWPosition const &pos)=0
| low level: tries to open a group More...
virtual void | closeGroup ()=0
| low level: tries to close the last opened group More...
virtual void | handleSubDocument (MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType)=0
| low level: function called to add a subdocument More...
virtual bool | isSubDocumentOpened (libmwaw::SubDocumentType &subdocType) const =0
| returns true if a subdocument is open More...

## Detailed Description

This class contains a virtual interface to all listener.

## Member Enumeration Documentation

## ◆ BreakType

enum MWAWListener::BreakType

the different break type

Enumerator
PageBreak |
SoftPageBreak |
ColumnBreak |

## ◆ Type

enum MWAWListener::Type

the listener type

Enumerator
Graphic |
Presentation |
Spreadsheet |
Text |

## Constructor & Destructor Documentation

## ◆ ~MWAWListener()

MWAWListener::~MWAWListener | ( |  | ) |
| virtual

destructor

## Member Function Documentation

## ◆ addEmptyTableCell()

virtual void MWAWListener::addEmptyTableCell | ( | MWAWVec2i const & | pos,
|  | MWAWVec2i | span = `MWAWVec2i(1, 1)`
| ) |  |
| pure virtual

add empty cell

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ canOpenSectionAddBreak()

virtual bool MWAWListener::canOpenSectionAddBreak | ( |  | ) | const
| pure virtual

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

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ canWriteText()

virtual bool MWAWListener::canWriteText | ( |  | ) | const
| pure virtual

returns true if we can add text data

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

## ◆ closeFrame()

virtual void MWAWListener::closeFrame | ( |  | ) |
| pure virtual

low level: tries to close the last opened frame

Implemented in MWAWGraphicListener, MWAWSpreadsheetListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeGroup()

virtual void MWAWListener::closeGroup | ( |  | ) |
| pure virtual

low level: tries to close the last opened group

Implemented in MWAWGraphicListener, MWAWSpreadsheetListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeLink()

virtual void MWAWListener::closeLink | ( |  | ) |
| pure virtual

close a link

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeSection()

virtual bool MWAWListener::closeSection | ( |  | ) |
| pure virtual

close a section

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeTable()

virtual void MWAWListener::closeTable | ( |  | ) |
| pure virtual

closes this table

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeTableCell()

virtual void MWAWListener::closeTableCell | ( |  | ) |
| pure virtual

close a cell

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ closeTableRow()

virtual void MWAWListener::closeTableRow | ( |  | ) |
| pure virtual

closes this row

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ endDocument()

virtual void MWAWListener::endDocument | ( | bool | sendDelayedSubDoc = `true` | ) |
| pure virtual

ends the document

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

## ◆ getFont()

virtual const MWAWFont& MWAWListener::getFont | ( |  | ) | const
| pure virtual

returns the actual font

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ getPageSpan()

virtual const MWAWPageSpan& MWAWListener::getPageSpan | ( |  | ) |
| pure virtual

returns the current page span

Note
  this forces the opening of a new page if no page is opened.

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

## ◆ getParagraph()

virtual const MWAWParagraph& MWAWListener::getParagraph | ( |  | ) | const
| pure virtual

returns the actual paragraph

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ getSection()

virtual const MWAWSection& MWAWListener::getSection | ( |  | ) | const
| pure virtual

returns the actual section

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ getType()

virtual Type MWAWListener::getType | ( |  | ) | const
| pure virtual

returns the listener type

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

## ◆ handleSubDocument()

virtual void MWAWListener::handleSubDocument | ( | MWAWSubDocumentPtr const & | subDocument,
|  | libmwaw::SubDocumentType | subDocumentType
| ) |  |
| pure virtual

low level: function called to add a subdocument

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertBreak()

virtual void MWAWListener::insertBreak | ( | BreakType | breakType | ) |
| pure virtual

inserts a break type: ColumBreak, PageBreak, ..

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertChar()

virtual void MWAWListener::insertChar | ( | uint8_t | character | ) |
| pure virtual

adds a basic character, ..

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertCharacter() [1/2]

virtual void MWAWListener::insertCharacter | ( | unsigned char | c | ) |
| pure virtual

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

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertCharacter() [2/2]

virtual int MWAWListener::insertCharacter | ( | unsigned char | c,
|  | MWAWInputStreamPtr & | input,
|  | long | endPos = `-1`
| ) |  |
| pure 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

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertComment()

virtual void MWAWListener::insertComment | ( | MWAWSubDocumentPtr & | subDocument | ) |
| pure virtual

adds comment

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertEOL()

virtual void MWAWListener::insertEOL | ( | bool | softBreak = `false` | ) |
| pure virtual

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

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::insertPageNumberParagraph().

## ◆ insertField()

virtual void MWAWListener::insertField | ( | MWAWField const & | field | ) |
| pure virtual

adds a field type

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::insertPageNumberParagraph(), and GreatWksTextInternal::Token::sendTo().

## ◆ insertFooter()

virtual bool MWAWListener::insertFooter | ( | MWAWSubDocumentPtr const & | subDocument,
|  | librevenge::RVNGPropertyList const & | extras
| ) |  |
| pure virtual

insert a footer (interaction with MWAWPageSpan which fills the parameters for openFooter)

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::send().

## ◆ insertHeader()

virtual bool MWAWListener::insertHeader | ( | MWAWSubDocumentPtr const & | subDocument,
|  | librevenge::RVNGPropertyList const & | extras
| ) |  |
| pure virtual

insert a header (interaction with MWAWPageSpan which fills the parameters for openHeader)

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::send().

## ◆ insertNote()

virtual void MWAWListener::insertNote | ( | MWAWNote const & | note,
|  | MWAWSubDocumentPtr & | subDocument
| ) |  |
| pure virtual

insert a note

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertPicture()

virtual void MWAWListener::insertPicture | ( | MWAWPosition const & | pos,
|  | MWAWEmbeddedObject const & | picture,
|  | MWAWGraphicStyle const & | style = `MWAWGraphicStyle::emptyStyle()`
| ) |  |
| pure virtual

adds a picture with various representationin given position.

Note
  by default only send the first picture

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by ClarisWksGraph::sendBitmap().

## ◆ insertShape()

virtual void MWAWListener::insertShape | ( | MWAWPosition const & | pos,
|  | MWAWGraphicShape const & | shape,
|  | MWAWGraphicStyle const & | style
| ) |  |
| pure virtual

adds a shape picture in given position

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertTab()

virtual void MWAWListener::insertTab | ( |  | ) |
| pure virtual

adds a tab

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertTextBox()

virtual void MWAWListener::insertTextBox | ( | MWAWPosition const & | pos,
|  | MWAWSubDocumentPtr const & | subDocument,
|  | MWAWGraphicStyle const & | frameStyle = `MWAWGraphicStyle::emptyStyle()`
| ) |  |
| pure virtual

adds a textbox in given position

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

Referenced by insertTextBoxInShape().

## ◆ insertTextBoxInShape()

virtual void MWAWListener::insertTextBoxInShape | ( | MWAWPosition const & | pos,
|  | MWAWSubDocumentPtr const & | subDocument,
|  | MWAWGraphicShape const & | ,
|  | MWAWGraphicStyle const & | frameStyle = `MWAWGraphicStyle::emptyStyle()`
| ) |  |
| inlinevirtual

adds a textbox in given position

## ◆ insertUnicode()

virtual void MWAWListener::insertUnicode | ( | uint32_t | character | ) |
| pure virtual

adds an unicode character.

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

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ insertUnicodeString()

virtual void MWAWListener::insertUnicodeString | ( | librevenge::RVNGString const & | str | ) |
| pure virtual

adds a unicode string

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by GreatWksTextInternal::Token::sendTo().

## ◆ isDocumentStarted()

virtual bool MWAWListener::isDocumentStarted | ( |  | ) | const
| pure virtual

returns true if a document is opened

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWTextListener, and MWAWPresentationListener.

## ◆ isHeaderFooterOpened()

virtual bool MWAWListener::isHeaderFooterOpened | ( |  | ) | const
| pure virtual

returns true if the header/footer is open

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

## ◆ isPageSpanOpened()

virtual bool MWAWListener::isPageSpanOpened | ( |  | ) | const
| pure virtual

returns true if a page is opened

Implemented in MWAWGraphicListener, MWAWPresentationListener, MWAWSpreadsheetListener, and MWAWTextListener.

## ◆ isParagraphOpened()

virtual bool MWAWListener::isParagraphOpened | ( |  | ) | const
| pure virtual

returns true if a paragraph or a list is opened

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::insertPageNumberParagraph().

## ◆ isSectionOpened()

virtual bool MWAWListener::isSectionOpened | ( |  | ) | const
| pure virtual

returns true if a section is opened

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ isSubDocumentOpened()

virtual bool MWAWListener::isSubDocumentOpened | ( | libmwaw::SubDocumentType & | subdocType | ) | const
| pure virtual

returns true if a subdocument is open

Implemented in MWAWGraphicListener, MWAWSpreadsheetListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openFrame()

virtual bool MWAWListener::openFrame | ( | MWAWPosition const & | pos,
|  | MWAWGraphicStyle const & | style = `MWAWGraphicStyle::emptyStyle()`
| ) |  |
| pure virtual

low level: tries to open a frame

Implemented in MWAWGraphicListener, MWAWSpreadsheetListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openGroup()

virtual bool MWAWListener::openGroup | ( | MWAWPosition const & | pos | ) |
| pure virtual

low level: tries to open a group

Implemented in MWAWGraphicListener, MWAWSpreadsheetListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openLink()

virtual void MWAWListener::openLink | ( | MWAWLink const & | link | ) |
| pure virtual

open a link

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openSection()

virtual bool MWAWListener::openSection | ( | MWAWSection const & | section | ) |
| pure virtual

open a section if possible

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openTable()

virtual void MWAWListener::openTable | ( | MWAWTable const & | table | ) |
| pure virtual

open a table

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openTableCell()

virtual void MWAWListener::openTableCell | ( | MWAWCell const & | cell | ) |
| pure virtual

open a cell

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ openTableRow()

virtual void MWAWListener::openTableRow | ( | float | h,
|  | librevenge::RVNGUnit | unit,
|  | bool | headerRow = `false`
| ) |  |
| pure virtual

open a row with given height ( if h < 0.0, set min-row-height = -h )

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

## ◆ setDocumentLanguage()

virtual void MWAWListener::setDocumentLanguage | ( | std::string const & | locale | ) |
| pure virtual

sets the documents language

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

## ◆ setDocumentMetaData()

virtual void MWAWListener::setDocumentMetaData | ( | librevenge::RVNGPropertyList const & | metadata | ) |
| pure virtual

sets the documents metadata

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

## ◆ setFont()

virtual void MWAWListener::setFont | ( | MWAWFont const & | font | ) |
| pure virtual

sets the font

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::insertPageNumberParagraph().

## ◆ setParagraph()

virtual void MWAWListener::setParagraph | ( | MWAWParagraph const & | paragraph | ) |
| pure virtual

sets the paragraph

Implemented in MWAWSpreadsheetListener, MWAWGraphicListener, MWAWPresentationListener, and MWAWTextListener.

Referenced by MWAWHeaderFooter::insertPageNumberParagraph(), and ClarisWksText::setProperty().

## ◆ startDocument()

virtual void MWAWListener::startDocument | ( |  | ) |
| pure virtual

starts the document

Implemented in MWAWSpreadsheetListener, MWAWTextListener, MWAWGraphicListener, and MWAWPresentationListener.

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

- MWAWListener.hxx
- MWAWListener.cxx