WKSContentListener Class Reference

#include <WKSContentListener.h>

Inheritance diagram for WKSContentListener:
WPSListener

Classes

struct  CellContent
 small class use to define a sheet cell content More...
 
struct  FormulaInstruction
 small class use to define a formula instruction More...
 

Public Member Functions

 WKSContentListener (std::vector< WPSPageSpan > const &pageList, librevenge::RVNGSpreadsheetInterface *documentInterface)
 
virtual ~WKSContentListener ()
 
void setDocumentLanguage (int lcid)
 
void setMetaData (const librevenge::RVNGPropertyList &list)
 
void startDocument ()
 
void endDocument ()
 
void handleSubDocument (WPSSubDocumentPtr &subDocument, libwps::SubDocumentType subDocumentType)
 
void insertCharacter (uint8_t character)
 adds a basic 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 an unicode character to a string ( with correct encoding ). More...
 
void insertEOL (bool softBreak=false)
 
void insertBreak (const uint8_t breakType)
 
void setFont (const WPSFont &font)
 set the actual font More...
 
WPSFont const & getFont () const
 returns the actual font More...
 
bool isParagraphOpened () const
 returns true if a paragraph or a list is opened More...
 
void setParagraph (const WPSParagraph &para)
 sets the actual paragraph More...
 
WPSParagraph const & getParagraph () const
 returns the actual paragraph More...
 
void insertField (WPSField const &field)
 adds a field More...
 
void insertComment (WPSSubDocumentPtr &subDocument)
 adds comment More...
 
void insertPicture (WPSPosition const &pos, const librevenge::RVNGBinaryData &binaryData, std::string type="image/pict", WPSGraphicStyle const &style=WPSGraphicStyle::emptyStyle())
 adds a picture in given position More...
 
void insertObject (WPSPosition const &pos, const WPSEmbeddedObject &obj, WPSGraphicStyle const &style=WPSGraphicStyle::emptyStyle())
 adds an object with replacement picture in given position More...
 
void insertPicture (WPSPosition const &pos, WPSGraphicShape const &shape, WPSGraphicStyle const &style)
 adds a picture in given position More...
 
void insertTextBox (WPSPosition const &pos, WPSSubDocumentPtr subDocument, WPSGraphicStyle const &frameStyle=WPSGraphicStyle::emptyStyle())
 adds a textbox in given position More...
 
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 More...
 
void closeSheet ()
 closes this sheet More...
 
void openSheetRow (float h, librevenge::RVNGUnit unit, bool headerRow=false, int numRepeated=1)
 open a row with given height. More...
 
void closeSheetRow ()
 closes this row More...
 
void openSheetCell (WPSCell const &cell, CellContent const &content, int numRepeated=1)
 low level function to define a cell. More...
 
void closeSheetCell ()
 close a cell More...
 
- Public Member Functions inherited from WPSListener
 WPSListener ()
 
virtual ~WPSListener ()
 

Protected Member Functions

void _openPageSpan ()
 
void _closePageSpan ()
 
void _handleFrameParameters (librevenge::RVNGPropertyList &propList, WPSPosition const &pos)
 
bool _openFrame (WPSPosition const &pos, WPSGraphicStyle const &style)
 
void _closeFrame ()
 
void _startSubDocument ()
 
void _endSubDocument ()
 
void _openParagraph ()
 
void _closeParagraph ()
 
void _appendParagraphProperties (librevenge::RVNGPropertyList &propList, const bool isListElement=false)
 
void _resetParagraphState (const bool isListElement=false)
 
void _openSpan ()
 
void _closeSpan ()
 
void _flushText ()
 
void _flushDeferredTabs ()
 
void _insertBreakIfNecessary (librevenge::RVNGPropertyList &propList)
 
shared_ptr< WKSContentParsingState_pushParsingState ()
 creates a new parsing state (copy of the actual state) More...
 
void _popParsingState ()
 resets the previous parsing state More...
 

Protected Attributes

shared_ptr< WKSDocumentParsingStatem_ds
 
shared_ptr< WKSContentParsingStatem_ps
 
std::vector< shared_ptr< WKSContentParsingState > > m_psStack
 
librevenge::RVNGSpreadsheetInterface * m_documentInterface
 

Private Member Functions

 WKSContentListener (const WKSContentListener &)
 
WKSContentListeneroperator= (const WKSContentListener &)
 

Constructor & Destructor Documentation

§ WKSContentListener() [1/2]

WKSContentListener::WKSContentListener ( std::vector< WPSPageSpan > const &  pageList,
librevenge::RVNGSpreadsheetInterface *  documentInterface 
)

§ ~WKSContentListener()

WKSContentListener::~WKSContentListener ( )
virtual

§ WKSContentListener() [2/2]

WKSContentListener::WKSContentListener ( const WKSContentListener )
private

Member Function Documentation

§ _appendParagraphProperties()

void WKSContentListener::_appendParagraphProperties ( librevenge::RVNGPropertyList &  propList,
const bool  isListElement = false 
)
protected

Referenced by _openParagraph().

§ _closeFrame()

void WKSContentListener::_closeFrame ( )
protected

§ _closePageSpan()

void WKSContentListener::_closePageSpan ( )
protected

Referenced by endDocument().

§ _closeParagraph()

void WKSContentListener::_closeParagraph ( )
protected

§ _closeSpan()

void WKSContentListener::_closeSpan ( )
protected

§ _endSubDocument()

void WKSContentListener::_endSubDocument ( )
protected

Referenced by closeSheet(), and handleSubDocument().

§ _flushDeferredTabs()

void WKSContentListener::_flushDeferredTabs ( )
protected

§ _flushText()

void WKSContentListener::_flushText ( )
protected

§ _handleFrameParameters()

void WKSContentListener::_handleFrameParameters ( librevenge::RVNGPropertyList &  propList,
WPSPosition const &  pos 
)
protected

§ _insertBreakIfNecessary()

void WKSContentListener::_insertBreakIfNecessary ( librevenge::RVNGPropertyList &  propList)
protected

§ _openFrame()

bool WKSContentListener::_openFrame ( WPSPosition const &  pos,
WPSGraphicStyle const &  style 
)
protected

§ _openPageSpan()

void WKSContentListener::_openPageSpan ( )
protected

Referenced by _openParagraph(), and openSheet().

§ _openParagraph()

void WKSContentListener::_openParagraph ( )
protected

§ _openSpan()

void WKSContentListener::_openSpan ( )
protected

§ _popParsingState()

void WKSContentListener::_popParsingState ( )
protected

resets the previous parsing state

Referenced by closeSheet(), and handleSubDocument().

§ _pushParsingState()

shared_ptr< WKSContentParsingState > WKSContentListener::_pushParsingState ( )
protected

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

Returns
the old one

Referenced by handleSubDocument(), and openSheet().

§ _resetParagraphState()

void WKSContentListener::_resetParagraphState ( const bool  isListElement = false)
protected

Referenced by _openParagraph().

§ _startSubDocument()

void WKSContentListener::_startSubDocument ( )
protected

Referenced by handleSubDocument(), and openSheet().

§ closeSheet()

void WKSContentListener::closeSheet ( )

closes this sheet

Referenced by _endSubDocument(), and endDocument().

§ closeSheetCell()

void WKSContentListener::closeSheetCell ( )

close a cell

Referenced by openSheetCell().

§ closeSheetRow()

void WKSContentListener::closeSheetRow ( )

closes this row

§ endDocument()

void WKSContentListener::endDocument ( )

§ getFont()

WPSFont const & WKSContentListener::getFont ( ) const
virtual

returns the actual font

Implements WPSListener.

§ getParagraph()

WPSParagraph const & WKSContentListener::getParagraph ( ) const
virtual

returns the actual paragraph

Implements WPSListener.

§ handleSubDocument()

void WKSContentListener::handleSubDocument ( WPSSubDocumentPtr subDocument,
libwps::SubDocumentType  subDocumentType 
)

§ insertBreak()

void WKSContentListener::insertBreak ( const uint8_t  breakType)
virtual

Implements WPSListener.

§ insertCharacter()

void WKSContentListener::insertCharacter ( uint8_t  character)
virtual

adds a basic character, ..

Implements WPSListener.

§ insertComment()

void WKSContentListener::insertComment ( WPSSubDocumentPtr subDocument)

adds comment

§ insertEOL()

void WKSContentListener::insertEOL ( bool  softBreak = false)
virtual

Implements WPSListener.

§ insertField()

void WKSContentListener::insertField ( WPSField const &  field)
virtual

adds a field

Implements WPSListener.

§ insertObject()

void WKSContentListener::insertObject ( WPSPosition const &  pos,
const WPSEmbeddedObject obj,
WPSGraphicStyle const &  style = WPSGraphicStyle::emptyStyle() 
)

adds an object with replacement picture in given position

Referenced by insertPicture().

§ insertPicture() [1/2]

void WKSContentListener::insertPicture ( WPSPosition const &  pos,
const librevenge::RVNGBinaryData &  binaryData,
std::string  type = "image/pict",
WPSGraphicStyle const &  style = WPSGraphicStyle::emptyStyle() 
)

adds a picture in given position

Referenced by insertObject(), and insertTextBox().

§ insertPicture() [2/2]

void WKSContentListener::insertPicture ( WPSPosition const &  pos,
WPSGraphicShape const &  shape,
WPSGraphicStyle const &  style 
)

adds a picture in given position

§ insertTab()

void WKSContentListener::insertTab ( )
virtual

adds an unicode character to a string ( with correct encoding ).

Implements WPSListener.

§ insertTextBox()

void WKSContentListener::insertTextBox ( WPSPosition const &  pos,
WPSSubDocumentPtr  subDocument,
WPSGraphicStyle const &  frameStyle = WPSGraphicStyle::emptyStyle() 
)

adds a textbox in given position

Referenced by insertComment().

§ insertUnicode()

void WKSContentListener::insertUnicode ( uint32_t  character)
virtual

adds an unicode character

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

Implements WPSListener.

Referenced by insertCharacter().

§ insertUnicodeString()

void WKSContentListener::insertUnicodeString ( librevenge::RVNGString const &  str)
virtual

adds a unicode string

Implements WPSListener.

Referenced by insertField().

§ isParagraphOpened()

bool WKSContentListener::isParagraphOpened ( ) const
virtual

returns true if a paragraph or a list is opened

Implements WPSListener.

§ openSheet()

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

open a sheet

§ openSheetCell()

void WKSContentListener::openSheetCell ( WPSCell const &  cell,
WKSContentListener::CellContent const &  content,
int  numRepeated = 1 
)

low level function to define a cell.

Parameters
cellthe cell position, alignement, ...
contentthe cell content
numRepeatedthe cell columns repeatition

§ openSheetRow()

void WKSContentListener::openSheetRow ( float  h,
librevenge::RVNGUnit  unit,
bool  headerRow = false,
int  numRepeated = 1 
)

open a row with given height.

If h<0, use min-row-heigth

§ operator=()

WKSContentListener& WKSContentListener::operator= ( const WKSContentListener )
private

§ setDocumentLanguage()

void WKSContentListener::setDocumentLanguage ( int  lcid)
virtual

Implements WPSListener.

§ setFont()

void WKSContentListener::setFont ( const WPSFont font)
virtual

set the actual font

Implements WPSListener.

§ setMetaData()

void WKSContentListener::setMetaData ( const librevenge::RVNGPropertyList &  list)

§ setParagraph()

void WKSContentListener::setParagraph ( const WPSParagraph para)
virtual

sets the actual paragraph

Implements WPSListener.

§ startDocument()

void WKSContentListener::startDocument ( )

Referenced by _openPageSpan().

Member Data Documentation

§ m_documentInterface

§ m_ds

§ m_ps

§ m_psStack

std::vector<shared_ptr<WKSContentParsingState> > WKSContentListener::m_psStack
protected

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

Generated on Wed Oct 26 2016 16:54:38 for libwps by doxygen 1.8.12