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, int typeZone)
 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)
 
LotusSpreadsheetoperator= (LotusSpreadsheet const &orig)
 

Private Attributes

shared_ptr< WKSContentListenerm_listener
 
LotusParserm_mainParser
 the listener (if set) More...
 
shared_ptr< LotusStyleManagerm_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::LotusSpreadsheet ( LotusParser parser)
explicit

constructor

LotusSpreadsheet::~LotusSpreadsheet ( )

destructor

LotusSpreadsheet::LotusSpreadsheet ( LotusSpreadsheet const &  orig)
private

Member Function Documentation

void LotusSpreadsheet::cleanState ( )

clean internal state

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

small debug function used to print text with format sequence

Referenced by readCell(), and readNote().

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

returns the left top position of a cell

bool LotusSpreadsheet::hasSomeSpreadsheetData ( ) const
protected

returns true if some spreadsheet are defined

LotusSpreadsheet& LotusSpreadsheet::operator= ( LotusSpreadsheet const &  orig)
private
bool LotusSpreadsheet::readCell ( shared_ptr< WPSStream stream)
protected

reads a cell

Referenced by readFormula().

bool LotusSpreadsheet::readCell ( WPSStream stream,
int  sId,
bool  isList,
WKSContentListener::FormulaInstruction instr 
)
protected
bool LotusSpreadsheet::readCellName ( shared_ptr< WPSStream stream)
protected

reads a cell or list of cell name

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

reads a cell zone formats: zone 801, lotus 123

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

reads the columns definitions

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

reads the column sizes ( in char )

bool LotusSpreadsheet::readExtraRowFormats ( shared_ptr< WPSStream stream)
protected

try to read an extra row format: 0xc5

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

Referenced by readCell().

bool LotusSpreadsheet::readNote ( shared_ptr< WPSStream stream,
long  endPos 
)
protected

try to read a note: subZone id 9065

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

reads a cell's row format

Referenced by readRowFormats().

bool LotusSpreadsheet::readRowFormats ( shared_ptr< WPSStream stream)
protected

reads the row formats

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

reads the row size ( in pt*32 )

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

try to read a sheet header: 0xc3

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

reads a sheet name: zone 0x23

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

reads a sheet name: zone 0x1b 36b0

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

send the cell data

Referenced by 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().

void LotusSpreadsheet::sendSpreadsheet ( int  sheetId)
protected

send the data

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

try to send a formated text

Referenced by sendCellContent().

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

try to send a note

Referenced by LotusSpreadsheetInternal::SubDocument::parse().

void LotusSpreadsheet::setLastSpreadsheetId ( int  id)

set the last spreadsheet number ( default 0)

void LotusSpreadsheet::setListener ( WKSContentListenerPtr listen)
inline

sets the listener

void LotusSpreadsheet::updateState ( )

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

int LotusSpreadsheet::version ( ) const
protected

return the file version

Referenced by readCellsFormat801(), and readRowFormat().

Friends And Related Function Documentation

friend class LotusParser
friend

Member Data Documentation

shared_ptr<WKSContentListener> LotusSpreadsheet::m_listener
private
LotusParser& LotusSpreadsheet::m_mainParser
private

the listener (if set)

the main parser

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

shared_ptr<LotusStyleManager> LotusSpreadsheet::m_styleManager
private

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

Generated on Sat Jul 29 2017 15:32:23 for libwps by doxygen 1.8.8