QuattroParser Class Referencefinal

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, char const *password=nullptr)
 constructor More...
 
 ~QuattroParser () 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

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 getField (int fId, librevenge::RVNGString &text, WKSContentListener::FormulaInstruction &instr) const
 returns the text and cell of a field instruction 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...
 
bool sendGraphics (int sheetId, Vec2i const &cell) const
 send the graphic corresponding to a cell More...
 
std::shared_ptr< WKSContentListenercreateListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener More...
 
void sendHeaderFooter (bool header)
 send the header/footer More...
 
bool checkHeader (std::shared_ptr< WPSStream > stream, bool strict)
 checks if the document header is correct (or not) More...
 
bool readZones ()
 finds the different zones (spreadsheet, chart, print, ...) More...
 
bool readOLEZones (std::shared_ptr< WPSStream > &stream)
 finds the different OLE zones: wb2 More...
 
bool readZone (std::shared_ptr< WPSStream > &stream)
 try to read a zone More...
 
bool readFieldName (std::shared_ptr< WPSStream > stream)
 read a list of field name + ...: zone b More...
 
bool readCellPosition (std::shared_ptr< WPSStream > stream)
 read the cell's position: zone 96 More...
 
bool readFileName (std::shared_ptr< WPSStream > stream)
 read a file name: zone 97 More...
 
bool readFontDef (std::shared_ptr< WPSStream > stream)
 read a font: zone cf More...
 
bool readColorList (std::shared_ptr< WPSStream > stream)
 read a font: zone e8 More...
 
bool readStyleName (std::shared_ptr< WPSStream > stream)
 read a style name: zone d0 More...
 
bool readHeaderFooter (std::shared_ptr< WPSStream > stream, bool header)
 reads the header/footer: zone 25,26 More...
 
bool readCString (std::shared_ptr< WPSStream > stream, librevenge::RVNGString &string, long maxSize)
 try to read a basic C string, knowing the maximum size More...
 
bool readPageSetup (std::shared_ptr< WPSStream > stream)
 read a page setup zone: fc More...
 
bool readRangeList (std::shared_ptr< WPSStream > stream)
 reads some range spreadsheet zones More...
 
bool readZone341 (std::shared_ptr< WPSStream > stream)
 reads a big zone(chart?) which contains sub zones: 341 More...
 
bool readOleLinkInfo (std::shared_ptr< WPSStream > stream, librevenge::RVNGString &link)
 try to read the link info sub stream More...
 
bool readOleBOlePart (std::shared_ptr< WPSStream > stream)
 try to read the BOlePart sub stream: a zone which contains 5 long More...
 
- 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 More...
 

Static Protected Member Functions

static RVNGInputStreamPtr decodeStream (RVNGInputStreamPtr input, std::vector< uint8_t > const &key)
 try to decode a stream, if successful, replace the stream'input by the new one More...
 

Protected Attributes

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

Friends

class QuattroParserInternal::SubDocument
 
class QuattroGraph
 
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,
char const *  password = nullptr 
)

constructor

◆ ~QuattroParser()

QuattroParser::~QuattroParser ( )
final

destructor

Member Function Documentation

◆ checkHeader() [1/2]

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

checks if the document header is correct (or not)

Referenced by parse().

◆ checkHeader() [2/2]

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

checks if the document header is correct (or not)

◆ createListener()

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

creates the main listener

Referenced by parse().

◆ decodeStream()

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

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

Referenced by readZone().

◆ getColor()

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

returns the color corresponding to an id

Referenced by QuattroSpreadsheet::readCellStyle().

◆ 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::readCellStyle(), QuattroSpreadsheet::readColumnSize(), readCString(), readFontDef(), QuattroSpreadsheet::readRowSize(), and QuattroSpreadsheet::sendSpreadsheet().

◆ getField()

bool QuattroParser::getField ( int  fId,
librevenge::RVNGString &  text,
WKSContentListener::FormulaInstruction instr 
) const
protected

returns the text and cell of a field instruction

Referenced by QuattroSpreadsheet::readFormula().

◆ getFileName()

librevenge::RVNGString QuattroParser::getFileName ( int  fId) const
protected

returns the name of the fId file

Referenced by QuattroSpreadsheet::readFormula().

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

◆ parse()

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

called by WPSDocument to parse the file

Implements WKSParser.

◆ readCellPosition()

bool QuattroParser::readCellPosition ( std::shared_ptr< WPSStream stream)
protected

read the cell's position: zone 96

Referenced by readZone().

◆ readColorList()

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

read a font: zone e8

Referenced by readZone().

◆ readCString()

◆ readFieldName()

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

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

Referenced by readZone().

◆ readFileName()

bool QuattroParser::readFileName ( std::shared_ptr< WPSStream stream)
protected

read a file name: zone 97

Referenced by readZone().

◆ readFontDef()

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

read a font: zone cf

Referenced by readZone().

◆ readHeaderFooter()

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

reads the header/footer: zone 25,26

Referenced by readZone().

◆ readOleBOlePart()

bool QuattroParser::readOleBOlePart ( std::shared_ptr< WPSStream stream)
protected

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

Referenced by readOLEZones().

◆ readOleLinkInfo()

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

try to read the link info sub stream

Referenced by readOLEZones().

◆ readOLEZones()

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

finds the different OLE zones: wb2

Referenced by readZones().

◆ readPageSetup()

bool QuattroParser::readPageSetup ( std::shared_ptr< WPSStream stream)
protected

read a page setup zone: fc

Referenced by readZone().

◆ readRangeList()

bool QuattroParser::readRangeList ( std::shared_ptr< WPSStream stream)
protected

reads some range spreadsheet zones

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

Referenced by readZone().

◆ readStyleName()

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

read a style name: zone d0

Referenced by readZone().

◆ readZone()

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

try to read a zone

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

◆ readZones()

bool QuattroParser::readZones ( )
protected

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

Referenced by parse().

◆ sendGraphics()

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

send the graphic corresponding to a cell

Referenced by QuattroSpreadsheet::sendCellContent().

◆ sendHeaderFooter()

void QuattroParser::sendHeaderFooter ( bool  header)
protected

send the header/footer

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

◆ version()

int QuattroParser::version ( ) const
protected

Friends And Related Function Documentation

◆ QuattroGraph

friend class QuattroGraph
friend

◆ QuattroParserInternal::SubDocument

◆ QuattroSpreadsheet

friend class QuattroSpreadsheet
friend

Member Data Documentation

◆ m_graphParser

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

the chart manager

the graph manager

Referenced by parse(), readOLEZones(), readZone(), readZones(), and sendGraphics().

◆ m_listener

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

◆ m_spreadsheetParser

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

the spreadsheet manager

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

◆ m_state


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

Generated on Mon Nov 27 2017 18:52:39 for libwps by doxygen 1.8.13