#include <WPSContentListener.h>
Public Types | |
enum | NoteType { FOOTNOTE , ENDNOTE } |
defines the footnote type More... |
Public Member Functions | |
WPSContentListener (std::vector< WPSPageSpan > const &pageList, librevenge::RVNGTextInterface *documentInterface) | |
~WPSContentListener () final | |
void | setDocumentLanguage (int lcid) final |
void | setMetaData (const librevenge::RVNGPropertyList &list) |
void | startDocument () |
void | endDocument () |
void | handleSubDocument (WPSSubDocumentPtr &subDocument, libwps::SubDocumentType subDocumentType) |
bool | isHeaderFooterOpened () const |
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 ¶) final |
sets the actual paragraph | |
WPSParagraph const & | getParagraph () const final |
returns the actual paragraph | |
void | setCurrentList (std::shared_ptr< WPSList > list) |
function to set the actual list | |
std::shared_ptr< WPSList > | getCurrentList () const |
returns the current list | |
void | insertField (WPSField const &field) final |
adds a field | |
void | insertNote (const NoteType noteType, WPSSubDocumentPtr &subDocument) |
adds note | |
void | insertLabelNote (const NoteType noteType, librevenge::RVNGString const &label, WPSSubDocumentPtr &subDocument) |
adds a label note | |
void | insertComment (WPSSubDocumentPtr &subDocument) |
adds comment | |
void | insertPicture (WPSPosition const &pos, const librevenge::RVNGBinaryData &binaryData, std::string const &type="image/pict", librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList()) |
adds a picture in given position | |
void | insertObject (WPSPosition const &pos, const WPSEmbeddedObject &obj, librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList()) |
adds an object with replacement picture in given position | |
void | insertTextBox (WPSPosition const &pos, WPSSubDocumentPtr subDocument, librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList()) |
adds a textbox in given position | |
bool | openGroup (WPSPosition const &pos) final |
open a group | |
void | closeGroup () final |
close a group | |
void | openTable (std::vector< float > const &colWidth, librevenge::RVNGUnit unit) |
open a table | |
void | closeTable () |
closes this table | |
void | openTableRow (float h, librevenge::RVNGUnit unit, bool headerRow=false) |
open a row with given height. | |
void | closeTableRow () |
closes this row | |
void | openTableCell (WPSCell const &cell, librevenge::RVNGPropertyList const &extras=librevenge::RVNGPropertyList()) |
low level function to define a cell. | |
void | closeTableCell () |
close a cell | |
void | addEmptyTableCell (Vec2i const &pos, Vec2i span=Vec2i(1, 1)) |
add empty cell | |
bool | isSectionOpened () const |
returns true if a section is opened | |
int | getSectionNumColumns () const |
returns the actual number of columns ( or 1 if no section is opened ) | |
bool | openSection (std::vector< int > colsWidth=std::vector< int >(), librevenge::RVNGUnit unit=librevenge::RVNG_INCH) |
open a section if possible | |
bool | closeSection () |
close a section | |
Public Member Functions inherited from WPSListener | |
WPSListener () | |
virtual | ~WPSListener () |
Protected Member Functions | |
void | _openSection () |
void | _closeSection () |
void | _openPageSpan () |
void | _closePageSpan () |
void | _updatePageSpanDependent (bool set) |
void | _startSubDocument () |
void | _endSubDocument () |
void | _handleFrameParameters (librevenge::RVNGPropertyList &propList, WPSPosition const &pos) |
bool | _openFrame (WPSPosition const &pos, librevenge::RVNGPropertyList extras=librevenge::RVNGPropertyList()) |
void | _closeFrame () |
void | _openParagraph () |
void | _closeParagraph () |
void | _appendParagraphProperties (librevenge::RVNGPropertyList &propList, const bool isListElement=false) |
void | _resetParagraphState (const bool isListElement=false) |
void | _openListElement () |
void | _closeListElement () |
void | _changeList () |
void | _openSpan () |
void | _closeSpan () |
void | _flushText () |
void | _flushDeferredTabs () |
void | _insertBreakIfNecessary (librevenge::RVNGPropertyList &propList) |
std::shared_ptr< WPSContentParsingState > | _pushParsingState () |
creates a new parsing state (copy of the actual state) | |
void | _popParsingState () |
resets the previous parsing state |
Protected Attributes | |
std::shared_ptr< WPSDocumentParsingState > | m_ds |
std::shared_ptr< WPSContentParsingState > | m_ps |
std::vector< std::shared_ptr< WPSContentParsingState > > | m_psStack |
librevenge::RVNGTextInterface * | m_documentInterface |
Private Member Functions | |
WPSContentListener (const WPSContentListener &) | |
WPSContentListener & | operator= (const WPSContentListener &) |
WPSContentListener::WPSContentListener | ( | std::vector< WPSPageSpan > const & | pageList, |
librevenge::RVNGTextInterface * | documentInterface ) |
Referenced by operator=(), and WPSContentListener().
|
final |
|
private |
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
Referenced by _closeSection(), _endSubDocument(), _openSpan(), closeTableCell(), endDocument(), and insertLabelNote().
|
protected |
Referenced by insertObject(), insertPicture(), and insertTextBox().
|
protected |
Referenced by _closeParagraph().
|
protected |
Referenced by _closeListElement(), _closeParagraph(), endDocument(), and insertBreak().
|
protected |
Referenced by _changeList(), _closeSection(), _endSubDocument(), closeTableCell(), endDocument(), insertBreak(), insertEOL(), insertLabelNote(), and openTable().
|
protected |
Referenced by _closePageSpan(), _openListElement(), _openParagraph(), closeSection(), endDocument(), and handleSubDocument().
|
protected |
Referenced by _closeListElement(), _closeParagraph(), _flushDeferredTabs(), insertComment(), insertLabelNote(), and setFont().
|
protected |
Referenced by closeGroup(), closeTable(), and handleSubDocument().
|
protected |
Referenced by insertCharacter(), insertEOL(), insertTab(), insertUnicode(), and insertUnicodeString().
|
protected |
Referenced by _closeSpan(), _openFrame(), insertComment(), insertEOL(), insertField(), insertLabelNote(), insertTab(), and openGroup().
|
protected |
Referenced by _openFrame(), and openGroup().
|
protected |
Referenced by _appendParagraphProperties().
|
protected |
Referenced by insertObject(), insertPicture(), and insertTextBox().
|
protected |
Referenced by _openSpan().
|
protected |
Referenced by _openSection().
|
protected |
Referenced by _openFrame(), _openSpan(), insertComment(), insertLabelNote(), and openGroup().
|
protected |
Referenced by _changeList(), _openListElement(), _openParagraph(), and openSection().
|
protected |
|
protected |
resets the previous parsing state
Referenced by closeGroup(), closeTable(), and handleSubDocument().
|
protected |
creates a new parsing state (copy of the actual state)
Referenced by handleSubDocument(), openGroup(), and openTable().
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
Referenced by handleSubDocument(), openGroup(), and openTable().
|
protected |
Referenced by _openPageSpan(), and WPSContentListener().
add empty cell
|
finalvirtual |
close a group
Implements WPSListener.
bool WPSContentListener::closeSection | ( | ) |
close a section
void WPSContentListener::closeTable | ( | ) |
closes this table
Referenced by _endSubDocument(), and endDocument().
void WPSContentListener::closeTableCell | ( | ) |
close a cell
Referenced by addEmptyTableCell(), and openTableCell().
void WPSContentListener::closeTableRow | ( | ) |
closes this row
void WPSContentListener::endDocument | ( | ) |
std::shared_ptr< WPSList > WPSContentListener::getCurrentList | ( | ) | const |
returns the current list
Referenced by setParagraph().
|
finalvirtual |
returns the actual font
Implements WPSListener.
|
finalvirtual |
returns the actual paragraph
Implements WPSListener.
int WPSContentListener::getSectionNumColumns | ( | ) | const |
returns the actual number of columns ( or 1 if no section is opened )
void WPSContentListener::handleSubDocument | ( | WPSSubDocumentPtr & | subDocument, |
libwps::SubDocumentType | subDocumentType ) |
Referenced by insertComment(), insertLabelNote(), insertTextBox(), and WPSPageSpan::sendHeaderFooters().
|
finalvirtual |
Implements WPSListener.
|
finalvirtual |
adds a basic character, ..
Implements WPSListener.
void WPSContentListener::insertComment | ( | WPSSubDocumentPtr & | subDocument | ) |
adds comment
|
finalvirtual |
Implements WPSListener.
|
finalvirtual |
adds a field
Implements WPSListener.
void WPSContentListener::insertLabelNote | ( | const NoteType | noteType, |
librevenge::RVNGString const & | label, | ||
WPSSubDocumentPtr & | subDocument ) |
adds a label note
Must not happen excepted in corrupted document, so we do the minimum. Note that we have no choice, either we begin by closing the paragraph, ... or we reprogram handleSubDocument.
Referenced by insertNote().
void WPSContentListener::insertNote | ( | const NoteType | noteType, |
WPSSubDocumentPtr & | subDocument ) |
adds note
void WPSContentListener::insertObject | ( | WPSPosition const & | pos, |
const WPSEmbeddedObject & | obj, | ||
librevenge::RVNGPropertyList | frameExtras = librevenge::RVNGPropertyList() ) |
adds an object with replacement picture in given position
void WPSContentListener::insertPicture | ( | WPSPosition const & | pos, |
const librevenge::RVNGBinaryData & | binaryData, | ||
std::string const & | type = "image/pict", | ||
librevenge::RVNGPropertyList | frameExtras = librevenge::RVNGPropertyList() ) |
adds a picture in given position
|
finalvirtual |
adds an unicode character to a string ( with correct encoding ).
Implements WPSListener.
void WPSContentListener::insertTextBox | ( | WPSPosition const & | pos, |
WPSSubDocumentPtr | subDocument, | ||
librevenge::RVNGPropertyList | frameExtras = librevenge::RVNGPropertyList() ) |
adds a textbox in given position
|
finalvirtual |
adds an unicode character
by convention if character=0xfffd(undef), no character is added
Implements WPSListener.
Referenced by insertCharacter().
|
finalvirtual |
bool WPSContentListener::isHeaderFooterOpened | ( | ) | const |
|
finalvirtual |
returns true if a paragraph or a list is opened
Implements WPSListener.
bool WPSContentListener::isSectionOpened | ( | ) | const |
returns true if a section is opened
|
finalvirtual |
open a group
Implements WPSListener.
bool WPSContentListener::openSection | ( | std::vector< int > | colsWidth = std::vector<int>(), |
librevenge::RVNGUnit | unit = librevenge::RVNG_INCH ) |
open a section if possible
void WPSContentListener::openTable | ( | std::vector< float > const & | colWidth, |
librevenge::RVNGUnit | unit ) |
open a table
void WPSContentListener::openTableCell | ( | WPSCell const & | cell, |
librevenge::RVNGPropertyList const & | extras = librevenge::RVNGPropertyList() ) |
low level function to define a cell.
cell | the cell position, alignement, ... |
extras | to be used to pass extra data, for instance spreadsheet data |
Referenced by WPS8TableInternal::Cell::send(), and XYWriteParserInternal::Cell::send().
void WPSContentListener::openTableRow | ( | float | h, |
librevenge::RVNGUnit | unit, | ||
bool | headerRow = false ) |
open a row with given height.
If h<0, use min-row-heigth
|
private |
void WPSContentListener::setCurrentList | ( | std::shared_ptr< WPSList > | list | ) |
function to set the actual list
Referenced by setParagraph().
|
finalvirtual |
Implements WPSListener.
|
finalvirtual |
set the actual font
Implements WPSListener.
void WPSContentListener::setMetaData | ( | const librevenge::RVNGPropertyList & | list | ) |
|
finalvirtual |
sets the actual paragraph
Implements WPSListener.
void WPSContentListener::startDocument | ( | ) |
Referenced by _openPageSpan().
|
protected |
Referenced by _changeList(), _closeFrame(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSection(), _closeSpan(), _flushDeferredTabs(), _flushText(), _openFrame(), _openListElement(), _openPageSpan(), _openParagraph(), _openSection(), _openSpan(), addEmptyTableCell(), closeGroup(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), insertComment(), insertEOL(), insertField(), insertLabelNote(), insertObject(), insertPicture(), insertTextBox(), openGroup(), openTable(), openTableCell(), openTableRow(), startDocument(), and WPSContentListener().
|
protected |
|
protected |
Referenced by _appendParagraphProperties(), _changeList(), _closeFrame(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSection(), _closeSpan(), _endSubDocument(), _flushDeferredTabs(), _flushText(), _handleFrameParameters(), _insertBreakIfNecessary(), _openFrame(), _openListElement(), _openPageSpan(), _openParagraph(), _openSection(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), addEmptyTableCell(), closeGroup(), closeSection(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), getCurrentList(), getFont(), getParagraph(), getSectionNumColumns(), handleSubDocument(), insertBreak(), insertCharacter(), insertComment(), insertEOL(), insertLabelNote(), insertNote(), insertTab(), insertUnicode(), insertUnicodeString(), isParagraphOpened(), isSectionOpened(), openGroup(), openSection(), openTable(), openTableCell(), openTableRow(), setCurrentList(), setFont(), setParagraph(), and WPSContentListener().
|
protected |
Referenced by _popParsingState(), _pushParsingState(), and WPSContentListener().