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