LotusSpreadsheet Class Reference documentation

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
LotusSpreadsheet Class Reference

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

`#include <LotusSpreadsheet.h>`

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

## Protected Member Functions
int | version () const
| return the file version More...
bool | hasSomeSpreadsheetData () const
| returns true if some spreadsheet are defined More...
void | sendSpreadsheet (int sheetId)
| send the data More...
void | sendRowContent (LotusSpreadsheetInternal::Spreadsheet const &sheet, int row, LotusSpreadsheetInternal::Table123Styles const *table123Styles)
| send the cell data in a row More...
void | sendCellContent (LotusSpreadsheetInternal::Cell const &cell, LotusSpreadsheetInternal::Style const &style, int numRepeated=1)
| send the cell data More...
void | sendText (RVNGInputStreamPtr &input, long endPos, LotusSpreadsheetInternal::Style const &style) const
| try to send a formated text More...
void | sendTextNote (RVNGInputStreamPtr &input, WPSEntry const &entry) const
| try to send a note More...
bool | readSheetName (shared_ptr< WPSStream > stream)
| reads a sheet name: zone 0x23 More...
bool | readSheetName1B (shared_ptr< WPSStream > stream, long endPos)
| reads a sheet name: zone 0x1b 36b0 More...
bool | readCellsFormat801 (shared_ptr< WPSStream > stream, WPSVec3i const &minC, WPSVec3i const &maxC)
| reads a cell zone formats: zone 801, lotus 123 More...
bool | readColumnDefinition (shared_ptr< WPSStream > stream)
| reads the columns definitions More...
bool | readColumnSizes (shared_ptr< WPSStream > stream)
| reads the column sizes ( in char ) More...
bool | readRowFormats (shared_ptr< WPSStream > stream)
| reads the row formats More...
bool | readRowFormat (shared_ptr< WPSStream > stream, LotusSpreadsheetInternal::Style &style, int &numCell, long endPos)
| reads a cell's row format More...
bool | readRowSizes (shared_ptr< WPSStream > stream, long endPos)
| reads the row size ( in pt*32 ) More...
bool | readCell (shared_ptr< WPSStream > stream)
| reads a cell More...
bool | readCellName (shared_ptr< WPSStream > stream)
| reads a cell or list of cell name More...
bool | readSheetHeader (shared_ptr< WPSStream > stream)
| try to read a sheet header: 0xc3 More...
bool | readExtraRowFormats (shared_ptr< WPSStream > stream)
| try to read an extra row format: 0xc5 More...
bool | readNote (shared_ptr< WPSStream > stream, long endPos)
| try to read a note: subZone id 9065 More...
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 std::string | getDebugStringForText (std::string const &text)
| small debug function used to print text with format sequence More...

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

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

## 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

## § ~LotusSpreadsheet()

LotusSpreadsheet::~LotusSpreadsheet | ( |  | ) |

destructor

## § LotusSpreadsheet() [2/2]

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

## 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

## § hasSomeSpreadsheetData()

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

returns true if some spreadsheet are defined

## § operator=()

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

## § readCell() [1/2]

bool LotusSpreadsheet::readCell | ( | 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 | ( | shared_ptr< WPSStream > | stream | ) |
| protected

reads a cell or list of cell name

## § readCellsFormat801()

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

reads a cell zone formats: zone 801, lotus 123

## § readColumnDefinition()

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

reads the columns definitions

## § readColumnSizes()

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

reads the column sizes ( in char )

## § readExtraRowFormats()

bool LotusSpreadsheet::readExtraRowFormats | ( | 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 | ( | shared_ptr< WPSStream > | stream,
|  | long | endPos
| ) |  |
| protected

try to read a note: subZone id 9065

## § readRowFormat()

bool LotusSpreadsheet::readRowFormat | ( | 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 | ( | shared_ptr< WPSStream > | stream | ) |
| protected

reads the row formats

## § readRowSizes()

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

reads the row size ( in pt*32 )

## § readSheetHeader()

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

try to read a sheet header: 0xc3

## § readSheetName()

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

reads a sheet name: zone 0x23

## § readSheetName1B()

bool LotusSpreadsheet::readSheetName1B | ( | 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(), and readRowFormat().

## Friends And Related Function Documentation

## § LotusParser

friend class LotusParser
| friend

## § LotusSpreadsheetInternal::SubDocument

friend class LotusSpreadsheetInternal::SubDocument
| friend

## Member Data Documentation

## § m_listener

shared_ptr<WKSContentListener> LotusSpreadsheet::m_listener
| private

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

## § m_mainParser

LotusParser& LotusSpreadsheet::m_mainParser
| private

the listener (if set)

the main parser

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

## § m_state

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

the internal state

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

## § m_styleManager

shared_ptr<LotusStyleManager> LotusSpreadsheet::m_styleManager
| private

the style manager

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

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

- LotusSpreadsheet.h
- LotusSpreadsheet.cpp