QuattroParser Class Reference

This class parses Quattro Pro spreadsheet: .wq1 and wq2. 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)
 constructor
 
 ~QuattroParser ()
 destructor
 
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface)
 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

bool checkFilePosition (long pos)
 return true if the pos is in the file, update the file size if need
 
int version () const
 return the file version
 
libwps_tools_win::Font::Type getDefaultFontType () const
 returns the default font type, ie.
 
bool hasLICSCharacters () const
 returns the true if the file has LICS characters
 
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
 
shared_ptr< WKSContentListenercreateListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener
 
void sendHeaderFooter (bool header)
 send the header/footer
 
bool readZones ()
 finds the different zones (spreadsheet, chart, print, ...)
 
bool readZone ()
 reads a zone
 
bool readUserFonts ()
 reads the user fonts
 
bool readHeaderFooter (bool header)
 reads the header/footer
 
bool readFieldName ()
 read a list of field name + ...
 
bool readChartName ()
 reads the chart name or title
 
bool readChartDef ()
 reads a structure which seems to define a chart
 
bool readWindowRecord ()
 reads windows record 0:7|0:9
 
bool readUnknown1 ()
 reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a
 
- Protected Member Functions inherited from WKSParser
RVNGInputStreamPtrgetInput ()
 
void resetInput (RVNGInputStreamPtr 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
 

Protected Attributes

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

Friends

class QuattroParserInternal::SubDocument
 
class QuattroSpreadsheet
 

Detailed Description

This class parses Quattro Pro spreadsheet: .wq1 and wq2.

Constructor & Destructor Documentation

◆ QuattroParser()

QuattroParser::QuattroParser ( RVNGInputStreamPtr input,
WPSHeaderPtr header,
libwps_tools_win::Font::Type  encoding = libwps_tools_win::Font::UNKNOWN 
)

constructor

◆ ~QuattroParser()

QuattroParser::~QuattroParser ( )

destructor

Member Function Documentation

◆ checkFilePosition()

bool QuattroParser::checkFilePosition ( long  pos)
protected

return true if the pos is in the file, update the file size if need

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

◆ checkHeader()

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

checks if the document header is correct (or not)

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

◆ createListener()

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

creates the main listener

Referenced by parse().

◆ getColor()

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

returns the color corresponding to an id

Referenced by QuattroSpreadsheet::readCellStyle(), and QuattroSpreadsheet::readUserStyle().

◆ 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 deduiced from the version.

Referenced by QuattroSpreadsheet::readCell(), QuattroSpreadsheet::readCellProperty(), QuattroSpreadsheet::readCellStyle(), readUserFonts(), and QuattroSpreadsheet::readUserStyle().

◆ 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::readCellProperty().

◆ hasLICSCharacters()

bool QuattroParser::hasLICSCharacters ( ) const
protected

returns the true if the file has LICS characters

Referenced by QuattroSpreadsheet::hasLICSCharacters(), and sendHeaderFooter().

◆ parse()

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

called by WPSDocument to parse the file

Implements WKSParser.

◆ readChartDef()

bool QuattroParser::readChartDef ( )
protected

reads a structure which seems to define a chart

Referenced by readZone().

◆ readChartName()

bool QuattroParser::readChartName ( )
protected

reads the chart name or title

Referenced by readZone().

◆ readFieldName()

bool QuattroParser::readFieldName ( )
protected

read a list of field name + ...

Referenced by readZone().

◆ readHeaderFooter()

bool QuattroParser::readHeaderFooter ( bool  header)
protected

reads the header/footer

Referenced by readZone().

◆ readUnknown1()

bool QuattroParser::readUnknown1 ( )
protected

reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a

Note
this zones seems to consist of a list of flags potentially followed by other data

Referenced by readZone().

◆ readUserFonts()

bool QuattroParser::readUserFonts ( )
protected

reads the user fonts

Referenced by readZone().

◆ readWindowRecord()

bool QuattroParser::readWindowRecord ( )
protected

reads windows record 0:7|0:9

Referenced by readZone().

◆ readZone()

bool QuattroParser::readZone ( )
protected

reads a zone

Referenced by checkHeader(), and readZones().

◆ readZones()

bool QuattroParser::readZones ( )
protected

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

Referenced by parse().

◆ sendHeaderFooter()

void QuattroParser::sendHeaderFooter ( bool  header)
protected

send the header/footer

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

◆ version()

int QuattroParser::version ( ) const
protected

return the file version

Referenced by hasLICSCharacters(), readUnknown1(), and QuattroSpreadsheet::version().

Friends And Related Symbol Documentation

◆ QuattroParserInternal::SubDocument

◆ QuattroSpreadsheet

friend class QuattroSpreadsheet
friend

Referenced by QuattroParser().

Member Data Documentation

◆ m_listener

shared_ptr<WKSContentListener> QuattroParser::m_listener
protected

Referenced by parse(), and sendHeaderFooter().

◆ m_spreadsheetParser

shared_ptr<QuattroSpreadsheet> QuattroParser::m_spreadsheetParser
protected

the spreadsheet manager

Referenced by parse(), QuattroParser(), readChartDef(), readZone(), and readZones().

◆ m_state


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

Generated on Wed Nov 29 2023 19:00:10 for libwps by doxygen 1.9.8