STOFFSpreadsheetListener Class Reference

This class contents the main functions needed to create a spreadsheet processing Document. More...

#include <STOFFSpreadsheetListener.hxx>

Inheritance diagram for STOFFSpreadsheetListener:
STOFFListener

List of all members.

Public Member Functions

 STOFFSpreadsheetListener (STOFFListManagerPtr listManager, std::vector< STOFFPageSpan > const &pageList, librevenge::RVNGSpreadsheetInterface *documentInterface)
 constructor
virtual ~STOFFSpreadsheetListener ()
 destructor
Type getType () const
 returns the listener type
void setDocumentLanguage (std::string locale)
 sets the document language
void setDocumentMetaData (const librevenge::RVNGPropertyList &list)
 sets the document meta data
void startDocument ()
 starts the document
void endDocument (bool sendDelayedSubDoc=true)
 ends the document
bool isDocumentStarted () const
 returns true if a document is opened
void handleSubDocument (STOFFSubDocumentPtr subDocument, libstoff::SubDocumentType subDocumentType)
 function called to add a subdocument
bool isSubDocumentOpened (libstoff::SubDocumentType &subdocType) const
 returns try if a subdocument is open
bool openFrame (STOFFPosition const &pos, STOFFGraphicStyle const &style=STOFFGraphicStyle())
 tries to open a frame
void closeFrame ()
 tries to close a frame
bool openGroup (STOFFPosition const &pos)
 open a group (not implemented)
void closeGroup ()
 close a group (not implemented)
bool canWriteText () const
 returns true if we can add text data
bool isPageSpanOpened () const
 returns true if a page is opened
STOFFPageSpan const & getPageSpan ()
 returns the current page span
bool openHeader (librevenge::RVNGPropertyList const &extras)
 open a header (interaction with STOFFPageSpan which fills the parameters for openHeader)
bool openFooter (librevenge::RVNGPropertyList const &extras)
 open a footer (interaction with STOFFPageSpan which fills the parameters for openFooter)
bool closeHeader ()
 close a header
bool closeFooter ()
 close a footer
bool insertHeaderRegion (STOFFSubDocumentPtr subDocument, librevenge::RVNGString const &which)
 insert a header
bool insertFooterRegion (STOFFSubDocumentPtr subDocument, librevenge::RVNGString const &which)
 insert a footer
bool isHeaderFooterOpened () const
 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 >(), librevenge::RVNGString const &name="")
 open 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 (STOFFCell const &cell, STOFFCellContent const &content, int numRepeated=1)
 open a cell
void closeSheetCell ()
 close a cell
void insertChart (STOFFPosition const &pos, STOFFChart &chart, STOFFGraphicStyle const &style=STOFFGraphicStyle())
 adds a chart in given position
void insertChar (uint8_t character)
 adds a basic character, ..
void insertUnicode (uint32_t character)
 adds an unicode character.
void insertUnicodeString (librevenge::RVNGString const &str)
 adds a unicode string
void insertTab ()
 adds a tab
void insertEOL (bool softBreak=false)
 adds an end of line ( by default an hard one)
void setFont (STOFFFont const &font)
 sets the font
STOFFFont const & getFont () const
 returns the actual font
bool isParagraphOpened () const
 returns true if a paragraph or a list is opened
void setParagraph (STOFFParagraph const &paragraph)
 sets the paragraph
STOFFParagraph const & getParagraph () const
 returns the actual paragraph
void defineStyle (STOFFFont const &style)
 defines a font styles
bool isFontStyleDefined (librevenge::RVNGString const &name) const
 check if a font style with a display name is already defined
void defineStyle (STOFFGraphicStyle const &style)
 defines a graphic styles
bool isGraphicStyleDefined (librevenge::RVNGString const &name) const
 check if a graphic style with a display name is already defined
void defineStyle (STOFFParagraph const &style)
 defines a paragraph styles
bool isParagraphStyleDefined (librevenge::RVNGString const &name) const
 check if a paragraph style with a display name is already defined
void insertField (STOFFField const &field)
 adds a field type
void openLink (STOFFLink const &link)
 open a link
void closeLink ()
 close a link
void insertNote (STOFFNote const &note, STOFFSubDocumentPtr &subDocument)
 insert a note
void insertComment (STOFFSubDocumentPtr &subDocument, librevenge::RVNGString const &creator="", librevenge::RVNGString const &date="")
 adds comment
void insertPicture (STOFFPosition const &pos, STOFFEmbeddedObject const &picture, STOFFGraphicStyle const &style=STOFFGraphicStyle())
 adds a picture with potential various representationin given position
void insertShape (STOFFGraphicShape const &shape, STOFFGraphicStyle const &style, STOFFPosition const &pos)
 adds a shape picture in given position
void insertTextBox (STOFFPosition const &pos, STOFFSubDocumentPtr subDocument, STOFFGraphicStyle const &frameStyle=STOFFGraphicStyle())
 adds a textbox in given position
void insertTable (STOFFPosition const &pos, STOFFTable &table, STOFFGraphicStyle const &style=STOFFGraphicStyle())
 adds a table in given position
void openTable (STOFFTable const &table)
 open a table
void closeTable ()
 closes this table
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 )
void closeTableRow ()
 closes this row
void openTableCell (STOFFCell const &cell)
 open a cell
void closeTableCell ()
 close a cell
void addEmptyTableCell (STOFFVec2i const &pos, STOFFVec2i span=STOFFVec2i(1, 1))
 add empty cell
bool canOpenSectionAddBreak () const
 returns true if we can add open a section, add page break, ...
bool isSectionOpened () const
 returns true if a section is opened
STOFFSection const & getSection () const
 returns the actual section
bool openSection (STOFFSection const &section)
 open a section if possible
bool closeSection ()
 close a section
void insertBreak (BreakType breakType)
 inserts a break type: ColumBreak, PageBreak, ..

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, STOFFPosition 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 ()
shared_ptr
< STOFFSpreadsheetListenerInternal::State
_pushParsingState ()
 creates a new parsing state (copy of the actual state)
void _popParsingState ()
 resets the previous parsing state

Protected Attributes

shared_ptr
< STOFFSpreadsheetListenerInternal::DocumentState
m_ds
 the main parse state
shared_ptr
< STOFFSpreadsheetListenerInternal::State
m_ps
 the actual local parse state
std::vector< shared_ptr
< STOFFSpreadsheetListenerInternal::State > > 
m_psStack
 stack of local state
librevenge::RVNGSpreadsheetInterface * m_documentInterface
 the document interface

Private Member Functions

 STOFFSpreadsheetListener (const STOFFSpreadsheetListener &)
 copy constructor (unimplemented)
STOFFSpreadsheetListeneroperator= (const STOFFSpreadsheetListener &)
 operator= (unimplemented)

Detailed Description

This class contents the main functions needed to create a spreadsheet processing Document.


Constructor & Destructor Documentation

STOFFSpreadsheetListener::STOFFSpreadsheetListener ( STOFFListManagerPtr  listManager,
std::vector< STOFFPageSpan > const &  pageList,
librevenge::RVNGSpreadsheetInterface *  documentInterface 
)

constructor

copy constructor (unimplemented)


Member Function Documentation

update the list so that it corresponds to the actual level

Referenced by _endSubDocument(), _openSpan(), closeTableCell(), endDocument(), and insertNote().

close a list level

Referenced by _closeParagraph().

does close a page (low level)

Referenced by endDocument(), and insertBreak().

int STOFFSpreadsheetListener::_getListId ( ) const [protected]

low level: find a list id which corresponds to actual list and a change of level.

Note:
called when the list id is not set

Referenced by _changeList().

void STOFFSpreadsheetListener::_handleFrameParameters ( librevenge::RVNGPropertyList &  propList,
STOFFPosition const &  pos 
) [protected]

Referenced by openFrame().

open a list level

Referenced by _openSpan().

void STOFFSpreadsheetListener::_openPageSpan ( bool  sendHeaderFooters = true) [protected]

does open a new page (low level)

Referenced by endDocument(), getPageSpan(), and openSheet().

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

Returns:
the old one

Referenced by handleSubDocument(), insertTable(), openFooter(), openHeader(), openLink(), openSheet(), and openTable().

void STOFFSpreadsheetListener::_resetParagraphState ( const bool  isListElement = false) [protected]

Referenced by _openListElement(), and _openParagraph().

void STOFFSpreadsheetListener::addEmptyTableCell ( STOFFVec2i const &  pos,
STOFFVec2i  span = STOFFVec2i(1,1) 
) [virtual]

add empty cell

Implements STOFFListener.

bool STOFFSpreadsheetListener::canOpenSectionAddBreak ( ) const [inline, virtual]

returns true if we can add open a section, add page break, ...

Implements STOFFListener.

bool STOFFSpreadsheetListener::canWriteText ( ) const [virtual]

returns true if we can add text data

Implements STOFFListener.

Referenced by insertComment(), and insertNote().

close a footer

Implements STOFFListener.

tries to close a frame

Implements STOFFListener.

Referenced by insertPicture(), and insertTable().

close a group (not implemented)

Implements STOFFListener.

close a header

Implements STOFFListener.

close a link

Implements STOFFListener.

close a section

Implements STOFFListener.

closes this sheet

Referenced by endDocument().

close a cell

Referenced by openSheetCell().

closes this row

closes this table

Implements STOFFListener.

Referenced by _endSubDocument(), and endDocument().

close a cell

Implements STOFFListener.

Referenced by addEmptyTableCell(), and openTableCell().

closes this row

Implements STOFFListener.

void STOFFSpreadsheetListener::defineStyle ( STOFFFont const &  style) [virtual]

defines a font styles

Implements STOFFListener.

void STOFFSpreadsheetListener::defineStyle ( STOFFGraphicStyle const &  style) [virtual]

defines a graphic styles

Implements STOFFListener.

void STOFFSpreadsheetListener::defineStyle ( STOFFParagraph const &  style) [virtual]

defines a paragraph styles

Implements STOFFListener.

void STOFFSpreadsheetListener::endDocument ( bool  sendDelayedSubDoc = true) [virtual]

ends the document

Implements STOFFListener.

STOFFFont const & STOFFSpreadsheetListener::getFont ( ) const [virtual]

returns the actual font

Implements STOFFListener.

returns the current page span

Note:
this forces the opening of a new page if no page is opened.

Implements STOFFListener.

returns the actual paragraph

Implements STOFFListener.

returns the actual section

Implements STOFFListener.

Type STOFFSpreadsheetListener::getType ( ) const [inline, virtual]

returns the listener type

Implements STOFFListener.

void STOFFSpreadsheetListener::handleSubDocument ( STOFFSubDocumentPtr  subDocument,
libstoff::SubDocumentType  subDocumentType 
) [virtual]

function called to add a subdocument

Implements STOFFListener.

Referenced by insertComment(), insertFooterRegion(), insertHeaderRegion(), and insertNote().

inserts a break type: ColumBreak, PageBreak, ..

Implements STOFFListener.

void STOFFSpreadsheetListener::insertChar ( uint8_t  character) [virtual]

adds a basic character, ..

Implements STOFFListener.

void STOFFSpreadsheetListener::insertChart ( STOFFPosition const &  pos,
STOFFChart chart,
STOFFGraphicStyle const &  style = STOFFGraphicStyle() 
)

adds a chart in given position

void STOFFSpreadsheetListener::insertComment ( STOFFSubDocumentPtr subDocument,
librevenge::RVNGString const &  creator = "",
librevenge::RVNGString const &  date = "" 
) [virtual]

adds comment

Implements STOFFListener.

void STOFFSpreadsheetListener::insertEOL ( bool  softBreak = false) [virtual]

adds an end of line ( by default an hard one)

Implements STOFFListener.

void STOFFSpreadsheetListener::insertField ( STOFFField const &  field) [virtual]

adds a field type

Implements STOFFListener.

bool STOFFSpreadsheetListener::insertFooterRegion ( STOFFSubDocumentPtr  subDocument,
librevenge::RVNGString const &  which 
) [virtual]

insert a footer

Implements STOFFListener.

bool STOFFSpreadsheetListener::insertHeaderRegion ( STOFFSubDocumentPtr  subDocument,
librevenge::RVNGString const &  which 
) [virtual]

insert a header

Implements STOFFListener.

void STOFFSpreadsheetListener::insertNote ( STOFFNote const &  note,
STOFFSubDocumentPtr subDocument 
) [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 STOFFListener.

void STOFFSpreadsheetListener::insertPicture ( STOFFPosition const &  pos,
STOFFEmbeddedObject const &  picture,
STOFFGraphicStyle const &  style = STOFFGraphicStyle() 
) [virtual]

adds a picture with potential various representationin given position

Implements STOFFListener.

void STOFFSpreadsheetListener::insertShape ( STOFFGraphicShape const &  shape,
STOFFGraphicStyle const &  style,
STOFFPosition const &  pos 
) [virtual]

adds a shape picture in given position

Implements STOFFListener.

adds a tab

Implements STOFFListener.

void STOFFSpreadsheetListener::insertTable ( STOFFPosition const &  pos,
STOFFTable table,
STOFFGraphicStyle const &  style = STOFFGraphicStyle() 
)

adds a table in given position

void STOFFSpreadsheetListener::insertTextBox ( STOFFPosition const &  pos,
STOFFSubDocumentPtr  subDocument,
STOFFGraphicStyle const &  frameStyle = STOFFGraphicStyle() 
) [virtual]

adds a textbox in given position

Implements STOFFListener.

void STOFFSpreadsheetListener::insertUnicode ( uint32_t  character) [virtual]

adds an unicode character.

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

Implements STOFFListener.

Referenced by insertChar().

void STOFFSpreadsheetListener::insertUnicodeString ( librevenge::RVNGString const &  str) [virtual]

adds a unicode string

Implements STOFFListener.

returns true if a document is opened

Implements STOFFListener.

bool STOFFSpreadsheetListener::isFontStyleDefined ( librevenge::RVNGString const &  name) const [virtual]

check if a font style with a display name is already defined

Implements STOFFListener.

bool STOFFSpreadsheetListener::isGraphicStyleDefined ( librevenge::RVNGString const &  name) const [virtual]

check if a graphic style with a display name is already defined

Implements STOFFListener.

returns true if the header/footer is open

Implements STOFFListener.

returns true if a page is opened

Implements STOFFListener.

returns true if a paragraph or a list is opened

Implements STOFFListener.

bool STOFFSpreadsheetListener::isParagraphStyleDefined ( librevenge::RVNGString const &  name) const [virtual]

check if a paragraph style with a display name is already defined

Implements STOFFListener.

bool STOFFSpreadsheetListener::isSectionOpened ( ) const [inline, virtual]

returns true if a section is opened

Implements STOFFListener.

returns try if a subdocument is open

Implements STOFFListener.

bool STOFFSpreadsheetListener::openFooter ( librevenge::RVNGPropertyList const &  extras) [virtual]

open a footer (interaction with STOFFPageSpan which fills the parameters for openFooter)

Implements STOFFListener.

bool STOFFSpreadsheetListener::openFrame ( STOFFPosition const &  pos,
STOFFGraphicStyle const &  style = STOFFGraphicStyle() 
) [virtual]

tries to open a frame

Implements STOFFListener.

Referenced by insertPicture(), and insertTable().

bool STOFFSpreadsheetListener::openGroup ( STOFFPosition const &  pos) [virtual]

open a group (not implemented)

Implements STOFFListener.

bool STOFFSpreadsheetListener::openHeader ( librevenge::RVNGPropertyList const &  extras) [virtual]

open a header (interaction with STOFFPageSpan which fills the parameters for openHeader)

Implements STOFFListener.

void STOFFSpreadsheetListener::openLink ( STOFFLink const &  link) [virtual]

open a link

Implements STOFFListener.

bool STOFFSpreadsheetListener::openSection ( STOFFSection const &  section) [virtual]

open a section if possible

Implements STOFFListener.

void STOFFSpreadsheetListener::openSheet ( std::vector< float > const &  colWidth,
librevenge::RVNGUnit  unit,
std::vector< int > const &  repeatColWidthNumber = std::vector<int>(),
librevenge::RVNGString const &  name = "" 
)

open a sheet

void STOFFSpreadsheetListener::openSheetCell ( STOFFCell const &  cell,
STOFFCellContent const &  content,
int  numRepeated = 1 
)

open a cell

void STOFFSpreadsheetListener::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 STOFFSpreadsheetListener::openTable ( STOFFTable const &  table) [virtual]

open a table

Implements STOFFListener.

void STOFFSpreadsheetListener::openTableCell ( STOFFCell const &  cell) [virtual]

open a cell

Implements STOFFListener.

void STOFFSpreadsheetListener::openTableRow ( float  h,
librevenge::RVNGUnit  unit,
bool  headerRow = false 
) [virtual]

open a row with given height ( if h < 0.0, set min-row-height = -h )

Implements STOFFListener.

STOFFSpreadsheetListener& STOFFSpreadsheetListener::operator= ( const STOFFSpreadsheetListener ) [private]

operator= (unimplemented)

void STOFFSpreadsheetListener::setDocumentLanguage ( std::string  locale) [virtual]

sets the document language

Implements STOFFListener.

void STOFFSpreadsheetListener::setDocumentMetaData ( const librevenge::RVNGPropertyList &  list) [virtual]

sets the document meta data

Implements STOFFListener.

void STOFFSpreadsheetListener::setFont ( STOFFFont const &  font) [virtual]

sets the font

Implements STOFFListener.

void STOFFSpreadsheetListener::setParagraph ( STOFFParagraph const &  paragraph) [virtual]

sets the paragraph

Implements STOFFListener.

starts the document

Implements STOFFListener.

Referenced by _openPageSpan().


Member Data Documentation

stack of local state

Referenced by _popParsingState(), and _pushParsingState().


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