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 |
This class parses Microsoft Works spreadsheet file.
|
explicit |
constructor
Referenced by LotusSpreadsheet(), and operator=().
LotusSpreadsheet::~LotusSpreadsheet | ( | ) |
destructor
|
privatedelete |
void LotusSpreadsheet::cleanState | ( | ) |
clean internal state
|
staticprotected |
small debug function used to print text with format sequence
Referenced by readCell(), and readNote().
returns the left top position of a cell
|
protected |
returns the name of the id's spreadsheet
Referenced by readCell(), readFormula(), and sendSpreadsheet().
|
protected |
returns true if some spreadsheet are defined
|
privatedelete |
|
staticprotected |
Referenced by readFormula().
|
protected |
reads a cell
Referenced by readFormula().
|
protected |
|
protected |
reads a cell or list of cell name
|
protected |
reads a cell zone formats: zone 801, lotus 123
|
protected |
reads the columns definitions
|
protected |
reads the column sizes ( in char )
|
protected |
try to read an extra row format: 0xc5
|
protected |
Referenced by readCell().
|
staticprotected |
try to read a note: subZone id 9065
|
protected |
reads a cell's row format
Referenced by readRowFormats().
|
protected |
reads the row formats
|
protected |
reads the row size ( in pt*32 )
|
protected |
try to read a sheet header: 0xc3
|
protected |
reads a sheet name: zone 0x23
|
protected |
reads a sheet name: zone 0x1b 36b0
|
protected |
send the cell data
Referenced by sendRowContent().
|
protected |
send the cell data in a row
Referenced by sendSpreadsheet().
|
protected |
send the data
|
protected |
try to send a formated text
Referenced by sendCellContent().
|
protected |
try to send a note
void LotusSpreadsheet::setLastSpreadsheetId | ( | int | id | ) |
set the last spreadsheet number ( default 0)
|
inline |
sets the listener
void LotusSpreadsheet::updateState | ( | ) |
update internal state (must be called one time before sending data)
|
protected |
return the file version
Referenced by readCellsFormat801(), readFormula(), and readRowFormat().
|
friend |
Referenced by LotusParser, LotusSpreadsheet(), and LotusSpreadsheetInternal::SubDocument.
|
friend |
|
private |
Referenced by LotusSpreadsheet(), sendCellContent(), sendRowContent(), sendSpreadsheet(), sendText(), sendTextNote(), and setListener().
|
private |
the listener (if set)
the main parser
Referenced by LotusSpreadsheet(), readRowFormats(), readSheetName(), readSheetName1B(), sendRowContent(), sendSpreadsheet(), sendTextNote(), and version().
|
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().
|
private |
the style manager
Referenced by LotusSpreadsheet(), readCellsFormat801(), readExtraRowFormats(), readRowFormat(), sendRowContent(), and sendText().