the main class to read a Canvas 5 files More...
#include <Canvas5Parser.hxx>
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... | |
Static Public Member Functions | |
static std::string | getString (unsigned val) |
very low level: debug print some uint32_t either at char4 or sample int More... | |
Protected Types | |
typedef std::function< void(Canvas5Structure::Stream &, int, std::string const &, long)> | 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... | |
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 | readFileRSRCs (Canvas5Structure::Stream &stream) |
try to read the third big block: a list of resource?, font, ... More... | |
bool | readFileDesc (Canvas5Structure::Stream &stream) |
try to read the last block: some pathes, ... More... | |
bool | readFileHeader (Canvas5Structure::Stream &stream) |
try to read the file header More... | |
bool | readDocumentSettings (Canvas5Structure::Stream &stream) |
read the document settings More... | |
bool | readLayers (Canvas5Structure::Stream &stream) |
try to read the different layers More... | |
bool | readPreview (Canvas5Structure::Stream &stream) |
try to read the preview picture More... | |
bool | readSlides (Canvas5Structure::Stream &stream) |
try to read the list of slides More... | |
bool | readTextLinks (Canvas5Structure::Stream &stream) |
try to read the text links More... | |
bool | readBitmap (Canvas5Structure::Stream &stream, MWAWEmbeddedObject &object, MWAWColor *avgColor=nullptr) |
try to read a bitmap More... | |
bool | readPrinterRsrc (Canvas5Structure::Stream &stream) |
try to read a printer rsrc 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... | |
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 (Canvas5Structure::Stream &stream, int expectedValue, std::string const &what, DataFunction const &func) |
try to read an extended data header, ie. More... | |
bool | readUnknownHeader (Canvas5Structure::Stream &stream, MWAWEntry(&entries)[2], long len, std::string const &what) |
try to read an unknown structure which defined some position and two entries 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 (Canvas5Structure::Stream &stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction) |
try to read a index map More... | |
bool | readSpecialData (long len, unsigned type, std::string &extra) |
try to read a special shape data (internal helper to understand vkfl structure) 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 (Canvas5Structure::Stream &, int, std::string const &, long) |
the default function to parse the data of a index map/a extended header More... | |
static void | stringDataFunction (Canvas5Structure::Stream &stream, int id, std::string const &what, long len) |
the default function to parse the data of a index map/a extended header More... | |
static MWAWInputStreamPtr | decode (MWAWInputStreamPtr input) |
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< Canvas5StyleManager > | m_styleManager |
the style manager More... | |
Friends | |
class | Canvas5Graph |
class | Canvas5StyleManager |
the main class to read a Canvas 5 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 |
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 readFileRSRCs(), and readTextLinks().
|
static |
very low level: debug print some uint32_t either at char4 or sample int
Referenced by Canvas5StyleManager::readColor(), Canvas5StyleManager::readColorStyle(), readFileRSRCs(), readPnot(), Canvas5Graph::readShapeData(), Canvas5StyleManager::readSymbol(), readTextLinks(), Canvas5StyleManager::readVKFL(), Canvas5Graph::sendSpecial(), Canvas5StyleManager::updateLineColor(), Canvas5StyleManager::updateLineStyle(), and Canvas5StyleManager::updateSurfaceColor().
|
protected |
returns true if the file is a windows file
Referenced by Canvas5StyleManager::readFonts(), and readString().
|
finalvirtual |
virtual function used to parse the input
Implements MWAWGraphicParser.
|
protected |
try to read a bitmap
Referenced by Canvas5Graph::readBitmaps(), and Canvas5StyleManager::readVKFL().
|
protected |
try to read a data header, ie. N fields with a given size
Referenced by Canvas5StyleManager::readColors(), readDefined(), readIndexMap(), and readUsed().
|
protected |
try to read the defined list
Referenced by Canvas5Graph::readBitmaps(), readFileRSRCs(), readSlides(), and readTextLinks().
|
protected |
read the document settings
Referenced by readMainBlock().
|
protected |
try to read a double 8
Referenced by readDocumentSettings(), and Canvas5Graph::sendExtrude().
|
protected |
try to read an extended data header, ie.
N0 is expected to be value
Referenced by Canvas5Graph::readBitmaps(), Canvas5StyleManager::readCharStyles(), Canvas5StyleManager::readColors(), Canvas5StyleManager::readDashes(), readFileRSRCs(), Canvas5Graph::readMatrices(), Canvas5StyleManager::readPenStyles(), readSlides(), Canvas5StyleManager::readStrokes(), Canvas5StyleManager::readStyles(), 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(), Canvas5StyleManager::readColors(), readFileRSRCs(), Canvas5StyleManager::readPenStyles(), readSlides(), and readTextLinks().
|
protected |
try to read the different layers
Referenced by readMainBlock().
|
protected |
try to read the first big block
Referenced by createZones().
|
protected |
read the RSRC Pict zone
Referenced by createZones().
|
protected |
read the RSRC 0 pnot zone
Referenced by createZones().
|
protected |
try to read the preview picture
Referenced by readMainBlock().
|
protected |
try to read a printer rsrc
Referenced by readFileRSRCs().
|
protected |
try to read the list of slides
Referenced by readMainBlock().
|
protected |
try to read a special shape data (internal helper to understand vkfl structure)
Referenced by Canvas5StyleManager::readVKFL().
|
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 an unknown structure which defined some position and two entries
Referenced by Canvas5StyleManager::readVKFL(), and Canvas5Graph::sendEffect().
|
protected |
try to read the used list
Referenced by Canvas5StyleManager::readArrows(), Canvas5StyleManager::readColors(), Canvas5StyleManager::readDashes(), readFileRSRCs(), Canvas5Graph::readMatrices(), Canvas5StyleManager::readStrokes(), and Canvas5StyleManager::readStyles().
|
protected |
try to send a layer
|
protected |
try to send a page/slide
Referenced by createDocument(), and send().
|
staticprotected |
the default function to parse the data of a index map/a extended header
Referenced by readFileRSRCs(), and Canvas5StyleManager::readStyles().
|
friend |
Referenced by Canvas5Parser().
|
friend |
Referenced by Canvas5Parser().
|
protected |
the graph parser
Referenced by Canvas5Parser(), createZones(), readMainBlock(), readSpecialData(), and send().
|
protected |
the state
Referenced by Canvas5Parser(), checkHeader(), createDocument(), createZones(), isWindowsFile(), parse(), readDocumentSettings(), readFileHeader(), readLayers(), readMainBlock(), readPreview(), readSlides(), and send().
|
protected |
the style manager
Referenced by Canvas5Parser(), readDocumentSettings(), readFileRSRCs(), and readMainBlock().