QuattroParser Class Referencefinal

This class parses Quattro Pro spreadsheet: .wb1, ..., .wb3. More...

#include <Quattro.h>

Inheritance diagram for QuattroParser:
WKSParser

Public Member Functions

 QuattroParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=nullptr)
 constructor
 ~QuattroParser () final
 destructor
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface) final
 called by WPSDocument to parse the file
bool checkHeader (WPSHeader *header, bool strict=false)
 checks if the document header is correct (or not)
Public Member Functions inherited from WKSParser
 WKSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
virtual ~WKSParser ()

Protected Member Functions

int version () const
 return the file version
libwps_tools_win::Font::Type getDefaultFontType () const
 returns the default font type, ie.
bool getExternalFileName (int fId, librevenge::RVNGString &fName) const
 returns the name of the fId file
bool getField (int fId, librevenge::RVNGString &text, QuattroFormulaInternal::CellReference &ref, librevenge::RVNGString const &fileName) const
 returns the text and cell of a field instruction
bool getColor (int id, WPSColor &color) const
 returns the color corresponding to an id
bool getFont (int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
 returns the font corresponding to an id
Vec2f getCellPosition (int sheetId, Vec2i const &cell) const
 returns the beginning position of a cell
bool sendPageGraphics (int sheetId) const
 send the page graphic corresponding to a sheet
bool sendGraphics (int sheetId, Vec2i const &cell) const
 send the graphic corresponding to a cell
std::shared_ptr< WKSContentListenercreateListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener
void sendHeaderFooter (bool header)
 send the header/footer
bool checkHeader (std::shared_ptr< WPSStream > stream, bool strict)
 checks if the document header is correct (or not)
bool readZones ()
 finds the different zones (spreadsheet, chart, print, ...)
bool readOLEZones (std::shared_ptr< WPSStream > &stream)
 finds the different OLE zones: wb2
bool readZone (std::shared_ptr< WPSStream > &stream)
 try to read a zone
bool readFieldName (std::shared_ptr< WPSStream > stream)
 read a list of field name + ...: zone b
bool readExternalData (std::shared_ptr< WPSStream > stream)
 read a external filename/name: zone 97,98
bool readFontDef (std::shared_ptr< WPSStream > stream)
 read a font: zone cf, fc and 110
bool readColorList (std::shared_ptr< WPSStream > stream)
 read a color lits: zone e8
bool readStyleName (std::shared_ptr< WPSStream > stream)
 read a style name: zone d0
bool readHeaderFooter (std::shared_ptr< WPSStream > stream, bool header)
 reads the header/footer: zone 25,26
bool readPaneAttribute (std::shared_ptr< WPSStream > stream)
 read the pane attribute: d1
bool readOptimizer (std::shared_ptr< WPSStream > stream)
 read the first optimizer zone: 103
bool readQueryCommand (std::shared_ptr< WPSStream > stream)
 read the table query command zone: 12f
bool readCString (std::shared_ptr< WPSStream > stream, librevenge::RVNGString &string, long maxSize)
 try to read a basic C string, knowing the maximum size
bool readBlockList (std::shared_ptr< WPSStream > stream)
 reads some cell reference list (potential followed by other data)
bool readZone341 (std::shared_ptr< WPSStream > stream)
 reads a big zone(chart?) which contains sub zones: 341
bool parseOLEStream (RVNGInputStreamPtr input, std::string const &avoid="")
 try to parse the OLE stream(except the main stream)
bool readOleLinkInfo (std::shared_ptr< WPSStream > stream, librevenge::RVNGString &link)
 try to read the link info sub stream
RVNGInputStreamPtr decodeStream (RVNGInputStreamPtr input, std::vector< uint8_t > const &key) const
 try to decode a stream, if successful, replace the stream'input by the new one
Protected Member Functions inherited from WKSParser
RVNGInputStreamPtrgetInput ()
void resetInput (RVNGInputStreamPtr const &newInput)
RVNGInputStreamPtr getFileInput ()
WPSHeaderPtrgetHeader ()
int version () const
void setVersion (int vers)
libwps::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document

Static Protected Member Functions

static bool readCellPosition (std::shared_ptr< WPSStream > stream)
 read the cell's position: zone 96
static bool readSerieExtension (std::shared_ptr< WPSStream > stream)
 read the serie extension zone: 2dc
static bool readOleBOlePart (std::shared_ptr< WPSStream > stream)
 try to read the BOlePart sub stream: a zone which contains 5 long

Protected Attributes

std::shared_ptr< WKSContentListenerm_listener
std::shared_ptr< QuattroParserInternal::Statem_state
 the listener (if set)
std::shared_ptr< QuattroGraphm_graphParser
 the graph manager
std::shared_ptr< QuattroSpreadsheetm_spreadsheetParser
 the spreadsheet manager

Friends

class QuattroParserInternal::SubDocument
class QuattroGraph
class QuattroSpreadsheet

Detailed Description

This class parses Quattro Pro spreadsheet: .wb1, ..., .wb3.

Constructor & Destructor Documentation

◆ QuattroParser()

QuattroParser::QuattroParser ( RVNGInputStreamPtr & input,
WPSHeaderPtr & header,
libwps_tools_win::Font::Type encoding = libwps_tools_win::Font::UNKNOWN,
char const * password = nullptr )

constructor

◆ ~QuattroParser()

QuattroParser::~QuattroParser ( )
final

destructor

Member Function Documentation

◆ checkHeader() [1/2]

bool QuattroParser::checkHeader ( std::shared_ptr< WPSStream > stream,
bool strict )
protected

checks if the document header is correct (or not)

◆ checkHeader() [2/2]

bool QuattroParser::checkHeader ( WPSHeader * header,
bool strict = false )

checks if the document header is correct (or not)

Referenced by checkHeader(), libwps::WPSDocument::isFileFormatSupported(), parse(), and QuattroSpreadsheet.

◆ createListener()

std::shared_ptr< WKSContentListener > QuattroParser::createListener ( librevenge::RVNGSpreadsheetInterface * interface)
protected

creates the main listener

Referenced by parse(), and QuattroSpreadsheet.

◆ decodeStream()

RVNGInputStreamPtr QuattroParser::decodeStream ( RVNGInputStreamPtr input,
std::vector< uint8_t > const & key ) const
protected

try to decode a stream, if successful, replace the stream'input by the new one

Referenced by QuattroSpreadsheet, and readZone().

◆ getCellPosition()

Vec2f QuattroParser::getCellPosition ( int sheetId,
Vec2i const & cell ) const
protected

returns the beginning position of a cell

Referenced by QuattroSpreadsheet.

◆ getColor()

bool QuattroParser::getColor ( int id,
WPSColor & color ) const
protected

returns the color corresponding to an id

Referenced by QuattroSpreadsheet, and readPaneAttribute().

◆ getDefaultFontType()

libwps_tools_win::Font::Type QuattroParser::getDefaultFontType ( ) const
protected

returns the default font type, ie.

the encoding given by the constructor if given or the encoding deduced from the version.

Referenced by parseOLEStream(), QuattroSpreadsheet, readCString(), and readFontDef().

◆ getExternalFileName()

bool QuattroParser::getExternalFileName ( int fId,
librevenge::RVNGString & fName ) const
protected

returns the name of the fId file

Referenced by QuattroSpreadsheet.

◆ getField()

bool QuattroParser::getField ( int fId,
librevenge::RVNGString & text,
QuattroFormulaInternal::CellReference & ref,
librevenge::RVNGString const & fileName ) const
protected

returns the text and cell of a field instruction

Referenced by QuattroSpreadsheet.

◆ getFont()

bool QuattroParser::getFont ( int id,
WPSFont & font,
libwps_tools_win::Font::Type & type ) const
protected

returns the font corresponding to an id

Referenced by QuattroSpreadsheet.

◆ parse()

void QuattroParser::parse ( librevenge::RVNGSpreadsheetInterface * documentInterface)
finalvirtual

called by WPSDocument to parse the file

Implements WKSParser.

Referenced by QuattroSpreadsheet.

◆ parseOLEStream()

bool QuattroParser::parseOLEStream ( RVNGInputStreamPtr input,
std::string const & avoid = "" )
protected

try to parse the OLE stream(except the main stream)

Referenced by QuattroSpreadsheet, readOLEZones(), and readZones().

◆ readBlockList()

bool QuattroParser::readBlockList ( std::shared_ptr< WPSStream > stream)
protected

reads some cell reference list (potential followed by other data)

Referenced by QuattroSpreadsheet, and readZone().

◆ readCellPosition()

bool QuattroParser::readCellPosition ( std::shared_ptr< WPSStream > stream)
staticprotected

read the cell's position: zone 96

Referenced by QuattroSpreadsheet, and readZone().

◆ readColorList()

bool QuattroParser::readColorList ( std::shared_ptr< WPSStream > stream)
protected

read a color lits: zone e8

Referenced by QuattroSpreadsheet, and readZone().

◆ readCString()

bool QuattroParser::readCString ( std::shared_ptr< WPSStream > stream,
librevenge::RVNGString & string,
long maxSize )
protected

try to read a basic C string, knowing the maximum size

Referenced by QuattroSpreadsheet, readExternalData(), readFieldName(), readFontDef(), readHeaderFooter(), readOleLinkInfo(), readOLEZones(), readStyleName(), and readZone().

◆ readExternalData()

bool QuattroParser::readExternalData ( std::shared_ptr< WPSStream > stream)
protected

read a external filename/name: zone 97,98

Referenced by QuattroSpreadsheet, and readZone().

◆ readFieldName()

bool QuattroParser::readFieldName ( std::shared_ptr< WPSStream > stream)
protected

read a list of field name + ...: zone b

Referenced by QuattroSpreadsheet, and readZone().

◆ readFontDef()

bool QuattroParser::readFontDef ( std::shared_ptr< WPSStream > stream)
protected

read a font: zone cf, fc and 110

Referenced by QuattroSpreadsheet, and readZone().

◆ readHeaderFooter()

bool QuattroParser::readHeaderFooter ( std::shared_ptr< WPSStream > stream,
bool header )
protected

reads the header/footer: zone 25,26

Referenced by QuattroSpreadsheet, and readZone().

◆ readOleBOlePart()

bool QuattroParser::readOleBOlePart ( std::shared_ptr< WPSStream > stream)
staticprotected

try to read the BOlePart sub stream: a zone which contains 5 long

Referenced by parseOLEStream(), and QuattroSpreadsheet.

◆ readOleLinkInfo()

bool QuattroParser::readOleLinkInfo ( std::shared_ptr< WPSStream > stream,
librevenge::RVNGString & link )
protected

try to read the link info sub stream

Referenced by parseOLEStream(), and QuattroSpreadsheet.

◆ readOLEZones()

bool QuattroParser::readOLEZones ( std::shared_ptr< WPSStream > & stream)
protected

finds the different OLE zones: wb2

Referenced by QuattroSpreadsheet, and readZones().

◆ readOptimizer()

bool QuattroParser::readOptimizer ( std::shared_ptr< WPSStream > stream)
protected

read the first optimizer zone: 103

Referenced by QuattroSpreadsheet, and readZone().

◆ readPaneAttribute()

bool QuattroParser::readPaneAttribute ( std::shared_ptr< WPSStream > stream)
protected

read the pane attribute: d1

Referenced by QuattroSpreadsheet, and readZone().

◆ readQueryCommand()

bool QuattroParser::readQueryCommand ( std::shared_ptr< WPSStream > stream)
protected

read the table query command zone: 12f

Referenced by QuattroSpreadsheet, and readZone().

◆ readSerieExtension()

bool QuattroParser::readSerieExtension ( std::shared_ptr< WPSStream > stream)
staticprotected

read the serie extension zone: 2dc

Referenced by QuattroSpreadsheet, and readZone().

◆ readStyleName()

bool QuattroParser::readStyleName ( std::shared_ptr< WPSStream > stream)
protected

read a style name: zone d0

Referenced by QuattroSpreadsheet, and readZone().

◆ readZone()

bool QuattroParser::readZone ( std::shared_ptr< WPSStream > & stream)
protected

try to read a zone

Referenced by checkHeader(), QuattroSpreadsheet, readZone(), readZone341(), and readZones().

◆ readZone341()

bool QuattroParser::readZone341 ( std::shared_ptr< WPSStream > stream)
protected

reads a big zone(chart?) which contains sub zones: 341

Referenced by QuattroSpreadsheet, and readZone().

◆ readZones()

bool QuattroParser::readZones ( )
protected

finds the different zones (spreadsheet, chart, print, ...)

Referenced by parse(), and QuattroSpreadsheet.

◆ sendGraphics()

bool QuattroParser::sendGraphics ( int sheetId,
Vec2i const & cell ) const
protected

send the graphic corresponding to a cell

Referenced by QuattroSpreadsheet.

◆ sendHeaderFooter()

void QuattroParser::sendHeaderFooter ( bool header)
protected

send the header/footer

Referenced by QuattroParserInternal::SubDocument::parse(), and QuattroSpreadsheet.

◆ sendPageGraphics()

bool QuattroParser::sendPageGraphics ( int sheetId) const
protected

send the page graphic corresponding to a sheet

Referenced by QuattroSpreadsheet.

◆ version()

int QuattroParser::version ( ) const
protected

return the file version

Referenced by decodeStream(), QuattroSpreadsheet, readZone341(), and readZones().

◆ QuattroGraph

friend class QuattroGraph
friend

Referenced by QuattroGraph, and QuattroParser().

◆ QuattroParserInternal::SubDocument

◆ QuattroSpreadsheet

friend class QuattroSpreadsheet
friend

Referenced by QuattroParser(), and QuattroSpreadsheet.

Member Data Documentation

◆ m_graphParser

std::shared_ptr<QuattroGraph> QuattroParser::m_graphParser
protected

◆ m_listener

std::shared_ptr<WKSContentListener> QuattroParser::m_listener
protected

◆ m_spreadsheetParser

std::shared_ptr<QuattroSpreadsheet> QuattroParser::m_spreadsheetParser
protected

◆ m_state


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

Generated on Sat Jul 19 2025 05:24:40 for libwps by doxygen 1.14.0