This class parses Quattro Pro WP spreadsheet: .qpw. More...
#include <Quattro9.h>
Public Member Functions | |
Quattro9Parser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=nullptr) | |
constructor | |
~Quattro9Parser () 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 | getFont (int id, WPSFont &font) const |
returns the font corresponding to an id | |
Vec2f | getCellPosition (int sheetId, Vec2i const &cell) const |
returns the beginning position of a cell | |
bool | getColor (int id, WPSColor &color) const |
returns the color corresponding to an id | |
bool | getPattern (int id, WPSGraphicStyle::Pattern &pattern) const |
returns the pattern corresponding to a pattern id between 0 and 24 | |
bool | sendPageGraphics (int sheetId) const |
send the page graphic corresponding to a sheet | |
std::shared_ptr< WKSContentListener > | createListener (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 in the main OLE stream (spreadsheet, chart, print, ...) | |
bool | readZone (std::shared_ptr< WPSStream > &stream) |
try to read a zone | |
bool | readPString (std::shared_ptr< WPSStream > const &stream, long endPos, Quattro9ParserInternal::TextEntry &entry) |
try to read a string: length[2bytes], unknow[bytes] followed by the string | |
bool | readFontNames (std::shared_ptr< WPSStream > const &stream) |
read a font name zone: zone 6 | |
bool | readFontStyles (std::shared_ptr< WPSStream > const &stream) |
read a font style zone: zone 7 | |
bool | readDocumentFields (std::shared_ptr< WPSStream > const &stream) |
read a zone 406 which contains a list of fields | |
bool | readDocumentStrings (std::shared_ptr< WPSStream > const &stream) |
read a zone 407 which contains a list of stream | |
bool | readTextStyles (std::shared_ptr< WPSStream > const &stream, long endPos, Quattro9ParserInternal::TextEntry &entry) |
read a text entry style zone | |
bool | readTextFontStyles (std::shared_ptr< WPSStream > const &stream, int dataSz, WPSFont &font) |
read a font style in a text entry zone | |
void | addDocumentStrings () |
add the document strings to the spreadsheetParser | |
bool | parseOLEStream (RVNGInputStreamPtr input, std::string const &avoid="") |
try to parse the OLE stream(except the main stream) | |
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 |
Static Protected Member Functions | |
static bool | readFilePositions (std::shared_ptr< WPSStream > const &stream, long(&filePos)[2]) |
read a zone which contains two files position (prev and next): zone 2,402,602,a02 | |
static bool | readOleLinkInfo (std::shared_ptr< WPSStream > stream) |
try to read the link info sub stream | |
static bool | readOleBOlePart (std::shared_ptr< WPSStream > stream) |
try to read the BOlePart sub stream: a zone which contains 5 long | |
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 |
Protected Attributes | |
std::shared_ptr< WKSContentListener > | m_listener |
std::shared_ptr< Quattro9ParserInternal::State > | m_state |
the listener (if set) | |
std::shared_ptr< Quattro9Graph > | m_graphParser |
the graph manager | |
std::shared_ptr< Quattro9Spreadsheet > | m_spreadsheetParser |
the spreadsheet manager |
Friends | |
class | Quattro9ParserInternal::SubDocument |
class | Quattro9Graph |
class | Quattro9Spreadsheet |
This class parses Quattro Pro WP spreadsheet: .qpw.
Quattro9Parser::Quattro9Parser | ( | RVNGInputStreamPtr & | input, |
WPSHeaderPtr & | header, | ||
libwps_tools_win::Font::Type | encoding = libwps_tools_win::Font::UNKNOWN, | ||
char const * | password = nullptr ) |
constructor
|
final |
destructor
|
protected |
add the document strings to the spreadsheetParser
Referenced by Quattro9Spreadsheet, and readZone().
|
protected |
checks if the document header is correct (or not)
bool Quattro9Parser::checkHeader | ( | WPSHeader * | header, |
bool | strict = false ) |
checks if the document header is correct (or not)
Referenced by checkHeader(), libwps::WPSDocument::isFileFormatSupported(), parse(), and Quattro9Spreadsheet.
|
protected |
creates the main listener
Referenced by parse(), and Quattro9Spreadsheet.
|
staticprotected |
try to decode a stream, if successful, replace the stream'input by the new one
Referenced by Quattro9Spreadsheet, and readZone().
returns the beginning position of a cell
Referenced by Quattro9Spreadsheet.
|
protected |
returns the color corresponding to an id
Referenced by Quattro9Spreadsheet.
|
protected |
returns the default font type, ie.
the encoding given by the constructor if given or the encoding deduced from the version.
Referenced by Quattro9Spreadsheet, readDocumentFields(), and readTextFontStyles().
|
protected |
returns the name of the fId file
Referenced by Quattro9Spreadsheet.
|
protected |
returns the text and cell of a field instruction
Referenced by Quattro9Spreadsheet.
|
protected |
returns the font corresponding to an id
Referenced by Quattro9Spreadsheet.
|
protected |
returns the pattern corresponding to a pattern id between 0 and 24
Referenced by Quattro9Spreadsheet.
|
finalvirtual |
|
protected |
try to parse the OLE stream(except the main stream)
Referenced by Quattro9Spreadsheet, and readZones().
|
protected |
read a zone 406 which contains a list of fields
Referenced by Quattro9Spreadsheet, and readZone().
|
protected |
read a zone 407 which contains a list of stream
Referenced by Quattro9Spreadsheet, and readZone().
|
staticprotected |
read a zone which contains two files position (prev and next): zone 2,402,602,a02
Referenced by Quattro9Spreadsheet, Quattro9Spreadsheet::readEndColumn(), Quattro9Spreadsheet::readEndSheet(), and readZone().
|
protected |
read a font name zone: zone 6
Referenced by Quattro9Spreadsheet, and readZone().
|
protected |
read a font style zone: zone 7
Referenced by Quattro9Spreadsheet, and readZone().
|
staticprotected |
try to read the BOlePart sub stream: a zone which contains 5 long
Referenced by parseOLEStream(), and Quattro9Spreadsheet.
|
staticprotected |
try to read the link info sub stream
Referenced by parseOLEStream(), and Quattro9Spreadsheet.
|
protected |
try to read a string: length[2bytes], unknow[bytes] followed by the string
Referenced by Quattro9Spreadsheet, readDocumentFields(), readDocumentStrings(), readFontNames(), and readZone().
|
protected |
read a font style in a text entry zone
Referenced by Quattro9Spreadsheet, and readTextStyles().
|
protected |
read a text entry style zone
Referenced by Quattro9Spreadsheet, and readPString().
|
protected |
try to read a zone
Referenced by checkHeader(), Quattro9Spreadsheet, and readZones().
|
protected |
finds the different zones in the main OLE stream (spreadsheet, chart, print, ...)
Referenced by parse(), and Quattro9Spreadsheet.
|
protected |
send the header/footer
Referenced by Quattro9ParserInternal::SubDocument::parse(), and Quattro9Spreadsheet.
|
protected |
send the page graphic corresponding to a sheet
Referenced by Quattro9Spreadsheet.
|
protected |
return the file version
Referenced by Quattro9Spreadsheet.
|
friend |
Referenced by Quattro9Graph, and Quattro9Parser().
|
friend |
|
friend |
Referenced by Quattro9Parser(), and Quattro9Spreadsheet.
|
protected |
the graph manager
Referenced by getColor(), getPattern(), parse(), parseOLEStream(), Quattro9Parser(), readZone(), readZones(), and sendPageGraphics().
|
protected |
Referenced by parse(), Quattro9Parser(), and sendHeaderFooter().
|
protected |
the spreadsheet manager
Referenced by addDocumentStrings(), createListener(), getCellPosition(), parse(), Quattro9Parser(), readDocumentFields(), readZone(), and readZones().
|
protected |
the listener (if set)
the internal state
Referenced by addDocumentStrings(), checkHeader(), checkHeader(), createListener(), getDefaultFontType(), getExternalFileName(), getField(), getFont(), parseOLEStream(), Quattro9Parser(), readDocumentFields(), readDocumentStrings(), readFontNames(), readFontStyles(), readZone(), readZones(), sendHeaderFooter(), and version().