This class contains the code needed to create Text document. More...
#include <STOFFTextListener.hxx>
Public Member Functions | |
STOFFTextListener (STOFFListManagerPtr &listManager, std::vector< STOFFPageSpan > const &pageList, librevenge::RVNGTextInterface *documentInterface) | |
constructor More... | |
~STOFFTextListener () final | |
destructor More... | |
Type | getType () const final |
returns the listener type More... | |
void | setDocumentLanguage (std::string locale) final |
sets the documents language More... | |
void | setDocumentMetaData (const librevenge::RVNGPropertyList &list) final |
sets the document meta data More... | |
void | startDocument () final |
starts a new document More... | |
void | endDocument (bool sendDelayedSubDoc=true) final |
ends the actual document More... | |
bool | canWriteText () const final |
returns true if a text zone is opened More... | |
bool | isDocumentStarted () const final |
returns true if a document is opened More... | |
void | handleSubDocument (STOFFSubDocumentPtr subDocument, libstoff::SubDocumentType subDocumentType) final |
function called to add a subdocument and modify the origin More... | |
bool | isSubDocumentOpened (libstoff::SubDocumentType &subdocType) const final |
returns try if a subdocument is open More... | |
bool | openFrame (STOFFFrameStyle const &frame, STOFFGraphicStyle const &style=STOFFGraphicStyle()) final |
store the position and the style (which will be needed further to insert a textbox or a table with openTable) More... | |
void | closeFrame () final |
close a frame More... | |
bool | openGroup (STOFFFrameStyle const &frame) final |
open a group More... | |
void | closeGroup () final |
close a group More... | |
bool | openLayer (librevenge::RVNGString const &name) |
open a layer More... | |
void | closeLayer () |
close a layer More... | |
bool | openMasterPage (STOFFPageSpan &) |
opens a master page More... | |
void | closeMasterPage () |
close a master page More... | |
bool | isPageSpanOpened () const final |
returns true if a page is opened More... | |
STOFFPageSpan const & | getPageSpan () final |
returns the current page span More... | |
bool | openHeader (librevenge::RVNGPropertyList const &extras) final |
open a header (interaction with STOFFPageSpan which fills the parameters for openHeader) More... | |
bool | openFooter (librevenge::RVNGPropertyList const &extras) final |
open a footer (interaction with STOFFPageSpan which fills the parameters for openFooter) More... | |
bool | closeHeader () final |
close a header More... | |
bool | closeFooter () final |
close a footer More... | |
bool | insertHeaderRegion (STOFFSubDocumentPtr subDocument, librevenge::RVNGString const &which) final |
insert a header More... | |
bool | insertFooterRegion (STOFFSubDocumentPtr subDocument, librevenge::RVNGString const &which) final |
insert a footer More... | |
bool | isHeaderFooterOpened () const final |
returns true if the header/footer is open More... | |
void | insertChar (uint8_t character) final |
adds a basic character, .. More... | |
void | insertUnicode (uint32_t character) final |
insert a character using the font converter to find the utf8 character More... | |
void | insertUnicodeString (librevenge::RVNGString const &str) final |
adds a unicode string More... | |
void | insertTab () final |
adds a tab More... | |
void | insertEOL (bool softBreak=false) final |
adds an end of line ( by default an hard one) More... | |
void | setFont (STOFFFont const &font) final |
sets the font More... | |
STOFFFont const & | getFont () const final |
returns the actual font More... | |
bool | isParagraphOpened () const final |
returns true if a paragraph or a list is opened More... | |
void | setParagraph (STOFFParagraph const ¶graph) final |
sets the paragraph More... | |
STOFFParagraph const & | getParagraph () const final |
returns the actual paragraph More... | |
void | defineStyle (STOFFFont const &style) final |
defines a font styles More... | |
bool | isFontStyleDefined (librevenge::RVNGString const &name) const final |
check if a font style with a display name is already defined More... | |
void | defineStyle (STOFFGraphicStyle const &style) final |
defines a graphic styles More... | |
bool | isGraphicStyleDefined (librevenge::RVNGString const &name) const final |
check if a graphic style with a display name is already defined More... | |
void | defineStyle (STOFFParagraph const &style) final |
defines a paragraph styles More... | |
bool | isParagraphStyleDefined (librevenge::RVNGString const &name) const final |
check if a paragraph style with a display name is already defined More... | |
void | insertField (STOFFField const &field) final |
adds a field type More... | |
void | openLink (STOFFLink const &link) final |
open a link More... | |
void | closeLink () final |
close a link More... | |
void | insertShape (STOFFFrameStyle const &frame, STOFFGraphicShape const &shape, STOFFGraphicStyle const &style) final |
adds a shape picture in given position More... | |
void | insertTextBox (STOFFFrameStyle const &pos, STOFFSubDocumentPtr subDocument, STOFFGraphicStyle const &style=STOFFGraphicStyle()) final |
adds a textbox in given position More... | |
void | insertPicture (STOFFFrameStyle const &frame, STOFFEmbeddedObject const &picture, STOFFGraphicStyle const &style=STOFFGraphicStyle()) final |
adds a picture with potential various representationin given position More... | |
void | insertEquation (STOFFFrameStyle const &frame, librevenge::RVNGString const &equation, STOFFGraphicStyle const &style=STOFFGraphicStyle()) final |
adds a equation given a position More... | |
void | insertNote (STOFFNote const ¬e, STOFFSubDocumentPtr &subDocument) final |
insert a note More... | |
void | insertComment (STOFFSubDocumentPtr &subDocument, librevenge::RVNGString const &creator="", librevenge::RVNGString const &date="") final |
adds comment More... | |
void | openTable (STOFFTable const &table) final |
open a table (using the last parameters of openFrame for the position ) More... | |
void | closeTable () final |
closes this table More... | |
void | openTableRow (float h, librevenge::RVNGUnit unit, bool headerRow=false) final |
open a row with given height ( if h < 0.0, set min-row-height = -h ) More... | |
void | closeTableRow () final |
closes this row More... | |
void | openTableCell (STOFFCell const &cell) final |
open a cell More... | |
void | closeTableCell () final |
close a cell More... | |
void | addCoveredTableCell (STOFFVec2i const &pos) final |
add covered cell More... | |
void | addEmptyTableCell (STOFFVec2i const &pos, STOFFVec2i span=STOFFVec2i(1, 1)) final |
add empty cell More... | |
bool | canOpenSectionAddBreak () const final |
returns true if we can add open a section, add page break, ... More... | |
bool | isSectionOpened () const final |
returns true if a section is opened More... | |
STOFFSection const & | getSection () const final |
returns the actual section More... | |
bool | openSection (STOFFSection const §ion) final |
open a section if possible More... | |
bool | closeSection () final |
close a section More... | |
void | insertBreak (BreakType breakType) final |
inserts a break type: ColumBreak, PageBreak, .. More... | |
![]() | |
virtual | ~STOFFListener () |
destructor More... | |
STOFFListManagerPtr | getListManager () const |
return the list manager More... | |
void | insertUnicodeList (std::vector< uint32_t > const &list) |
try to insert a list of unicode character More... | |
Protected Member Functions | |
void | _openSection () |
does open a section (low level) More... | |
void | _closeSection () |
does close a section (low level) More... | |
void | _openPageSpan (bool sendHeaderFooters=true) |
does open a new page (low level) More... | |
void | _closePageSpan () |
does close a page (low level) More... | |
void | _startSubDocument () |
void | _endSubDocument () |
void | _handleFrameParameters (librevenge::RVNGPropertyList &propList, STOFFFrameStyle const &frame, STOFFGraphicStyle const &style) |
adds in propList the frame parameters. More... | |
void | _openParagraph () |
void | _closeParagraph () |
void | _appendParagraphProperties (librevenge::RVNGPropertyList &propList, const bool isListElement=false) |
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 () |
low level: the function which opens a new span property More... | |
void | _closeSpan () |
low level: the function which closes the last opened span property More... | |
void | _flushText () |
low level: flush the deferred text More... | |
void | _flushDeferredTabs () |
low level: flush the deferred tabs More... | |
void | _insertBreakIfNecessary (librevenge::RVNGPropertyList &propList) |
std::shared_ptr< STOFFTextListenerInternal::State > | _pushParsingState () |
creates a new parsing state (copy of the actual state) More... | |
void | _popParsingState () |
resets the previous parsing state More... | |
![]() | |
STOFFListener (STOFFListManagerPtr &listManager) | |
constructor More... | |
Protected Attributes | |
std::shared_ptr< STOFFTextListenerInternal::TextState > | m_ds |
the actual global state More... | |
std::shared_ptr< STOFFTextListenerInternal::State > | m_ps |
the actual local parse state More... | |
std::vector< std::shared_ptr< STOFFTextListenerInternal::State > > | m_psStack |
stack of local state More... | |
librevenge::RVNGTextInterface * | m_documentInterface |
the document interface More... | |
![]() | |
STOFFListManagerPtr | m_listManager |
the list manager More... | |
Private Member Functions | |
STOFFTextListener (const STOFFTextListener &) | |
STOFFTextListener & | operator= (const STOFFTextListener &) |
Additional Inherited Members | |
![]() | |
enum | Type { Graphic , Presentation , Spreadsheet , Text } |
the listener type More... | |
enum | BreakType { PageBreak =0 , SoftPageBreak , ColumnBreak } |
the different break type More... | |
This class contains the code needed to create Text document.
STOFFTextListener::STOFFTextListener | ( | STOFFListManagerPtr & | listManager, |
std::vector< STOFFPageSpan > const & | pageList, | ||
librevenge::RVNGTextInterface * | documentInterface | ||
) |
constructor
|
final |
destructor
|
private |
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
update the list so that it corresponds to the actual level
Referenced by _closeSection(), _endSubDocument(), _openSpan(), closeTableCell(), endDocument(), and insertNote().
|
protected |
close a list level
Referenced by _closeParagraph().
|
protected |
does close a page (low level)
Referenced by _closeListElement(), _closeParagraph(), endDocument(), and insertBreak().
|
protected |
Referenced by _changeList(), _closeSection(), _endSubDocument(), closeTableCell(), endDocument(), insertBreak(), insertEOL(), insertNote(), insertShape(), and openTable().
|
protected |
does close a section (low level)
Referenced by _closePageSpan(), _openListElement(), _openParagraph(), closeSection(), endDocument(), and handleSubDocument().
|
protected |
low level: the function which closes the last opened span property
Referenced by _closeListElement(), _closeParagraph(), closeLink(), insertComment(), insertNote(), and setFont().
|
protected |
Referenced by closeGroup(), closeTable(), and handleSubDocument().
|
protected |
low level: flush the deferred tabs
Referenced by insertChar(), insertEOL(), insertField(), insertTab(), insertUnicode(), insertUnicodeString(), and openLink().
|
protected |
low level: flush the deferred text
Referenced by _closeSpan(), insertComment(), insertEOL(), insertField(), insertNote(), insertShape(), insertTab(), openFrame(), openGroup(), and openLink().
|
protected |
low level: find a list id which corresponds to actual list and a change of level.
Referenced by _changeList().
|
protected |
adds in propList the frame parameters.
Referenced by openFrame().
|
protected |
Referenced by _appendParagraphProperties().
|
protected |
open a list level
Referenced by _openSpan().
|
protected |
does open a new page (low level)
Referenced by _openSection(), endDocument(), getPageSpan(), and insertShape().
|
protected |
Referenced by _openSpan(), insertComment(), insertNote(), insertShape(), openFrame(), and openGroup().
|
protected |
does open a section (low level)
Referenced by _changeList(), _openListElement(), _openParagraph(), and openSection().
|
protected |
low level: the function which opens a new span property
Referenced by _flushDeferredTabs(), endDocument(), handleSubDocument(), insertBreak(), insertChar(), insertEOL(), insertField(), insertShape(), insertUnicode(), insertUnicodeString(), openFrame(), openGroup(), and openLink().
|
protected |
resets the previous parsing state
Referenced by closeGroup(), closeLink(), closeTable(), and handleSubDocument().
|
protected |
creates a new parsing state (copy of the actual state)
Referenced by handleSubDocument(), openGroup(), openLink(), and openTable().
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
Referenced by handleSubDocument(), openGroup(), and openTable().
|
finalvirtual |
add covered cell
Implements STOFFListener.
|
finalvirtual |
add empty cell
Implements STOFFListener.
|
finalvirtual |
returns true if we can add open a section, add page break, ...
Implements STOFFListener.
|
inlinefinalvirtual |
returns true if a text zone is opened
Implements STOFFListener.
|
finalvirtual |
close a footer
Implements STOFFListener.
|
finalvirtual |
close a frame
Implements STOFFListener.
Referenced by insertEquation(), insertPicture(), and insertTextBox().
|
finalvirtual |
close a group
Implements STOFFListener.
|
finalvirtual |
close a header
Implements STOFFListener.
void STOFFTextListener::closeLayer | ( | ) |
close a layer
|
finalvirtual |
close a link
Implements STOFFListener.
|
inline |
close a master page
|
finalvirtual |
close a section
Implements STOFFListener.
|
finalvirtual |
|
finalvirtual |
close a cell
Implements STOFFListener.
Referenced by addCoveredTableCell(), addEmptyTableCell(), and openTableCell().
|
finalvirtual |
closes this row
Implements STOFFListener.
|
finalvirtual |
defines a font styles
Implements STOFFListener.
|
finalvirtual |
defines a graphic styles
Implements STOFFListener.
|
finalvirtual |
defines a paragraph styles
Implements STOFFListener.
|
finalvirtual |
ends the actual document
Implements STOFFListener.
|
finalvirtual |
returns the actual font
Implements STOFFListener.
|
finalvirtual |
returns the current page span
Implements STOFFListener.
|
finalvirtual |
returns the actual paragraph
Implements STOFFListener.
|
finalvirtual |
returns the actual section
Implements STOFFListener.
|
inlinefinalvirtual |
returns the listener type
Implements STOFFListener.
|
finalvirtual |
function called to add a subdocument and modify the origin
Implements STOFFListener.
Referenced by insertComment(), insertFooterRegion(), insertHeaderRegion(), insertNote(), and insertTextBox().
|
finalvirtual |
inserts a break type: ColumBreak, PageBreak, ..
Implements STOFFListener.
|
finalvirtual |
adds a basic character, ..
Implements STOFFListener.
|
finalvirtual |
adds comment
Implements STOFFListener.
|
finalvirtual |
adds an end of line ( by default an hard one)
Implements STOFFListener.
|
finalvirtual |
adds a equation given a position
Implements STOFFListener.
|
finalvirtual |
adds a field type
Implements STOFFListener.
|
finalvirtual |
insert a footer
Implements STOFFListener.
|
finalvirtual |
insert a header
Implements STOFFListener.
|
finalvirtual |
insert a 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.
Implements STOFFListener.
|
finalvirtual |
adds a picture with potential various representationin given position
Implements STOFFListener.
|
finalvirtual |
adds a shape picture in given position
Implements STOFFListener.
|
finalvirtual |
adds a tab
Implements STOFFListener.
|
finalvirtual |
adds a textbox in given position
Implements STOFFListener.
|
finalvirtual |
insert a character using the font converter to find the utf8 character
adds an unicode character. By convention if character=0xfffd(undef), no character is added
Implements STOFFListener.
Referenced by insertChar().
|
finalvirtual |
adds a unicode string
Implements STOFFListener.
|
finalvirtual |
|
finalvirtual |
check if a font style with a display name is already defined
Implements STOFFListener.
|
finalvirtual |
check if a graphic style with a display name is already defined
Implements STOFFListener.
|
finalvirtual |
returns true if the header/footer is open
Implements STOFFListener.
|
finalvirtual |
returns true if a page is opened
Implements STOFFListener.
|
finalvirtual |
returns true if a paragraph or a list is opened
Implements STOFFListener.
|
finalvirtual |
check if a paragraph style with a display name is already defined
Implements STOFFListener.
|
finalvirtual |
returns true if a section is opened
Implements STOFFListener.
|
finalvirtual |
returns try if a subdocument is open
Implements STOFFListener.
|
finalvirtual |
open a footer (interaction with STOFFPageSpan which fills the parameters for openFooter)
Implements STOFFListener.
|
finalvirtual |
store the position and the style (which will be needed further to insert a textbox or a table with openTable)
Implements STOFFListener.
Referenced by insertEquation(), insertPicture(), and insertTextBox().
|
finalvirtual |
open a group
Implements STOFFListener.
|
finalvirtual |
open a header (interaction with STOFFPageSpan which fills the parameters for openHeader)
Implements STOFFListener.
bool STOFFTextListener::openLayer | ( | librevenge::RVNGString const & | name | ) |
open a layer
|
finalvirtual |
open a link
Implements STOFFListener.
bool STOFFTextListener::openMasterPage | ( | STOFFPageSpan & | ) |
opens a master page
|
finalvirtual |
open a section if possible
Implements STOFFListener.
|
finalvirtual |
open a table (using the last parameters of openFrame for the position )
Implements STOFFListener.
|
finalvirtual |
open a cell
Implements STOFFListener.
|
finalvirtual |
open a row with given height ( if h < 0.0, set min-row-height = -h )
Implements STOFFListener.
|
private |
|
finalvirtual |
sets the documents language
Implements STOFFListener.
|
finalvirtual |
sets the document meta data
Implements STOFFListener.
|
finalvirtual |
sets the font
Implements STOFFListener.
|
finalvirtual |
sets the paragraph
Implements STOFFListener.
|
finalvirtual |
|
protected |
the document interface
Referenced by _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSection(), _closeSpan(), _flushDeferredTabs(), _flushText(), _openListElement(), _openPageSpan(), _openParagraph(), _openSection(), _openSpan(), addCoveredTableCell(), addEmptyTableCell(), closeFooter(), closeFrame(), closeGroup(), closeHeader(), closeLink(), closeTable(), closeTableCell(), closeTableRow(), defineStyle(), endDocument(), insertComment(), insertEOL(), insertEquation(), insertField(), insertNote(), insertPicture(), insertShape(), insertTextBox(), openFooter(), openFrame(), openGroup(), openHeader(), openLink(), openTable(), openTableCell(), openTableRow(), and startDocument().
|
protected |
the actual global state
Referenced by _appendParagraphProperties(), _changeList(), _handleFrameParameters(), _openPageSpan(), _startSubDocument(), closeFooter(), closeHeader(), defineStyle(), endDocument(), getPageSpan(), handleSubDocument(), insertFooterRegion(), insertHeaderRegion(), insertNote(), isDocumentStarted(), isFontStyleDefined(), isGraphicStyleDefined(), isHeaderFooterOpened(), isParagraphStyleDefined(), openFooter(), openFrame(), openGroup(), openHeader(), setDocumentLanguage(), setDocumentMetaData(), and startDocument().
|
protected |
the actual local parse state
Referenced by _appendParagraphProperties(), _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSection(), _closeSpan(), _endSubDocument(), _flushDeferredTabs(), _flushText(), _getListId(), _insertBreakIfNecessary(), _openListElement(), _openPageSpan(), _openParagraph(), _openSection(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), addCoveredTableCell(), addEmptyTableCell(), canOpenSectionAddBreak(), closeFrame(), closeGroup(), closeLink(), closeSection(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), getFont(), getPageSpan(), getParagraph(), getSection(), handleSubDocument(), insertBreak(), insertChar(), insertComment(), insertEOL(), insertNote(), insertShape(), insertTab(), insertUnicode(), insertUnicodeString(), isPageSpanOpened(), isParagraphOpened(), isSectionOpened(), isSubDocumentOpened(), openFrame(), openGroup(), openLink(), openSection(), openTable(), openTableCell(), openTableRow(), setFont(), and setParagraph().
|
protected |
stack of local state
Referenced by _popParsingState(), and _pushParsingState().