This class contents the main functions needed to create a spreadsheet processing Document. More...
#include <MWAWSpreadsheetListener.hxx>
Public Member Functions | |
MWAWSpreadsheetListener (MWAWParserState &parserState, std::vector< MWAWPageSpan > const &pageList, librevenge::RVNGSpreadsheetInterface *documentInterface) | |
constructor | |
MWAWSpreadsheetListener (MWAWParserState &parserState, MWAWBox2f const &box, librevenge::RVNGSpreadsheetInterface *documentInterface) | |
simplified constructor (can be used for a embedded spreadsheet with one page). | |
~MWAWSpreadsheetListener () final | |
destructor | |
Type | getType () const final |
returns the listener type | |
void | setDocumentMetaData (librevenge::RVNGPropertyList const &metadata) final |
sets the documents metadata | |
void | setDocumentLanguage (std::string const &locale) final |
sets the documents language | |
void | startDocument () final |
starts the document | |
void | endDocument (bool sendDelayedSubDoc=true) final |
ends the document | |
bool | isDocumentStarted () const final |
returns true if a document is opened | |
void | handleSubDocument (MWAWSubDocumentPtr const &subDocument, libmwaw::SubDocumentType subDocumentType) final |
function called to add a subdocument | |
bool | isSubDocumentOpened (libmwaw::SubDocumentType &subdocType) const final |
returns try if a subdocument is open | |
bool | openFrame (MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final |
tries to open a frame | |
void | closeFrame () final |
tries to close a frame | |
bool | openGroup (MWAWPosition const &pos) final |
open a group (not implemented) | |
void | closeGroup () final |
close a group (not implemented) | |
bool | canWriteText () const final |
returns true if we can add text data | |
bool | isPageSpanOpened () const final |
returns true if a page is opened | |
MWAWPageSpan const & | getPageSpan () final |
returns the current page span | |
bool | insertHeader (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final |
insert a header | |
bool | insertFooter (MWAWSubDocumentPtr const &subDocument, librevenge::RVNGPropertyList const &extras) final |
insert a footer | |
bool | isHeaderFooterOpened () const final |
returns true if the header/footer is open | |
void | openSheet (std::vector< float > const &colWidth, librevenge::RVNGUnit unit, std::vector< int > const &repeatColWidthNumber=std::vector< int >(), std::string const &name="") |
opens a sheet | |
void | closeSheet () |
closes this sheet | |
void | openSheetRow (float h, librevenge::RVNGUnit unit, int numRepeated=1) |
open a row with given height ( if h < 0.0, set min-row-height = -h ) | |
void | closeSheetRow () |
closes this row | |
void | openSheetCell (MWAWCell const &cell, MWAWCellContent const &content, int numRepeated=1) |
open a cell | |
void | closeSheetCell () |
close a cell | |
void | insertChart (MWAWPosition const &pos, MWAWChart &chart, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) |
adds a chart in given position | |
void | insertChar (uint8_t character) final |
adds a basic character, .. | |
void | insertCharacter (unsigned char c) final |
insert a character using the font converter to find the utf8 character | |
int | insertCharacter (unsigned char c, MWAWInputStreamPtr &input, long endPos=-1) final |
insert a character using the font converter to find the utf8 character and if needed, input to read extra 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 a tab | |
void | insertEOL (bool softBreak=false) final |
adds an end of line ( by default an hard one) | |
void | setFont (MWAWFont const &font) final |
sets the font | |
MWAWFont const & | getFont () const final |
returns the actual font | |
bool | isParagraphOpened () const final |
returns true if a paragraph or a list is opened | |
void | setParagraph (MWAWParagraph const ¶graph) final |
sets the paragraph | |
MWAWParagraph const & | getParagraph () const final |
returns the actual paragraph | |
void | insertField (MWAWField const &field) final |
adds a field type | |
void | openLink (MWAWLink const &link) final |
open a link | |
void | closeLink () final |
close a link | |
void | insertNote (MWAWNote const ¬e, MWAWSubDocumentPtr &subDocument) final |
insert a note | |
void | insertComment (MWAWSubDocumentPtr &subDocument) final |
adds comment | |
void | insertPicture (MWAWPosition const &pos, MWAWEmbeddedObject const &picture, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) final |
adds a picture with potential various representationin given position | |
void | insertShape (MWAWPosition const &pos, MWAWGraphicShape const &shape, MWAWGraphicStyle const &style) final |
adds a shape picture in given position | |
void | insertTextBox (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicStyle const &frameStyle=MWAWGraphicStyle::emptyStyle()) final |
adds a textbox in given position | |
void | insertTable (MWAWPosition const &pos, MWAWTable &table, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) |
adds a table in given position | |
void | openTable (MWAWTable const &table) final |
open a table | |
void | closeTable () final |
closes this table | |
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 ) | |
void | closeTableRow () final |
closes this row | |
void | openTableCell (MWAWCell const &cell) final |
open a cell | |
void | closeTableCell () final |
close a cell | |
void | addEmptyTableCell (MWAWVec2i const &pos, MWAWVec2i span=MWAWVec2i(1, 1)) final |
add empty cell | |
bool | canOpenSectionAddBreak () const final |
returns true if we can add open a section, add page break, ... | |
bool | isSectionOpened () const final |
returns true if a section is opened | |
MWAWSection const & | getSection () const final |
returns the actual section | |
bool | openSection (MWAWSection const §ion) final |
open a section if possible | |
bool | closeSection () final |
close a section | |
void | insertBreak (BreakType breakType) final |
inserts a break type: ColumBreak, PageBreak, .. | |
![]() | |
virtual | ~MWAWListener () |
destructor | |
virtual void | insertTextBoxInShape (MWAWPosition const &pos, MWAWSubDocumentPtr const &subDocument, MWAWGraphicShape const &, MWAWGraphicStyle const &frameStyle=MWAWGraphicStyle::emptyStyle()) |
adds a textbox in given position | |
Protected Member Functions | |
void | _openPageSpan (bool sendHeaderFooters=true) |
does open a new page (low level) | |
void | _closePageSpan () |
does close a page (low level) | |
void | _startSubDocument () |
void | _endSubDocument () |
void | _handleFrameParameters (librevenge::RVNGPropertyList &propList, MWAWPosition const &pos) |
void | _openParagraph () |
void | _closeParagraph () |
void | _resetParagraphState (const bool isListElement=false) |
void | _openListElement () |
open a list level | |
void | _closeListElement () |
close a list level | |
void | _changeList () |
update the list so that it corresponds to the actual level | |
int | _getListId () const |
low level: find a list id which corresponds to actual list and a change of level. | |
void | _openSpan () |
void | _closeSpan () |
void | _flushText () |
void | _flushDeferredTabs () |
std::shared_ptr< MWAWSpreadsheetListenerInternal::State > | _pushParsingState () |
creates a new parsing state (copy of the actual state) | |
void | _popParsingState () |
resets the previous parsing state | |
Protected Attributes | |
std::shared_ptr< MWAWSpreadsheetListenerInternal::DocumentState > | m_ds |
the main parse state | |
std::shared_ptr< MWAWSpreadsheetListenerInternal::State > | m_ps |
the actual local parse state | |
std::vector< std::shared_ptr< MWAWSpreadsheetListenerInternal::State > > | m_psStack |
stack of local state | |
MWAWParserState & | m_parserState |
the parser state | |
librevenge::RVNGSpreadsheetInterface * | m_documentInterface |
the document interface | |
Private Member Functions | |
MWAWSpreadsheetListener (const MWAWSpreadsheetListener &) | |
copy constructor (unimplemented) | |
MWAWSpreadsheetListener & | operator= (const MWAWSpreadsheetListener &) |
operator= (unimplemented) | |
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 contents the main functions needed to create a spreadsheet processing Document.
MWAWSpreadsheetListener::MWAWSpreadsheetListener | ( | MWAWParserState & | parserState, |
std::vector< MWAWPageSpan > const & | pageList, | ||
librevenge::RVNGSpreadsheetInterface * | documentInterface ) |
constructor
Referenced by MWAWSpreadsheetListener(), and operator=().
MWAWSpreadsheetListener::MWAWSpreadsheetListener | ( | MWAWParserState & | parserState, |
MWAWBox2f const & | box, | ||
librevenge::RVNGSpreadsheetInterface * | documentInterface ) |
simplified constructor (can be used for a embedded spreadsheet with one page).
|
final |
destructor
|
private |
copy constructor (unimplemented)
|
protected |
update the list so that it corresponds to the actual level
Referenced by _endSubDocument(), _openSpan(), closeTableCell(), endDocument(), and insertNote().
|
protected |
close a list level
Referenced by _closeParagraph().
|
protected |
does close a page (low level)
Referenced by endDocument().
|
protected |
Referenced by _changeList(), _endSubDocument(), closeSheetCell(), closeTableCell(), endDocument(), insertComment(), insertEOL(), insertNote(), openSheet(), and openTable().
|
protected |
Referenced by _closeListElement(), _closeParagraph(), _endSubDocument(), _flushDeferredTabs(), closeLink(), insertComment(), insertNote(), and setFont().
|
protected |
Referenced by closeGroup(), closeSheet(), closeTable(), handleSubDocument(), insertChart(), and insertTable().
|
protected |
Referenced by insertChar(), insertEOL(), insertField(), insertTab(), insertUnicode(), and insertUnicodeString().
|
protected |
Referenced by _closeSpan(), insertComment(), insertEOL(), insertField(), insertNote(), insertShape(), insertTab(), and openFrame().
|
protected |
low level: find a list id which corresponds to actual list and a change of level.
Referenced by _changeList().
|
protected |
Referenced by insertShape(), openFrame(), and openGroup().
|
protected |
open a list level
Referenced by _openSpan().
|
protected |
does open a new page (low level)
Referenced by endDocument(), getPageSpan(), and openSheet().
|
protected |
Referenced by _openSpan(), insertComment(), insertNote(), insertShape(), and openFrame().
|
protected |
|
protected |
resets the previous parsing state
Referenced by closeGroup(), closeLink(), closeSheet(), closeTable(), handleSubDocument(), insertChart(), and insertTable().
|
protected |
creates a new parsing state (copy of the actual state)
Referenced by handleSubDocument(), insertChart(), insertTable(), openGroup(), openLink(), openSheet(), and openTable().
|
protected |
Referenced by _openListElement(), and _openParagraph().
|
protected |
Referenced by handleSubDocument(), insertChart(), insertTable(), openGroup(), openSheet(), and openTable().
|
finalvirtual |
add empty cell
Implements MWAWListener.
|
inlinefinalvirtual |
returns true if we can add open a section, add page break, ...
Implements MWAWListener.
Referenced by canOpenSectionAddBreak().
|
finalvirtual |
returns true if we can add text data
Implements MWAWListener.
Referenced by insertComment(), and insertNote().
|
finalvirtual |
tries to close a frame
Implements MWAWListener.
Referenced by insertChart(), insertPicture(), insertTable(), and insertTextBox().
|
finalvirtual |
close a group (not implemented)
Implements MWAWListener.
|
finalvirtual |
close a link
Implements MWAWListener.
|
finalvirtual |
close a section
Implements MWAWListener.
void MWAWSpreadsheetListener::closeSheet | ( | ) |
closes this sheet
Referenced by endDocument().
void MWAWSpreadsheetListener::closeSheetCell | ( | ) |
close a cell
Referenced by openSheetCell().
void MWAWSpreadsheetListener::closeSheetRow | ( | ) |
closes this row
|
finalvirtual |
|
finalvirtual |
|
finalvirtual |
closes this row
Implements MWAWListener.
|
finalvirtual |
ends the document
Implements MWAWListener.
|
finalvirtual |
returns the actual font
Implements MWAWListener.
|
finalvirtual |
returns the current page span
Implements MWAWListener.
|
finalvirtual |
returns the actual paragraph
Implements MWAWListener.
|
finalvirtual |
returns the actual section
Implements MWAWListener.
|
inlinefinalvirtual |
returns the listener type
Implements MWAWListener.
|
finalvirtual |
function called to add a subdocument
Implements MWAWListener.
Referenced by insertComment(), insertFooter(), insertHeader(), insertNote(), and insertTextBox().
|
finalvirtual |
inserts a break type: ColumBreak, PageBreak, ..
Implements MWAWListener.
|
finalvirtual |
adds a basic character, ..
Implements MWAWListener.
Referenced by insertCharacter(), and insertCharacter().
|
finalvirtual |
insert a character using the font converter to find the utf8 character
Implements MWAWListener.
|
finalvirtual |
insert a character using the font converter to find the utf8 character and if needed, input to read extra character.
Implements MWAWListener.
void MWAWSpreadsheetListener::insertChart | ( | MWAWPosition const & | pos, |
MWAWChart & | chart, | ||
MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() ) |
adds a chart in given position
|
finalvirtual |
adds comment
Implements MWAWListener.
|
finalvirtual |
adds an end of line ( by default an hard one)
Implements MWAWListener.
|
finalvirtual |
adds a field type
Implements MWAWListener.
|
finalvirtual |
insert a footer
Implements MWAWListener.
|
finalvirtual |
insert a header
Implements MWAWListener.
|
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 MWAWListener.
|
finalvirtual |
adds a picture with potential various representationin given position
Implements MWAWListener.
|
finalvirtual |
adds a shape picture in given position
Implements MWAWListener.
|
finalvirtual |
adds a tab
Implements MWAWListener.
void MWAWSpreadsheetListener::insertTable | ( | MWAWPosition const & | pos, |
MWAWTable & | table, | ||
MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() ) |
adds a table in given position
|
finalvirtual |
adds a textbox in given position
Implements MWAWListener.
|
finalvirtual |
adds an unicode character.
By convention if character=0xfffd(undef), no character is added
Implements MWAWListener.
Referenced by insertChar(), insertCharacter(), and insertCharacter().
|
finalvirtual |
|
finalvirtual |
returns true if a document is opened
Implements MWAWListener.
|
finalvirtual |
returns true if the header/footer is open
Implements MWAWListener.
|
finalvirtual |
returns true if a page is opened
Implements MWAWListener.
|
finalvirtual |
returns true if a paragraph or a list is opened
Implements MWAWListener.
|
inlinefinalvirtual |
returns true if a section is opened
Implements MWAWListener.
|
finalvirtual |
returns try if a subdocument is open
Implements MWAWListener.
|
finalvirtual |
tries to open a frame
Implements MWAWListener.
Referenced by insertChart(), insertPicture(), insertTable(), and insertTextBox().
|
finalvirtual |
open a group (not implemented)
Implements MWAWListener.
|
finalvirtual |
open a link
Implements MWAWListener.
|
finalvirtual |
open a section if possible
Implements MWAWListener.
void MWAWSpreadsheetListener::openSheet | ( | std::vector< float > const & | colWidth, |
librevenge::RVNGUnit | unit, | ||
std::vector< int > const & | repeatColWidthNumber = std::vector<int>(), | ||
std::string const & | name = "" ) |
opens a sheet
void MWAWSpreadsheetListener::openSheetCell | ( | MWAWCell const & | cell, |
MWAWCellContent const & | content, | ||
int | numRepeated = 1 ) |
open a cell
void MWAWSpreadsheetListener::openSheetRow | ( | float | h, |
librevenge::RVNGUnit | unit, | ||
int | numRepeated = 1 ) |
open a row with given height ( if h < 0.0, set min-row-height = -h )
|
finalvirtual |
open a table
Implements MWAWListener.
|
finalvirtual |
open a cell
Implements MWAWListener.
|
finalvirtual |
open a row with given height ( if h < 0.0, set min-row-height = -h )
Implements MWAWListener.
|
private |
operator= (unimplemented)
|
finalvirtual |
sets the documents language
Implements MWAWListener.
|
finalvirtual |
sets the documents metadata
Implements MWAWListener.
|
finalvirtual |
|
finalvirtual |
sets the paragraph
Implements MWAWListener.
|
finalvirtual |
|
protected |
the document interface
Referenced by _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSpan(), _flushDeferredTabs(), _flushText(), _openListElement(), _openPageSpan(), _openParagraph(), _openSpan(), addEmptyTableCell(), closeFrame(), closeGroup(), closeLink(), closeSheet(), closeSheetCell(), closeSheetRow(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), insertChart(), insertComment(), insertEOL(), insertField(), insertFooter(), insertHeader(), insertNote(), insertPicture(), insertShape(), insertTextBox(), MWAWSpreadsheetListener(), MWAWSpreadsheetListener(), openFrame(), openGroup(), openLink(), openSheet(), openSheetCell(), openSheetRow(), openTable(), openTableCell(), openTableRow(), and startDocument().
|
protected |
the main parse state
Referenced by _changeList(), _handleFrameParameters(), _openPageSpan(), _startSubDocument(), closeSheet(), closeSheetRow(), endDocument(), getPageSpan(), getSection(), handleSubDocument(), insertChart(), insertNote(), insertPicture(), insertShape(), insertTable(), insertTextBox(), isDocumentStarted(), MWAWSpreadsheetListener(), MWAWSpreadsheetListener(), openFrame(), openGroup(), openSheet(), openSheetCell(), openSheetRow(), setDocumentLanguage(), setDocumentMetaData(), and startDocument().
|
protected |
the parser state
Referenced by _changeList(), _getListId(), _openSpan(), insertCharacter(), insertCharacter(), MWAWSpreadsheetListener(), MWAWSpreadsheetListener(), openSheetCell(), and openTableCell().
|
protected |
the actual local parse state
Referenced by _changeList(), _closeListElement(), _closePageSpan(), _closeParagraph(), _closeSpan(), _endSubDocument(), _flushDeferredTabs(), _flushText(), _getListId(), _handleFrameParameters(), _openListElement(), _openPageSpan(), _openParagraph(), _openSpan(), _popParsingState(), _pushParsingState(), _resetParagraphState(), _startSubDocument(), addEmptyTableCell(), canWriteText(), closeFrame(), closeGroup(), closeLink(), closeSheetCell(), closeTable(), closeTableCell(), closeTableRow(), endDocument(), getFont(), getPageSpan(), getParagraph(), handleSubDocument(), insertChar(), insertCharacter(), insertCharacter(), insertChart(), insertComment(), insertEOL(), insertField(), insertFooter(), insertHeader(), insertNote(), insertShape(), insertTab(), insertTable(), insertUnicode(), insertUnicodeString(), isHeaderFooterOpened(), isPageSpanOpened(), isParagraphOpened(), isSubDocumentOpened(), MWAWSpreadsheetListener(), MWAWSpreadsheetListener(), openFrame(), openGroup(), openLink(), openSheet(), openSheetCell(), openTable(), openTableCell(), openTableRow(), setFont(), and setParagraph().
|
protected |
stack of local state
Referenced by _popParsingState(), _pushParsingState(), MWAWSpreadsheetListener(), and MWAWSpreadsheetListener().