LotusSpreadsheet Class Reference documentation

LotusSpreadsheet Class Reference

This class parses Microsoft Works spreadsheet file. More...

`#include <LotusSpreadsheet.h>`

## Public Member Functions
| LotusSpreadsheet (LotusParser &parser)
| constructor
| ~LotusSpreadsheet ()
| destructor
void | cleanState ()
| clean internal state
void | updateState ()
| update internal state (must be called one time before sending data)
void | setListener (WKSContentListenerPtr &listen)
| sets the listener
void | setLastSpreadsheetId (int id)
| set the last spreadsheet number ( default 0)
bool | getLeftTopPosition (Vec2i const &cell, int spreadsheet, Vec2f &pos)
| returns the left top position of a cell

## Protected Member Functions
int | version () const
| return the file version
bool | hasSomeSpreadsheetData () const
| returns true if some spreadsheet are defined
void | sendSpreadsheet (int sheetId)
| send the data
librevenge::RVNGString | getSheetName (int id) const
| returns the name of the id's spreadsheet
void | sendRowContent (LotusSpreadsheetInternal::Spreadsheet const &sheet, int row, LotusSpreadsheetInternal::Table123Styles const *table123Styles)
| send the cell data in a row
void | sendCellContent (LotusSpreadsheetInternal::Cell const &cell, LotusSpreadsheetInternal::Style const &style, int numRepeated=1)
| send the cell data
void | sendText (RVNGInputStreamPtr &input, long endPos, LotusSpreadsheetInternal::Style const &style) const
| try to send a formated text
void | sendTextNote (RVNGInputStreamPtr &input, WPSEntry const &entry) const
| try to send a note
bool | readSheetName (std::shared_ptr< WPSStream > stream)
| reads a sheet name: zone 0x23
bool | readSheetName1B (std::shared_ptr< WPSStream > stream, long endPos)
| reads a sheet name: zone 0x1b 36b0
bool | readCellsFormat801 (std::shared_ptr< WPSStream > stream, WPSVec3i const &minC, WPSVec3i const &maxC, int typeZone)
| reads a cell zone formats: zone 801, lotus 123
bool | readColumnDefinition (std::shared_ptr< WPSStream > stream)
| reads the columns definitions
bool | readColumnSizes (std::shared_ptr< WPSStream > stream)
| reads the column sizes ( in char )
bool | readRowFormats (std::shared_ptr< WPSStream > stream)
| reads the row formats
bool | readRowFormat (std::shared_ptr< WPSStream > stream, LotusSpreadsheetInternal::Style &style, int &numCell, long endPos)
| reads a cell's row format
bool | readRowSizes (std::shared_ptr< WPSStream > stream, long endPos)
| reads the row size ( in pt*32 )
bool | readCell (std::shared_ptr< WPSStream > stream)
| reads a cell
bool | readCellName (std::shared_ptr< WPSStream > stream)
| reads a cell or list of cell name
bool | readSheetHeader (std::shared_ptr< WPSStream > stream)
| try to read a sheet header: 0xc3
bool | readExtraRowFormats (std::shared_ptr< WPSStream > stream)
| try to read an extra row format: 0xc5
bool | readCell (WPSStream &stream, int sId, bool isList, WKSContentListener::FormulaInstruction &instr)
bool | readFormula (WPSStream &stream, long endPos, int sId, bool newFormula, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)

## Static Protected Member Functions
static bool | readNote (std::shared_ptr< WPSStream > stream, long endPos)
| try to read a note: subZone id 9065
static bool | parseVariable (std::string const &variable, WKSContentListener::FormulaInstruction &instr)
static std::string | getDebugStringForText (std::string const &text)
| small debug function used to print text with format sequence

## Private Member Functions
| LotusSpreadsheet (LotusSpreadsheet const &orig)=delete
LotusSpreadsheet & | operator= (LotusSpreadsheet const &orig)=delete

## Private Attributes
std::shared_ptr< WKSContentListener > | m_listener
LotusParser & | m_mainParser
| the listener (if set)
std::shared_ptr< LotusStyleManager > | m_styleManager
| the style manager
std::shared_ptr< LotusSpreadsheetInternal::State > | m_state
| the internal state

## Friends
class | LotusParser
class | LotusSpreadsheetInternal::SubDocument

## Detailed Description

This class parses Microsoft Works spreadsheet file.

## Constructor & Destructor Documentation

## ◆ LotusSpreadsheet() [1/2]

LotusSpreadsheet::LotusSpreadsheet | ( | LotusParser & | parser | ) |
| explicit

constructor

Referenced by LotusSpreadsheet(), and operator=().

## ◆ ~LotusSpreadsheet()

LotusSpreadsheet::~LotusSpreadsheet | ( |  | ) |

destructor

## ◆ LotusSpreadsheet() [2/2]

LotusSpreadsheet::LotusSpreadsheet | ( | LotusSpreadsheet const & | orig | ) |
| privatedelete

## Member Function Documentation

## ◆ cleanState()

void LotusSpreadsheet::cleanState | ( |  | ) |

clean internal state

## ◆ getDebugStringForText()

std::string LotusSpreadsheet::getDebugStringForText | ( | std::string const & | text | ) |
| staticprotected

small debug function used to print text with format sequence

Referenced by readCell(), and readNote().

## ◆ getLeftTopPosition()

bool LotusSpreadsheet::getLeftTopPosition | ( | Vec2i const & | cell,
|  | int | spreadsheet,
|  | Vec2f & | pos )

returns the left top position of a cell

## ◆ getSheetName()

librevenge::RVNGString LotusSpreadsheet::getSheetName | ( | int | id | ) | const
| protected

returns the name of the id's spreadsheet

Referenced by readCell(), readFormula(), and sendSpreadsheet().

## ◆ hasSomeSpreadsheetData()

bool LotusSpreadsheet::hasSomeSpreadsheetData | ( |  | ) | const
| protected

returns true if some spreadsheet are defined

## ◆ operator=()

LotusSpreadsheet & LotusSpreadsheet::operator= | ( | LotusSpreadsheet const & | orig | ) |
| privatedelete

## ◆ parseVariable()

bool LotusSpreadsheet::parseVariable | ( | std::string const & | variable,
|  | WKSContentListener::FormulaInstruction & | instr )
| staticprotected

Referenced by readFormula().

## ◆ readCell() [1/2]

bool LotusSpreadsheet::readCell | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads a cell

Referenced by readFormula().

## ◆ readCell() [2/2]

bool LotusSpreadsheet::readCell | ( | WPSStream & | stream,
|  | int | sId,
|  | bool | isList,
|  | WKSContentListener::FormulaInstruction & | instr )
| protected

## ◆ readCellName()

bool LotusSpreadsheet::readCellName | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads a cell or list of cell name

## ◆ readCellsFormat801()

bool LotusSpreadsheet::readCellsFormat801 | ( | std::shared_ptr< WPSStream > | stream,
|  | WPSVec3i const & | minC,
|  | WPSVec3i const & | maxC,
|  | int | typeZone )
| protected

reads a cell zone formats: zone 801, lotus 123

## ◆ readColumnDefinition()

bool LotusSpreadsheet::readColumnDefinition | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads the columns definitions

## ◆ readColumnSizes()

bool LotusSpreadsheet::readColumnSizes | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads the column sizes ( in char )

## ◆ readExtraRowFormats()

bool LotusSpreadsheet::readExtraRowFormats | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

try to read an extra row format: 0xc5

## ◆ readFormula()

bool LotusSpreadsheet::readFormula | ( | WPSStream & | stream,
|  | long | endPos,
|  | int | sId,
|  | bool | newFormula,
|  | std::vector< WKSContentListener::FormulaInstruction > & | formula,
|  | std::string & | error )
| protected

Referenced by readCell().

## ◆ readNote()

bool LotusSpreadsheet::readNote | ( | std::shared_ptr< WPSStream > | stream,
|  | long | endPos )
| staticprotected

try to read a note: subZone id 9065

## ◆ readRowFormat()

bool LotusSpreadsheet::readRowFormat | ( | std::shared_ptr< WPSStream > | stream,
|  | LotusSpreadsheetInternal::Style & | style,
|  | int & | numCell,
|  | long | endPos )
| protected

reads a cell's row format

Referenced by readRowFormats().

## ◆ readRowFormats()

bool LotusSpreadsheet::readRowFormats | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads the row formats

## ◆ readRowSizes()

bool LotusSpreadsheet::readRowSizes | ( | std::shared_ptr< WPSStream > | stream,
|  | long | endPos )
| protected

reads the row size ( in pt*32 )

## ◆ readSheetHeader()

bool LotusSpreadsheet::readSheetHeader | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

try to read a sheet header: 0xc3

## ◆ readSheetName()

bool LotusSpreadsheet::readSheetName | ( | std::shared_ptr< WPSStream > | stream | ) |
| protected

reads a sheet name: zone 0x23

## ◆ readSheetName1B()

bool LotusSpreadsheet::readSheetName1B | ( | std::shared_ptr< WPSStream > | stream,
|  | long | endPos )
| protected

reads a sheet name: zone 0x1b 36b0

## ◆ sendCellContent()

void LotusSpreadsheet::sendCellContent | ( | LotusSpreadsheetInternal::Cell const & | cell,
|  | LotusSpreadsheetInternal::Style const & | style,
|  | int | numRepeated = 1 )
| protected

send the cell data

Referenced by sendRowContent().

## ◆ sendRowContent()

void LotusSpreadsheet::sendRowContent | ( | LotusSpreadsheetInternal::Spreadsheet const & | sheet,
|  | int | row,
|  | LotusSpreadsheetInternal::Table123Styles const * | table123Styles )
| protected

send the cell data in a row

Note
  this function does not call openSheetRow, closeSheetRow

Referenced by sendSpreadsheet().

## ◆ sendSpreadsheet()

void LotusSpreadsheet::sendSpreadsheet | ( | int | sheetId | ) |
| protected

send the data

## ◆ sendText()

void LotusSpreadsheet::sendText | ( | RVNGInputStreamPtr & | input,
|  | long | endPos,
|  | LotusSpreadsheetInternal::Style const & | style ) const
| protected

try to send a formated text

Referenced by sendCellContent().

## ◆ sendTextNote()

void LotusSpreadsheet::sendTextNote | ( | RVNGInputStreamPtr & | input,
|  | WPSEntry const & | entry ) const
| protected

try to send a note

## ◆ setLastSpreadsheetId()

void LotusSpreadsheet::setLastSpreadsheetId | ( | int | id | ) |

set the last spreadsheet number ( default 0)

## ◆ setListener()

void LotusSpreadsheet::setListener | ( | WKSContentListenerPtr & | listen | ) |
| inline

sets the listener

## ◆ updateState()

void LotusSpreadsheet::updateState | ( |  | ) |

update internal state (must be called one time before sending data)

## ◆ version()

int LotusSpreadsheet::version | ( |  | ) | const
| protected

return the file version

Referenced by readCellsFormat801(), readFormula(), and readRowFormat().

## Friends And Related Symbol Documentation

## ◆ LotusParser

friend class LotusParser
| friend

Referenced by LotusParser, LotusSpreadsheet(), and LotusSpreadsheetInternal::SubDocument.

## ◆ LotusSpreadsheetInternal::SubDocument

friend class LotusSpreadsheetInternal::SubDocument
| friend

## Member Data Documentation

## ◆ m_listener

std::shared_ptr<WKSContentListener> LotusSpreadsheet::m_listener
| private

Referenced by LotusSpreadsheet(), sendCellContent(), sendRowContent(), sendSpreadsheet(), sendText(), sendTextNote(), and setListener().

## ◆ m_mainParser

LotusParser& LotusSpreadsheet::m_mainParser
| private

the listener (if set)

the main parser

Referenced by LotusSpreadsheet(), readRowFormats(), readSheetName(), readSheetName1B(), sendRowContent(), sendSpreadsheet(), sendTextNote(), and version().

## ◆ m_state

std::shared_ptr<LotusSpreadsheetInternal::State> LotusSpreadsheet::m_state
| private

the internal state

Referenced by cleanState(), getLeftTopPosition(), getSheetName(), hasSomeSpreadsheetData(), LotusSpreadsheet(), readCell(), readCellName(), readCellsFormat801(), readColumnDefinition(), readColumnSizes(), readExtraRowFormats(), readFormula(), readRowFormats(), readRowSizes(), readSheetHeader(), readSheetName(), readSheetName1B(), sendRowContent(), sendSpreadsheet(), setLastSpreadsheetId(), updateState(), and version().

## ◆ m_styleManager

std::shared_ptr<LotusStyleManager> LotusSpreadsheet::m_styleManager
| private

the style manager

Referenced by LotusSpreadsheet(), readCellsFormat801(), readExtraRowFormats(), readRowFormat(), sendRowContent(), and sendText().

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

- LotusSpreadsheet.h
- LotusSpreadsheet.cpp