the main class to read a Canvas 5-10 files (and probably some not password protected Windows 11 files) More...
#include <Canvas5Parser.hxx>
Classes | |
struct | Item |
a structure used to store the item data of a Canvas5Parser More... | |
Public Member Functions | |
Canvas5Parser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor | |
~Canvas5Parser () final | |
destructor | |
bool | checkHeader (MWAWHeader *header, bool strict=false) final |
checks if the document header is correct (or not) | |
void | parse (librevenge::RVNGDrawingInterface *documentInterface) final |
virtual function used to parse the input | |
![]() | |
~MWAWGraphicParser () override | |
destructor | |
virtual void | parse (librevenge::RVNGDrawingInterface *documentInterface)=0 |
virtual function used to parse the input | |
![]() | |
virtual | ~MWAWParser () |
virtual destructor | |
virtual bool | checkHeader (MWAWHeader *header, bool strict=false)=0 |
virtual function used to check if the document header is correct (or not) | |
int | version () const |
returns the works version | |
MWAWParserStatePtr | getParserState () |
returns the parser state | |
MWAWHeader * | getHeader () |
returns the header | |
MWAWInputStreamPtr & | getInput () |
returns the actual input | |
MWAWListenerPtr | getMainListener () |
returns the main listener | |
MWAWGraphicListenerPtr & | getGraphicListener () |
returns the graphic listener | |
MWAWPresentationListenerPtr & | getPresentationListener () |
returns the presentation listener | |
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener () |
returns the spreadsheet listener | |
MWAWTextListenerPtr & | getTextListener () |
returns the text listener | |
MWAWFontConverterPtr & | getFontConverter () |
returns the font converter | |
MWAWFontManagerPtr & | getFontManager () |
returns the font manager | |
MWAWPageSpan const & | getPageSpan () const |
returns the actual page dimension | |
MWAWPageSpan & | getPageSpan () |
returns the actual page dimension | |
double | getFormLength () const |
returns the form length | |
double | getFormWidth () const |
returns the form width | |
double | getPageLength () const |
returns the page length (form length without margin ) | |
double | getPageWidth () const |
returns the page width (form width without margin ) | |
MWAWRSRCParserPtr & | getRSRCParser () |
returns the rsrc parser | |
libmwaw::DebugFile & | ascii () |
a DebugFile used to write what we recognize when we parse the document | |
Protected Types | |
typedef std::function< void(std::shared_ptr< Canvas5Structure::Stream >, Item const &, std::string const &)> | DataFunction |
a function used to parse the data of a index map/a extended header | |
Protected Member Functions | |
void | createDocument (librevenge::RVNGDrawingInterface *documentInterface) |
creates the listener which will be associated to the document | |
bool | isWindowsFile () const |
returns true if the file is a windows file | |
librevenge::RVNGString | getTextLink (int textLinkId) const |
returns the link corresponding to a text id | |
bool | createZones () |
finds the different objects zones | |
bool | readMainBlock (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the first big block | |
bool | readMainBlock9 (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the first big block: v9 | |
bool | readFileRSRCs (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the third big block: a list of resource?, font, ... | |
bool | readSI200 (Canvas5Structure::Stream &stream) |
try to read the SI200 zone: v6 | |
bool | readFileDesc (Canvas5Structure::Stream &stream) |
try to read the last block: some pathes, ... | |
bool | readFileHeader (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the file header | |
bool | readDocumentSettings (std::shared_ptr< Canvas5Structure::Stream > stream) |
read the document settings | |
bool | readLayers (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the different layers | |
bool | readSlides (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the list of slides | |
bool | readTextLinks (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the text links | |
bool | readPrinterRsrc (Canvas5Structure::Stream &stream) |
try to read a printer rsrc | |
bool | readOLnkRsrc (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the OLnk rsrc block: v6 | |
bool | readObjectDBRsrc (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the object database: XOBD v6 | |
bool | readPnot (Canvas5Structure::Stream &stream, MWAWEntry const &entry) |
read the RSRC 0 pnot zone | |
bool | readPicture (Canvas5Structure::Stream &stream, MWAWEntry const &entry) |
read the RSRC Pict zone | |
bool | send (Canvas5ParserInternal::Slide const &slide) |
try to send a page/slide | |
bool | send (Canvas5ParserInternal::Layer const &layer) |
try to send a layer | |
bool | readString (Canvas5Structure::Stream &stream, librevenge::RVNGString &string, int maxSize, bool canBeCString=false) |
try to read a pascal string in the data fork or a Pascal/C string depending on the file type | |
bool | readDouble (Canvas5Structure::Stream &stream, double &val, bool &isNaN) const |
try to read a double 8 | |
double | readDouble (Canvas5Structure::Stream &stream, int fieldSize) const |
try to read a float: either a double: fieldSize=8 or a int32 (divided by 65536) | |
int | readInteger (Canvas5Structure::Stream &stream, int fieldSize) const |
try to read a int: either a cast a double: fieldSize=8 or a int32/int16 | |
bool | readDataHeader (Canvas5Structure::Stream &stream, int expectedSize, int &N) |
try to read a data header, ie. N fields with a given size | |
bool | readExtendedHeader (std::shared_ptr< Canvas5Structure::Stream > stream, int expectedValue, std::string const &what, DataFunction const &func) |
try to read an extended data header, ie. | |
bool | readUsed (Canvas5Structure::Stream &stream, std::string const &what) |
try to read the used list | |
bool | readDefined (Canvas5Structure::Stream &stream, std::vector< bool > &defined, std::string const &what) |
try to read the defined list | |
bool | readIndexMap (std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction) |
try to read a index map | |
bool | readArray9 (std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction) |
try to read an array: v9 | |
bool | readItemHeader9 (Canvas5Structure::Stream &stream, int &id, int &used) |
try to read an array item header: v9 | |
bool | getTAG9 (Canvas5Structure::Stream &stream, std::string &tag, int &type) |
try to return a tag, type:0 means begin, type:1 means end: v9 | |
bool | checkTAG9 (Canvas5Structure::Stream &stream, std::string const &tag, int type) |
try to check is the following is a tag: v9 | |
![]() | |
MWAWGraphicParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor (protected) | |
MWAWGraphicParser (MWAWParserStatePtr const &state) | |
constructor using a state | |
![]() | |
MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor (protected) | |
MWAWParser (MWAWParserStatePtr const &state) | |
constructor using a state | |
void | setVersion (int vers) |
sets the document's version | |
void | setGraphicListener (MWAWGraphicListenerPtr &listener) |
sets the graphic listener | |
void | resetGraphicListener () |
resets the listener | |
void | setPresentationListener (MWAWPresentationListenerPtr &listener) |
sets the presentation listener | |
void | resetPresentationListener () |
resets the listener | |
void | setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener) |
sets the spreadsheet listener | |
void | resetSpreadsheetListener () |
resets the listener | |
void | setTextListener (MWAWTextListenerPtr &listener) |
sets the text listener | |
void | resetTextListener () |
resets the listener | |
void | setAsciiName (char const *name) |
Debugging: change the default ascii file. | |
std::string const & | asciiName () const |
return the ascii file name | |
Static Protected Member Functions | |
static void | defDataFunction (std::shared_ptr< Canvas5Structure::Stream >, Item const &, std::string const &) |
the default function to parse the data of a index map/a extended header | |
static void | stringDataFunction (std::shared_ptr< Canvas5Structure::Stream > stream, Item const &item, std::string const &what) |
the default function to parse a string | |
static MWAWInputStreamPtr | decode (MWAWInputStreamPtr input, int version) |
try to decode the input stream | |
Protected Attributes | |
std::shared_ptr< Canvas5ParserInternal::State > | m_state |
the state | |
std::shared_ptr< Canvas5Graph > | m_graphParser |
the graph parser | |
std::shared_ptr< Canvas5Image > | m_imageParser |
the image parser | |
std::shared_ptr< Canvas5StyleManager > | m_styleManager |
the style manager | |
Friends | |
class | Canvas5Graph |
class | Canvas5Image |
class | Canvas5StyleManager |
the main class to read a Canvas 5-10 files (and probably some not password protected Windows 11 files)
|
protected |
a function used to parse the data of a index map/a extended header
Canvas5Parser::Canvas5Parser | ( | MWAWInputStreamPtr const & | input, |
MWAWRSRCParserPtr const & | rsrcParser, | ||
MWAWHeader * | header | ||
) |
constructor
|
final |
destructor
|
finalvirtual |
|
protected |
try to check is the following is a tag: v9
Referenced by readArray9(), Canvas5Image::readImages9(), and readMainBlock9().
|
protected |
creates the listener which will be associated to the document
FIXME: it is simpler to create a big page which contains the left and right page, but it may be better to create each page and to only keep in each page the used shapes, ie. to translate back the right shape and also decompose the master page shapes in left/right
Referenced by parse().
|
protected |
finds the different objects zones
Referenced by parse().
|
staticprotected |
try to decode the input stream
Referenced by parse().
|
inlinestaticprotected |
the default function to parse the data of a index map/a extended header
Referenced by readObjectDBRsrc(), readOLnkRsrc(), and readTextLinks().
|
protected |
try to return a tag, type:0 means begin, type:1 means end: v9
Referenced by checkTAG9(), Canvas5Image::readImages9(), and readMainBlock9().
|
protected |
returns the link corresponding to a text id
Referenced by Canvas5Graph::sendText().
|
protected |
returns true if the file is a windows file
Referenced by readFileRSRCs(), Canvas5StyleManager::readFonts(), readLayers(), readSI200(), readString(), and Canvas5Graph::sendDimension9().
|
finalvirtual |
virtual function used to parse the input
Implements MWAWGraphicParser.
|
protected |
try to read an array: v9
Referenced by Canvas5StyleManager::readCharStyles(), Canvas5StyleManager::readFrameStyles9(), Canvas5StyleManager::readInks9(), readMainBlock9(), Canvas5Graph::readMatrices(), Canvas5StyleManager::readParaStyles(), and readSlides().
|
protected |
try to read a data header, ie. N fields with a given size
Referenced by readDefined(), readIndexMap(), readOLnkRsrc(), and readUsed().
|
protected |
try to read the defined list
Referenced by readFileRSRCs(), Canvas5Image::readImages(), readObjectDBRsrc(), readOLnkRsrc(), readSlides(), and readTextLinks().
|
protected |
read the document settings
Referenced by readMainBlock(), and readMainBlock9().
|
protected |
try to read a double 8
Referenced by Canvas5StyleManager::readCharStyle(), Canvas5StyleManager::readDash(), Canvas5Graph::readDeR3(), readDocumentSettings(), readDouble(), readFileRSRCs(), Canvas5StyleManager::readGradient(), Canvas5StyleManager::readHatch(), readInteger(), Canvas5Image::readMACORsrc(), Canvas5Graph::readMatrices(), Canvas5StyleManager::readParaStyle(), Canvas5StyleManager::readPenStyle(), Canvas5Graph::readShapeData(), Canvas5Graph::readShapes(), readSlides(), Canvas5Graph::readSpecialData(), Canvas5StyleManager::readStyleEnd(), Canvas5StyleManager::readSymbol(), Canvas5Image::readVKFL(), Canvas5Image::readVKFLShape(), Canvas5Image::readVKFLShapeMainData(), Canvas5Image::readVKFLShapeOtherData(), Canvas5Graph::sendCurveText(), Canvas5Graph::sendDimension9(), Canvas5Graph::sendExtrude(), and Canvas5Graph::sendTechnical().
|
protected |
try to read a float: either a double: fieldSize=8 or a int32 (divided by 65536)
|
protected |
try to read an extended data header, ie.
N0 is expected to be value
Referenced by Canvas5StyleManager::readCharStyles(), Canvas5StyleManager::readDashes(), readFileRSRCs(), Canvas5Image::readImages(), Canvas5StyleManager::readInks(), Canvas5Image::readMACORsrc(), Canvas5Graph::readMatrices(), readObjectDBRsrc(), readOLnkRsrc(), Canvas5StyleManager::readParaStyles(), Canvas5StyleManager::readPenStyles(), readSlides(), Canvas5StyleManager::readStrokes(), and readTextLinks().
|
protected |
try to read the last block: some pathes, ...
Referenced by createZones().
|
protected |
try to read the file header
Referenced by createZones().
|
protected |
try to read the third big block: a list of resource?, font, ...
Referenced by createZones().
|
protected |
try to read a index map
Referenced by Canvas5StyleManager::readArrows(), readFileRSRCs(), Canvas5StyleManager::readInks(), readObjectDBRsrc(), readOLnkRsrc(), Canvas5StyleManager::readPenStyles(), readSlides(), and readTextLinks().
|
protected |
try to read a int: either a cast a double: fieldSize=8 or a int32/int16
Referenced by Canvas5StyleManager::readPenStyle(), Canvas5Graph::readShapeData(), Canvas5Image::readVKFLShapeMainData(), and Canvas5Graph::sendTechnical().
|
protected |
try to read an array item header: v9
Referenced by readArray9().
|
protected |
try to read the different layers
Referenced by readMainBlock(), and readMainBlock9().
|
protected |
try to read the first big block
Referenced by createZones().
|
protected |
try to read the first big block: v9
Referenced by createZones().
|
protected |
try to read the object database: XOBD v6
Referenced by readFileRSRCs().
|
protected |
try to read the OLnk rsrc block: v6
Referenced by readFileRSRCs().
|
protected |
read the RSRC Pict zone
Referenced by createZones().
|
protected |
read the RSRC 0 pnot zone
Referenced by createZones().
|
protected |
try to read a printer rsrc
Referenced by readFileRSRCs().
|
protected |
try to read the SI200 zone: v6
Referenced by createZones().
|
protected |
try to read the list of slides
Referenced by readMainBlock(), and readMainBlock9().
|
protected |
try to read a pascal string in the data fork or a Pascal/C string depending on the file type
Referenced by Canvas5Graph::sendDimension().
|
protected |
try to read the text links
Referenced by readMainBlock().
|
protected |
try to read the used list
Referenced by Canvas5StyleManager::readArrows(), Canvas5StyleManager::readDashes(), readFileRSRCs(), Canvas5Graph::readMatrices(), Canvas5StyleManager::readParaStyles(), Canvas5StyleManager::readPenStyles(), and Canvas5StyleManager::readStrokes().
|
protected |
try to send a layer
|
protected |
try to send a page/slide
Referenced by createDocument(), and send().
|
staticprotected |
the default function to parse a string
Referenced by readFileRSRCs(), readMainBlock9(), and Canvas5StyleManager::readParaStyles().
|
friend |
Referenced by Canvas5Parser().
|
friend |
Referenced by Canvas5Parser().
|
friend |
Referenced by Canvas5Parser().
|
protected |
the graph parser
Referenced by Canvas5Parser(), readMainBlock(), readMainBlock9(), Canvas5Image::readVKFLShapeMainData(), Canvas5Image::send(), and send().
|
protected |
the image parser
Referenced by Canvas5Parser(), createZones(), Canvas5StyleManager::getImageParser(), readFileRSRCs(), and readMainBlock9().
|
protected |
the state
Referenced by Canvas5Parser(), checkHeader(), createDocument(), createZones(), getTextLink(), isWindowsFile(), parse(), readDocumentSettings(), readFileHeader(), readFileRSRCs(), readLayers(), readMainBlock(), readMainBlock9(), readPrinterRsrc(), readSI200(), readSlides(), and send().
|
protected |
the style manager
Referenced by Canvas5Parser(), Canvas5Image::getStyleManager(), readDocumentSettings(), readFileRSRCs(), readMainBlock(), and readMainBlock9().