QuattroDosParser Class Reference documentation

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QuattroDosParser Class Referencefinal

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

`#include <QuattroDos.h>`

Inheritance diagram for QuattroDosParser:

## Public Member Functions
| QuattroDosParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN)
| constructor More...
| ~QuattroDosParser () final
| destructor More...
void | parse (librevenge::RVNGSpreadsheetInterface *documentInterface) final
| called by WPSDocument to parse the file More...
bool | checkHeader (WPSHeader *header, bool strict=false)
| checks if the document header is correct (or not) More...
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 More...
int | version () const
| return the file version More...
libwps_tools_win::Font::Type | getDefaultFontType () const
| returns the default font type, ie. More...
librevenge::RVNGString | getFileName (int fId) const
| returns the name of the fId file More...
bool | getColor (int id, WPSColor &color) const
| returns the color corresponding to an id More...
bool | getFont (int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
| returns the font corresponding to an id More...
librevenge::RVNGString | getSheetName (int id) const
| returns the name of the id's spreadsheet More...
bool | sendChart (int sheetId, Vec2i const &cell, Vec2f const &chartSize)
| try to send the chart corresponding to sheetId and a position More...
std::shared_ptr< WKSContentListener > | createListener (librevenge::RVNGSpreadsheetInterface *interface)
| creates the main listener More...
void | sendHeaderFooter (bool header)
| send the header/footer More...
bool | readZones ()
| finds the different zones (spreadsheet, chart, print, ...) More...
bool | readZone ()
| reads a zone More...
bool | readUserFonts ()
| reads the user fonts More...
bool | readFont (WPSFont &font, libwps_tools_win::Font::Type &type)
| try to read a font More...
bool | readHeaderFooter (bool header)
| reads the header/footer More...
bool | readFieldName ()
| read a list of field name + ... More...
bool | readFileName ()
| read a file name More...
bool | readPString (librevenge::RVNGString &string, long maxSize)
| try to read a basic pascal string, knowing the maximum size(excluding string size) More...
bool | readWindowRecord ()
| reads windows record 0:7|0:9 More...
bool | readUnknown1 ()
| reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a More...
Protected Member Functions inherited from WKSParser
RVNGInputStreamPtr & | getInput ()
void | resetInput (RVNGInputStreamPtr const &newInput)
RVNGInputStreamPtr | getFileInput ()
WPSHeaderPtr & | getHeader ()
int | version () const
void | setVersion (int vers)
libwps::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document More...

## Protected Attributes
std::shared_ptr< WKSContentListener > | m_listener
std::shared_ptr< QuattroDosParserInternal::State > | m_state
| the listener (if set) More...
std::shared_ptr< QuattroDosSpreadsheet > | m_spreadsheetParser
| the spreadsheet manager More...
std::shared_ptr< QuattroDosChart > | m_chartParser
| the chart manager More...

## Friends
class | QuattroDosParserInternal::SubDocument
class | QuattroDosChart
class | QuattroDosSpreadsheet

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ QuattroDosParser()

QuattroDosParser::QuattroDosParser | ( | RVNGInputStreamPtr & | input,
|  | WPSHeaderPtr & | header,
|  | libwps_tools_win::Font::Type | encoding = `libwps_tools_win::Font::UNKNOWN`
| ) |  |

constructor

## ◆ ~QuattroDosParser()

QuattroDosParser::~QuattroDosParser | ( |  | ) |
| final

destructor

## Member Function Documentation

## ◆ checkFilePosition()

bool QuattroDosParser::checkFilePosition | ( | long | pos | ) |
| protected

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

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

## ◆ checkHeader()

bool QuattroDosParser::checkHeader | ( | WPSHeader * | header,
|  | bool | strict = `false`
| ) |  |

checks if the document header is correct (or not)

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

## ◆ createListener()

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

creates the main listener

Referenced by parse().

## ◆ getColor()

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

returns the color corresponding to an id

Referenced by QuattroDosSpreadsheet::readCellStyle(), QuattroDosChart::readChart(), and QuattroDosSpreadsheet::readUserStyle().

## ◆ getDefaultFontType()

libwps_tools_win::Font::Type QuattroDosParser::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 QuattroDosSpreadsheet::readCell(), QuattroDosSpreadsheet::readCellProperty(), QuattroDosSpreadsheet::readCellStyle(), readFont(), readPString(), readUserFonts(), QuattroDosSpreadsheet::readUserStyle(), QuattroDosSpreadsheet::sendSpreadsheet(), and QuattroDosChart::sendText().

## ◆ getFileName()

librevenge::RVNGString QuattroDosParser::getFileName | ( | int | fId | ) | const
| protected

returns the name of the fId file

Referenced by QuattroDosSpreadsheet::readCell().

## ◆ getFont()

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

returns the font corresponding to an id

Referenced by QuattroDosSpreadsheet::readCellProperty().

## ◆ getSheetName()

librevenge::RVNGString QuattroDosParser::getSheetName | ( | int | id | ) | const
| protected

returns the name of the id's spreadsheet

Referenced by QuattroDosChart::readChart().

## ◆ parse()

void QuattroDosParser::parse | ( | librevenge::RVNGSpreadsheetInterface * | documentInterface | ) |
| finalvirtual

called by WPSDocument to parse the file

Implements WKSParser.

## ◆ readFieldName()

bool QuattroDosParser::readFieldName | ( |  | ) |
| protected

read a list of field name + ...

Referenced by readZone().

## ◆ readFileName()

bool QuattroDosParser::readFileName | ( |  | ) |
| protected

read a file name

Referenced by readZone().

## ◆ readFont()

bool QuattroDosParser::readFont | ( | WPSFont & | font,
|  | libwps_tools_win::Font::Type & | type
| ) |  |
| protected

try to read a font

Referenced by QuattroDosChart::readChart(), and readUserFonts().

## ◆ readHeaderFooter()

bool QuattroDosParser::readHeaderFooter | ( | bool | header | ) |
| protected

reads the header/footer

Referenced by readZone().

## ◆ readPString()

bool QuattroDosParser::readPString | ( | librevenge::RVNGString & | string,
|  | long | maxSize
| ) |  |
| protected

try to read a basic pascal string, knowing the maximum size(excluding string size)

Referenced by QuattroDosSpreadsheet::readCell(), QuattroDosSpreadsheet::readCellFormulaResult(), QuattroDosChart::readChart(), QuattroDosChart::readChartName(), readFieldName(), readFileName(), QuattroDosSpreadsheet::readSpreadsheetName(), and QuattroDosSpreadsheet::readUserStyle().

## ◆ readUnknown1()

bool QuattroDosParser::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 QuattroDosParser::readUserFonts | ( |  | ) |
| protected

reads the user fonts

Referenced by readZone().

## ◆ readWindowRecord()

bool QuattroDosParser::readWindowRecord | ( |  | ) |
| protected

reads windows record 0:7|0:9

Referenced by readZone().

## ◆ readZone()

bool QuattroDosParser::readZone | ( |  | ) |
| protected

reads a zone

Referenced by checkHeader(), and readZones().

## ◆ readZones()

bool QuattroDosParser::readZones | ( |  | ) |
| protected

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

Referenced by parse().

## ◆ sendChart()

bool QuattroDosParser::sendChart | ( | int | sheetId,
|  | Vec2i const & | cell,
|  | Vec2f const & | chartSize
| ) |  |
| protected

try to send the chart corresponding to sheetId and a position

Referenced by QuattroDosSpreadsheet::sendCellContent().

## ◆ sendHeaderFooter()

void QuattroDosParser::sendHeaderFooter | ( | bool | header | ) |
| protected

send the header/footer

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

## ◆ version()

int QuattroDosParser::version | ( |  | ) | const
| protected

return the file version

Referenced by readUnknown1(), QuattroDosChart::version(), and QuattroDosSpreadsheet::version().

## Friends And Related Function Documentation

## ◆ QuattroDosChart

friend class QuattroDosChart
| friend

## ◆ QuattroDosParserInternal::SubDocument

friend class QuattroDosParserInternal::SubDocument
| friend

## ◆ QuattroDosSpreadsheet

friend class QuattroDosSpreadsheet
| friend

## Member Data Documentation

## ◆ m_chartParser

std::shared_ptr<QuattroDosChart> QuattroDosParser::m_chartParser
| protected

the chart manager

Referenced by parse(), readZone(), and sendChart().

## ◆ m_listener

std::shared_ptr<WKSContentListener> QuattroDosParser::m_listener
| protected

Referenced by parse(), and sendHeaderFooter().

## ◆ m_spreadsheetParser

std::shared_ptr<QuattroDosSpreadsheet> QuattroDosParser::m_spreadsheetParser
| protected

the spreadsheet manager

Referenced by getSheetName(), parse(), readZone(), and readZones().

## ◆ m_state

std::shared_ptr<QuattroDosParserInternal::State> QuattroDosParser::m_state
| protected

the listener (if set)

the internal state

Referenced by checkFilePosition(), checkHeader(), createListener(), getColor(), getDefaultFontType(), getFileName(), getFont(), readFileName(), readFont(), readHeaderFooter(), readUserFonts(), sendHeaderFooter(), and version().

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

- QuattroDos.h
- QuattroDos.cpp