the main class to read a Canvas 2 and 3 files More...
#include <CanvasParser.hxx>
Public Member Functions | |
CanvasParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header) | |
constructor More... | |
~CanvasParser () 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 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... | |
MWAWInputStreamPtr & | getInput () |
returns the current input More... | |
bool | readFileHeader () |
read the file header: list of unknown numbers More... | |
bool | readDocumentHeader () |
read the document header More... | |
bool | readBrushes () |
try to read the brush More... | |
bool | readGrids () |
read the grid: or a list which begins by a grid More... | |
bool | readLayers () |
try to read the layers More... | |
bool | readMacroNames () |
read the macro names More... | |
bool | readFormats () |
read the formats' zone, mainly an unit's conversion table More... | |
bool | readSprays () |
try to read the spray More... | |
bool | readViews () |
try to read the views More... | |
bool | readEndV3 () |
try to read the end zone: v3 More... | |
bool | readRSRCFileHeader (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC HeAd(a copy of file header) zone: v3 More... | |
bool | readPrintInfo (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the print info zone More... | |
bool | readLPOL (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC LPol zone: v3 More... | |
bool | readUsers (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC user zone: v3 More... | |
bool | readWindows (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC Windows zone: v3 More... | |
bool | readRSRCWindowsFile () |
read the resource file which ends the file More... | |
bool | readCNam (MWAWEntry const &entry) |
read the Windows CNam RSRC: v3 (always 256 0's bytes) More... | |
bool | readCSet (MWAWEntry const &entry) |
read the Windows CSet RSRC: v3 (contains the string Default) More... | |
bool | readPrinterDev (MWAWEntry const &entry) |
read the Windows DevM RSRC: v3 (main data of the printer device) More... | |
bool | readPage (MWAWEntry const &entry) |
read the Windows Page RSRC: v3 More... | |
bool | readPrinterSST (MWAWEntry const &entry) |
read the Windows PSST RSRC: v3 (the printer, device name, ...) More... | |
bool | readUnknownZoneHeader () |
read the first unknown zone More... | |
bool | readUnknownZone0 () |
read an unknown zone: contains a layer name, some font id,sz, ... More... | |
bool | readUnknownZone1 () |
read an unknown zone More... | |
bool | readUnknownZone2 () |
read an unknown zone More... | |
bool | readUnknownZone3 () |
read an unknown zone More... | |
bool | readUnknownZone4 () |
read an unknown zone: the last zone of a v2 files More... | |
bool | send (CanvasParserInternal::Layer const &layer) |
tries to send a layer More... | |
bool | readString (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 | readString (MWAWInputStreamPtr input, librevenge::RVNGString &string, int maxSize, bool canBeCString=false) |
try to read a pascal string in the data fork or the resource fork More... | |
bool | decode (long length) |
try to decode some data: length==-1 means decode end of input 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... | |
Protected Attributes | |
std::shared_ptr< CanvasParserInternal::State > | m_state |
the state More... | |
std::shared_ptr< CanvasGraph > | m_graphParser |
the graph parser More... | |
std::shared_ptr< CanvasStyleManager > | m_styleManager |
the style manager More... | |
Friends | |
class | CanvasGraph |
class | CanvasStyleManager |
the main class to read a Canvas 2 and 3 files
CanvasParser::CanvasParser | ( | MWAWInputStreamPtr const & | input, |
MWAWRSRCParserPtr const & | rsrcParser, | ||
MWAWHeader * | header | ||
) |
constructor
|
final |
destructor
|
finalvirtual |
|
protected |
creates the listener which will be associated to the document
Referenced by parse().
|
protected |
finds the different objects zones
Referenced by parse().
|
protected |
try to decode some data: length==-1 means decode end of input
Referenced by createZones(), readBrushes(), CanvasStyleManager::readColors(), CanvasStyleManager::readDashes(), readEndV3(), readLayers(), CanvasStyleManager::readPatterns(), readRSRCWindowsFile(), CanvasGraph::readShapes(), readSprays(), readUnknownZone2(), readUnknownZone3(), readUnknownZone4(), and readViews().
|
protected |
returns the current input
Referenced by checkHeader(), createZones(), parse(), readBrushes(), readCNam(), readCSet(), readDocumentHeader(), readEndV3(), readFileHeader(), readFormats(), readGrids(), readLayers(), readMacroNames(), readPage(), readPrinterDev(), readPrinterSST(), readRSRCWindowsFile(), readSprays(), readString(), readUnknownZone0(), readUnknownZone1(), readUnknownZone2(), readUnknownZone3(), readUnknownZone4(), readUnknownZoneHeader(), and readViews().
|
protected |
returns true if the file is a windows file
Referenced by CanvasGraph::getBitmap(), CanvasGraph::getBitmapBW(), parse(), readBrushes(), readFileHeader(), CanvasStyleManager::readFonts(), CanvasGraph::readShape(), CanvasGraph::readShapeData(), CanvasGraph::readShapes(), readString(), and CanvasGraph::sendMultiLines().
|
finalvirtual |
virtual function used to parse the input
Implements MWAWGraphicParser.
|
protected |
try to read the brush
Referenced by createZones().
|
protected |
read the Windows CNam RSRC: v3 (always 256 0's bytes)
Referenced by readRSRCWindowsFile().
|
protected |
read the Windows CSet RSRC: v3 (contains the string Default)
Referenced by readRSRCWindowsFile().
|
protected |
read the document header
Referenced by createZones().
|
protected |
try to read the end zone: v3
Referenced by createZones().
|
protected |
read the file header: list of unknown numbers
Referenced by parse().
|
protected |
read the formats' zone, mainly an unit's conversion table
Referenced by createZones().
|
protected |
read the grid: or a list which begins by a grid
Referenced by createZones().
|
protected |
try to read the layers
Referenced by createZones().
|
protected |
read the RSRC LPol zone: v3
Referenced by createZones().
|
protected |
read the macro names
Referenced by createZones().
|
protected |
read the Windows Page RSRC: v3
Referenced by readRSRCWindowsFile().
|
protected |
read the Windows DevM RSRC: v3 (main data of the printer device)
Referenced by readRSRCWindowsFile().
|
protected |
read the Windows PSST RSRC: v3 (the printer, device name, ...)
Referenced by readRSRCWindowsFile().
|
protected |
read the print info zone
Referenced by createZones().
|
protected |
read the RSRC HeAd(a copy of file header) zone: v3
Referenced by createZones().
|
protected |
read the resource file which ends the file
Referenced by createZones().
|
protected |
try to read the spray
Referenced by createZones().
|
protected |
try to read a pascal string in the data fork or a Pascal/C string depending on the file type
Referenced by readCSet(), readDocumentHeader(), readFormats(), readGrids(), readLayers(), readMacroNames(), readPage(), readPrinterDev(), readPrinterSST(), readRSRCWindowsFile(), CanvasGraph::readShapeData(), readUnknownZone0(), readUsers(), readViews(), and CanvasGraph::sendDimension().
|
protected |
try to read a pascal string in the data fork or the resource fork
|
protected |
read an unknown zone: contains a layer name, some font id,sz, ...
Referenced by createZones().
|
protected |
read an unknown zone
Referenced by createZones().
|
protected |
read an unknown zone
Referenced by createZones().
|
protected |
read an unknown zone
Referenced by createZones().
|
protected |
read an unknown zone: the last zone of a v2 files
Referenced by createZones().
|
protected |
read the first unknown zone
Referenced by createZones().
|
protected |
read the RSRC user zone: v3
Referenced by createZones().
|
protected |
try to read the views
Referenced by createZones().
|
protected |
read the RSRC Windows zone: v3
Referenced by createZones().
|
protected |
tries to send a layer
Referenced by parse().
|
friend |
Referenced by CanvasParser().
|
friend |
Referenced by CanvasParser().
|
protected |
the graph parser
Referenced by CanvasParser(), createZones(), parse(), and send().
|
protected |
the state
Referenced by CanvasParser(), checkHeader(), createDocument(), createZones(), decode(), getInput(), isWindowsFile(), parse(), readBrushes(), readDocumentHeader(), readFileHeader(), readGrids(), readLayers(), readRSRCWindowsFile(), readSprays(), readUnknownZone3(), readUnknownZone4(), readUsers(), and readViews().
|
protected |
the style manager
Referenced by CanvasParser(), createZones(), parse(), readEndV3(), and readRSRCWindowsFile().