WKSContentListener Class Reference documentation

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
WKSContentListener Class Referencefinal

`#include <WKSContentListener.h>`

Inheritance diagram for WKSContentListener:

## Classes
struct | CellContent
| small class use to define a sheet cell content More...
struct | FormulaInstruction
| small class use to define a formula instruction More...

## Public Member Functions
| WKSContentListener (std::vector< WPSPageSpan > const &pageList, librevenge::RVNGSpreadsheetInterface *documentInterface)
| ~WKSContentListener () final
void | setDocumentLanguage (int lcid) final
void | setMetaData (const librevenge::RVNGPropertyList &list)
void | startDocument ()
void | endDocument ()
void | handleSubDocument (WPSSubDocumentPtr &subDocument, libwps::SubDocumentType subDocumentType)
void | insertCharacter (uint8_t character) final
| adds a basic character, ..
void | insertUnicode (uint32_t character) final
| adds an unicode character
void | insertUnicodeString (librevenge::RVNGString const &str) final
| adds a unicode string
void | insertTab () final
| adds an unicode character to a string ( with correct encoding ).
void | insertEOL (bool softBreak=false) final
void | insertBreak (const uint8_t breakType) final
void | setFont (const WPSFont &font) final
| set the actual font
WPSFont const & | getFont () const final
| returns the actual font
bool | isParagraphOpened () const final
| returns true if a paragraph or a list is opened
void | setParagraph (const WPSParagraph &para) final
| sets the actual paragraph
WPSParagraph const & | getParagraph () const final
| returns the actual paragraph
void | insertField (WPSField const &field) final
| adds a field
void | insertComment (WPSSubDocumentPtr &subDocument)
| adds comment
void | insertPicture (WPSPosition const &pos, const librevenge::RVNGBinaryData &binaryData, std::string const &type="image/pict", WPSGraphicStyle const &style=WPSGraphicStyle::emptyStyle())
| adds a picture in given position
void | insertObject (WPSPosition const &pos, const WPSEmbeddedObject &obj, WPSGraphicStyle const &style=WPSGraphicStyle::emptyStyle())
| adds an object with replacement picture in given position
void | insertPicture (WPSPosition const &pos, WPSGraphicShape const &shape, WPSGraphicStyle const &style)
| adds a picture in given position
void | insertTextBox (WPSPosition const &pos, WPSSubDocumentPtr subDocument, WPSGraphicStyle const &frameStyle=WPSGraphicStyle::emptyStyle())
| adds a textbox in given position
bool | openGroup (WPSPosition const &pos) final
| open a group (not implemented)
void | closeGroup () final
| close a group (not implemented)
void | openSheet (std::vector< WPSColumnFormat > const &columns, librevenge::RVNGString const &name="")
| open a sheet
void | closeSheet ()
| closes this sheet
void | openSheetRow (WPSRowFormat const &f, int numRepeated=1)
| open a row
void | closeSheetRow ()
| closes this row
void | openSheetCell (WPSCell const &cell, CellContent const &content, int numRepeated=1)
| low level function to define a cell.
void | closeSheetCell ()
| close a cell
void | insertChart (WPSPosition const &pos, WKSChart const &chart, WPSGraphicStyle const &style=WPSGraphicStyle::emptyStyle())
| adds a chart in given position
Public Member Functions inherited from WPSListener
| WPSListener ()
virtual | ~WPSListener ()
virtual void | setDocumentLanguage (int lcid)=0
virtual void | insertCharacter (uint8_t character)=0
| adds a basic character, ..
virtual void | insertUnicode (uint32_t character)=0
| adds an unicode character
virtual void | insertUnicodeString (librevenge::RVNGString const &str)=0
| adds a unicode string
virtual void | insertTab ()=0
| adds an unicode character to a string ( with correct encoding ).
virtual void | insertEOL (bool softBreak=false)=0
virtual void | insertBreak (const uint8_t breakType)=0
virtual void | setFont (const WPSFont &font)=0
| set the actual font
virtual WPSFont const & | getFont () const =0
| returns the actual font
virtual bool | isParagraphOpened () const =0
| returns true if a paragraph or a list is opened
virtual void | setParagraph (const WPSParagraph &para)=0
| sets the actual paragraph
virtual WPSParagraph const & | getParagraph () const =0
| returns the actual paragraph
virtual bool | openGroup (WPSPosition const &pos)=0
| open a group
virtual void | closeGroup ()=0
| close a group
virtual void | insertField (WPSField const &field)=0
| adds a field

## Protected Member Functions
void | _openPageSpan ()
void | _closePageSpan ()
void | _handleFrameParameters (librevenge::RVNGPropertyList &propList, WPSPosition const &pos)
bool | _openFrame (WPSPosition const &pos, WPSGraphicStyle const &style)
void | _closeFrame ()
void | _startSubDocument ()
void | _endSubDocument ()
void | _openParagraph ()
void | _closeParagraph ()
void | _appendParagraphProperties (librevenge::RVNGPropertyList &propList, const bool isListElement=false)
void | _resetParagraphState (const bool isListElement=false)
void | _openSpan ()
void | _closeSpan ()
void | _flushText ()
void | _flushDeferredTabs ()
void | _insertBreakIfNecessary (librevenge::RVNGPropertyList &propList)
std::shared_ptr< WKSContentParsingState > | _pushParsingState ()
| creates a new parsing state (copy of the actual state)
void | _popParsingState ()
| resets the previous parsing state

## Protected Attributes
std::shared_ptr< WKSDocumentParsingState > | m_ds
std::shared_ptr< WKSContentParsingState > | m_ps
std::vector< std::shared_ptr< WKSContentParsingState > > | m_psStack
librevenge::RVNGSpreadsheetInterface * | m_documentInterface

## Private Member Functions
| WKSContentListener (const WKSContentListener &)=delete
WKSContentListener & | operator= (const WKSContentListener &)=delete

## Constructor & Destructor Documentation

## ◆ WKSContentListener() [1/2]

WKSContentListener::WKSContentListener | ( | std::vector< WPSPageSpan > const & | pageList,
|  | librevenge::RVNGSpreadsheetInterface * | documentInterface
| ) |  |

## ◆ ~WKSContentListener()

WKSContentListener::~WKSContentListener | ( |  | ) |
| final

## ◆ WKSContentListener() [2/2]

WKSContentListener::WKSContentListener | ( | const WKSContentListener & |  | ) |
| privatedelete

## Member Function Documentation

## ◆ _appendParagraphProperties()

void WKSContentListener::_appendParagraphProperties | ( | librevenge::RVNGPropertyList & | propList,
|  | const bool | isListElement = `false`
| ) |  |
| protected

Referenced by _openParagraph().

## ◆ _closeFrame()

void WKSContentListener::_closeFrame | ( |  | ) |
| protected

Referenced by insertChart(), insertObject(), insertPicture(), and insertTextBox().

## ◆ _closePageSpan()

void WKSContentListener::_closePageSpan | ( |  | ) |
| protected

Referenced by endDocument().

## ◆ _closeParagraph()

void WKSContentListener::_closeParagraph | ( |  | ) |
| protected

Referenced by _closePageSpan(), _endSubDocument(), _openFrame(), closeSheetCell(), endDocument(), insertBreak(), insertComment(), insertEOL(), and openSheet().

## ◆ _closeSpan()

void WKSContentListener::_closeSpan | ( |  | ) |
| protected

Referenced by _closeParagraph(), _flushDeferredTabs(), insertComment(), and setFont().

## ◆ _endSubDocument()

void WKSContentListener::_endSubDocument | ( |  | ) |
| protected

Referenced by closeGroup(), closeSheet(), handleSubDocument(), and insertChart().

## ◆ _flushDeferredTabs()

void WKSContentListener::_flushDeferredTabs | ( |  | ) |
| protected

Referenced by insertCharacter(), insertEOL(), insertTab(), insertUnicode(), and insertUnicodeString().

## ◆ _flushText()

void WKSContentListener::_flushText | ( |  | ) |
| protected

Referenced by _closeSpan(), _openFrame(), insertComment(), insertEOL(), insertField(), and insertTab().

## ◆ _handleFrameParameters()

void WKSContentListener::_handleFrameParameters | ( | librevenge::RVNGPropertyList & | propList,
|  | WPSPosition const & | pos
| ) |  |
| protected

Referenced by _openFrame(), insertPicture(), and openGroup().

## ◆ _insertBreakIfNecessary()

void WKSContentListener::_insertBreakIfNecessary | ( | librevenge::RVNGPropertyList & | propList | ) |
| protected

Referenced by _appendParagraphProperties().

## ◆ _openFrame()

bool WKSContentListener::_openFrame | ( | WPSPosition const & | pos,
|  | WPSGraphicStyle const & | style
| ) |  |
| protected

Referenced by insertChart(), insertObject(), insertPicture(), and insertTextBox().

## ◆ _openPageSpan()

void WKSContentListener::_openPageSpan | ( |  | ) |
| protected

Referenced by _openParagraph(), and openSheet().

## ◆ _openParagraph()

void WKSContentListener::_openParagraph | ( |  | ) |
| protected

Referenced by _openFrame(), _openSpan(), and insertComment().

## ◆ _openSpan()

void WKSContentListener::_openSpan | ( |  | ) |
| protected

Referenced by _flushDeferredTabs(), _openFrame(), insertCharacter(), insertEOL(), insertField(), insertUnicode(), and insertUnicodeString().

## ◆ _popParsingState()

void WKSContentListener::_popParsingState | ( |  | ) |
| protected

resets the previous parsing state

Referenced by closeGroup(), closeSheet(), handleSubDocument(), and insertChart().

## ◆ _pushParsingState()

std::shared_ptr< WKSContentParsingState > WKSContentListener::_pushParsingState | ( |  | ) |
| protected

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

Returns
  the old one

Referenced by handleSubDocument(), insertChart(), openGroup(), and openSheet().

## ◆ _resetParagraphState()

void WKSContentListener::_resetParagraphState | ( | const bool | isListElement = `false` | ) |
| protected

Referenced by _openParagraph().

## ◆ _startSubDocument()

void WKSContentListener::_startSubDocument | ( |  | ) |
| protected

Referenced by handleSubDocument(), insertChart(), openGroup(), and openSheet().

## ◆ closeGroup()

void WKSContentListener::closeGroup | ( |  | ) |
| finalvirtual

close a group (not implemented)

Implements WPSListener.

## ◆ closeSheet()

void WKSContentListener::closeSheet | ( |  | ) |

closes this sheet

Referenced by _endSubDocument(), and endDocument().

## ◆ closeSheetCell()

void WKSContentListener::closeSheetCell | ( |  | ) |

close a cell

Referenced by openSheetCell().

## ◆ closeSheetRow()

void WKSContentListener::closeSheetRow | ( |  | ) |

closes this row

## ◆ endDocument()

void WKSContentListener::endDocument | ( |  | ) |

## ◆ getFont()

WPSFont const & WKSContentListener::getFont | ( |  | ) | const
| finalvirtual

returns the actual font

Implements WPSListener.

## ◆ getParagraph()

WPSParagraph const & WKSContentListener::getParagraph | ( |  | ) | const
| finalvirtual

returns the actual paragraph

Implements WPSListener.

## ◆ handleSubDocument()

void WKSContentListener::handleSubDocument | ( | WPSSubDocumentPtr & | subDocument,
|  | libwps::SubDocumentType | subDocumentType
| ) |  |

Referenced by insertComment(), insertTextBox(), and WPSPageSpan::sendHeaderFooters().

## ◆ insertBreak()

void WKSContentListener::insertBreak | ( | const uint8_t | breakType | ) |
| finalvirtual

Implements WPSListener.

## ◆ insertCharacter()

void WKSContentListener::insertCharacter | ( | uint8_t | character | ) |
| finalvirtual

adds a basic character, ..

Implements WPSListener.

## ◆ insertChart()

void WKSContentListener::insertChart | ( | WPSPosition const & | pos,
|  | WKSChart const & | chart,
|  | WPSGraphicStyle const & | style = `WPSGraphicStyle::emptyStyle()`
| ) |  |

adds a chart in given position

## ◆ insertComment()

void WKSContentListener::insertComment | ( | WPSSubDocumentPtr & | subDocument | ) |

adds comment

## ◆ insertEOL()

void WKSContentListener::insertEOL | ( | bool | softBreak = `false` | ) |
| finalvirtual

Implements WPSListener.

## ◆ insertField()

void WKSContentListener::insertField | ( | WPSField const & | field | ) |
| finalvirtual

adds a field

Implements WPSListener.

## ◆ insertObject()

void WKSContentListener::insertObject | ( | WPSPosition const & | pos,
|  | const WPSEmbeddedObject & | obj,
|  | WPSGraphicStyle const & | style = `WPSGraphicStyle::emptyStyle()`
| ) |  |

adds an object with replacement picture in given position

## ◆ insertPicture() [1/2]

void WKSContentListener::insertPicture | ( | WPSPosition const & | pos,
|  | const librevenge::RVNGBinaryData & | binaryData,
|  | std::string const & | type = `"image/pict"`,
|  | WPSGraphicStyle const & | style = `WPSGraphicStyle::emptyStyle()`
| ) |  |

adds a picture in given position

## ◆ insertPicture() [2/2]

void WKSContentListener::insertPicture | ( | WPSPosition const & | pos,
|  | WPSGraphicShape const & | shape,
|  | WPSGraphicStyle const & | style
| ) |  |

adds a picture in given position

## ◆ insertTab()

void WKSContentListener::insertTab | ( |  | ) |
| finalvirtual

adds an unicode character to a string ( with correct encoding ).

Implements WPSListener.

## ◆ insertTextBox()

void WKSContentListener::insertTextBox | ( | WPSPosition const & | pos,
|  | WPSSubDocumentPtr | subDocument,
|  | WPSGraphicStyle const & | frameStyle = `WPSGraphicStyle::emptyStyle()`
| ) |  |

adds a textbox in given position

## ◆ insertUnicode()

void WKSContentListener::insertUnicode | ( | uint32_t | character | ) |
| finalvirtual

adds an unicode character

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

Implements WPSListener.

Referenced by insertCharacter().

## ◆ insertUnicodeString()

void WKSContentListener::insertUnicodeString | ( | librevenge::RVNGString const & | str | ) |
| finalvirtual

adds a unicode string

Implements WPSListener.

Referenced by insertField().

## ◆ isParagraphOpened()

bool WKSContentListener::isParagraphOpened | ( |  | ) | const
| finalvirtual

returns true if a paragraph or a list is opened

Implements WPSListener.

## ◆ openGroup()

bool WKSContentListener::openGroup | ( | WPSPosition const & | pos | ) |
| finalvirtual

open a group (not implemented)

Implements WPSListener.

## ◆ openSheet()

void WKSContentListener::openSheet | ( | std::vector< WPSColumnFormat > const & | columns,
|  | librevenge::RVNGString const & | name = `""`
| ) |  |

open a sheet

## ◆ openSheetCell()

void WKSContentListener::openSheetCell | ( | WPSCell const & | cell,
|  | WKSContentListener::CellContent const & | content,
|  | int | numRepeated = `1`
| ) |  |

low level function to define a cell.

Parameters

  cell | the cell position, alignement, ...
  content | the cell content
  numRepeated | the cell columns repeatition

## ◆ openSheetRow()

void WKSContentListener::openSheetRow | ( | WPSRowFormat const & | f,
|  | int | numRepeated = `1`
| ) |  |

open a row

## ◆ operator=()

WKSContentListener & WKSContentListener::operator= | ( | const WKSContentListener & |  | ) |
| privatedelete

## ◆ setDocumentLanguage()

void WKSContentListener::setDocumentLanguage | ( | int | lcid | ) |
| finalvirtual

Implements WPSListener.

## ◆ setFont()

void WKSContentListener::setFont | ( | const WPSFont & | font | ) |
| finalvirtual

set the actual font

Implements WPSListener.

## ◆ setMetaData()

void WKSContentListener::setMetaData | ( | const librevenge::RVNGPropertyList & | list | ) |

## ◆ setParagraph()

void WKSContentListener::setParagraph | ( | const WPSParagraph & | para | ) |
| finalvirtual

sets the actual paragraph

Implements WPSListener.

## ◆ startDocument()

void WKSContentListener::startDocument | ( |  | ) |

Referenced by _openPageSpan().

## Member Data Documentation

## ◆ m_documentInterface

librevenge::RVNGSpreadsheetInterface* WKSContentListener::m_documentInterface
| protected

Referenced by _closeFrame(), _closePageSpan(), _closeParagraph(), _closeSpan(), _flushDeferredTabs(), _flushText(), _openFrame(), _openPageSpan(), _openParagraph(), _openSpan(), closeGroup(), closeSheet(), closeSheetCell(), closeSheetRow(), endDocument(), insertChart(), insertComment(), insertEOL(), insertField(), insertObject(), insertPicture(), insertTextBox(), openGroup(), openSheet(), openSheetCell(), openSheetRow(), and startDocument().

## ◆ m_ds

std::shared_ptr<WKSDocumentParsingState> WKSContentListener::m_ds
| protected

Referenced by _openPageSpan(), _startSubDocument(), endDocument(), handleSubDocument(), openGroup(), openSheetCell(), setDocumentLanguage(), setMetaData(), and startDocument().

## ◆ m_ps

std::shared_ptr<WKSContentParsingState> WKSContentListener::m_ps
| protected

Referenced by _appendParagraphProperties(), _closeFrame(), _closePageSpan(), _closeParagraph(), _closeSpan(), _endSubDocument(), _flushDeferredTabs(), _flushText(), _handleFrameParameters(), _insertBreakIfNecessary(), _openFrame(), _openPageSpan(), _openParagraph(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), closeGroup(), closeSheet(), closeSheetCell(), closeSheetRow(), endDocument(), getFont(), getParagraph(), handleSubDocument(), insertBreak(), insertCharacter(), insertChart(), insertComment(), insertEOL(), insertTab(), insertUnicode(), insertUnicodeString(), isParagraphOpened(), openGroup(), openSheet(), openSheetCell(), openSheetRow(), setFont(), and setParagraph().

## ◆ m_psStack

std::vector<std::shared_ptr<WKSContentParsingState> > WKSContentListener::m_psStack
| protected

Referenced by _popParsingState(), and _pushParsingState().

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

- WKSContentListener.h
- WKSContentListener.cpp