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 More... | |
~Canvas5Parser () final | |
destructor More... | |
bool | checkHeader (MWAWHeader *header, bool strict=false) final |
checks if the document header is correct (or not) More... | |
void | parse (librevenge::RVNGDrawingInterface *documentInterface) final |
virtual function used to parse the input More... | |
![]() | |
~MWAWGraphicParser () override | |
destructor More... | |
![]() | |
virtual | ~MWAWParser () |
virtual destructor More... | |
int | version () const |
returns the works version More... | |
MWAWParserStatePtr | getParserState () |
returns the parser state More... | |
MWAWHeader * | getHeader () |
returns the header More... | |
MWAWInputStreamPtr & | getInput () |
returns the actual input More... | |
MWAWListenerPtr | getMainListener () |
returns the main listener More... | |
MWAWGraphicListenerPtr & | getGraphicListener () |
returns the graphic listener More... | |
MWAWPresentationListenerPtr & | getPresentationListener () |
returns the presentation listener More... | |
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener () |
returns the spreadsheet listener More... | |
MWAWTextListenerPtr & | getTextListener () |
returns the text listener More... | |
MWAWFontConverterPtr & | getFontConverter () |
returns the font converter More... | |
MWAWFontManagerPtr & | getFontManager () |
returns the font manager More... | |
MWAWPageSpan const & | getPageSpan () const |
returns the actual page dimension More... | |
MWAWPageSpan & | getPageSpan () |
returns the actual page dimension More... | |
double | getFormLength () const |
returns the form length More... | |
double | getFormWidth () const |
returns the form width More... | |
double | getPageLength () const |
returns the page length (form length without margin ) More... | |
double | getPageWidth () const |
returns the page width (form width without margin ) More... | |
MWAWRSRCParserPtr & | getRSRCParser () |
returns the rsrc parser More... | |
libmwaw::DebugFile & | ascii () |
a DebugFile used to write what we recognize when we parse the document More... | |
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 More... | |
Protected Member Functions | |
void | createDocument (librevenge::RVNGDrawingInterface *documentInterface) |
creates the listener which will be associated to the document More... | |
bool | isWindowsFile () const |
returns true if the file is a windows file More... | |
librevenge::RVNGString | getTextLink (int textLinkId) const |
returns the link corresponding to a text id More... | |
bool | createZones () |
finds the different objects zones More... | |
bool | readMainBlock (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the first big block More... | |
bool | readMainBlock9 (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the first big block: v9 More... | |
bool | readFileRSRCs (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the third big block: a list of resource?, font, ... More... | |
bool | readSI200 (Canvas5Structure::Stream &stream) |
try to read the SI200 zone: v6 More... | |
bool | readFileDesc (Canvas5Structure::Stream &stream) |
try to read the last block: some pathes, ... More... | |
bool | readFileHeader (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the file header More... | |
bool | readDocumentSettings (std::shared_ptr< Canvas5Structure::Stream > stream) |
read the document settings More... | |
bool | readLayers (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the different layers More... | |
bool | readSlides (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the list of slides More... | |
bool | readTextLinks (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the text links More... | |
bool | readPrinterRsrc (Canvas5Structure::Stream &stream) |
try to read a printer rsrc More... | |
bool | readOLnkRsrc (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the OLnk rsrc block: v6 More... | |
bool | readObjectDBRsrc (std::shared_ptr< Canvas5Structure::Stream > stream) |
try to read the object database: XOBD v6 More... | |
bool | readPnot (Canvas5Structure::Stream &stream, MWAWEntry const &entry) |
read the RSRC 0 pnot zone More... | |
bool | readPicture (Canvas5Structure::Stream &stream, MWAWEntry const &entry) |
read the RSRC Pict zone More... | |
bool | send (Canvas5ParserInternal::Slide const &slide) |
try to send a page/slide More... | |
bool | send (Canvas5ParserInternal::Layer const &layer) |
try to send a layer More... | |
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 More... | |
bool | readDouble (Canvas5Structure::Stream &stream, double &val, bool &isNaN) const |
try to read a double 8 More... | |
double | readDouble (Canvas5Structure::Stream &stream, int fieldSize) const |
try to read a float: either a double: fieldSize=8 or a int32 (divided by 65536) More... | |
int | readInteger (Canvas5Structure::Stream &stream, int fieldSize) const |
try to read a int: either a cast a double: fieldSize=8 or a int32/int16 More... | |
bool | readDataHeader (Canvas5Structure::Stream &stream, int expectedSize, int &N) |
try to read a data header, ie. N fields with a given size More... | |
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. More... | |
bool | readUsed (Canvas5Structure::Stream &stream, std::string const &what) |
try to read the used list More... | |
bool | readDefined (Canvas5Structure::Stream &stream, std::vector< bool > &defined, std::string const &what) |
try to read the defined list More... | |
bool | readIndexMap (std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction) |
try to read a index map More... | |
bool | readArray9 (std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction) |
try to read an array: v9 More... | |
bool | readItemHeader9 (Canvas5Structure::Stream &stream, int &id, int &used) |
try to read an array item header: v9 More... | |
bool | getTAG9 (Canvas5Structure::Stream &stream, std::string &tag, int &type) |
try to return a tag, type:0 means begin, type:1 means end: v9 More... | |
bool | checkTAG9 (Canvas5Structure::Stream &stream, std::string const &tag, int type) |
try to check is the following is a tag: v9 More... | |
![]() | |
MWAWGraphicParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor (protected) More... | |
MWAWGraphicParser (MWAWParserStatePtr const &state) | |
constructor using a state More... | |
![]() | |
MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor (protected) More... | |
MWAWParser (MWAWParserStatePtr const &state) | |
constructor using a state More... | |
void | setVersion (int vers) |
sets the document's version More... | |
void | setGraphicListener (MWAWGraphicListenerPtr &listener) |
sets the graphic listener More... | |
void | resetGraphicListener () |
resets the listener More... | |
void | setPresentationListener (MWAWPresentationListenerPtr &listener) |
sets the presentation listener More... | |
void | resetPresentationListener () |
resets the listener More... | |
void | setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener) |
sets the spreadsheet listener More... | |
void | resetSpreadsheetListener () |
resets the listener More... | |
void | setTextListener (MWAWTextListenerPtr &listener) |
sets the text listener More... | |
void | resetTextListener () |
resets the listener More... | |
void | setAsciiName (char const *name) |
Debugging: change the default ascii file. More... | |
std::string const & | asciiName () const |
return the ascii file name More... | |
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 More... | |
static void | stringDataFunction (std::shared_ptr< Canvas5Structure::Stream > stream, Item const &item, std::string const &what) |
the default function to parse a string More... | |
static MWAWInputStreamPtr | decode (MWAWInputStreamPtr input, int version) |
try to decode the input stream More... | |
Protected Attributes | |
std::shared_ptr< Canvas5ParserInternal::State > | m_state |
the state More... | |
std::shared_ptr< Canvas5Graph > | m_graphParser |
the graph parser More... | |
std::shared_ptr< Canvas5Image > | m_imageParser |
the image parser More... | |
std::shared_ptr< Canvas5StyleManager > | m_styleManager |
the style manager More... | |
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(), Canvas5Image::readVKFL(), Canvas5Image::readVKFLShape(), Canvas5Image::readVKFLShapeMainData(), 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 page/slide
Referenced by createDocument().
|
protected |
try to send a layer
|
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().