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 | |
~CanvasParser () 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 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 | |
bool | createZones () |
finds the different objects zones | |
MWAWInputStreamPtr & | getInput () |
returns the current input | |
bool | readFileHeader () |
read the file header: list of unknown numbers | |
bool | readDocumentHeader () |
read the document header | |
bool | readBrushes () |
try to read the brush | |
bool | readGrids () |
read the grid: or a list which begins by a grid | |
bool | readLayers () |
try to read the layers | |
bool | readMacroNames () |
read the macro names | |
bool | readFormats () |
read the formats' zone, mainly an unit's conversion table | |
bool | readSprays () |
try to read the spray | |
bool | readViews () |
try to read the views | |
bool | readEndV3 () |
try to read the end zone: v3 | |
bool | readRSRCFileHeader (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC HeAd(a copy of file header) zone: v3 | |
bool | readPrintInfo (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the print info zone | |
bool | readLPOL (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC LPol zone: v3 | |
bool | readUsers (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC user zone: v3 | |
bool | readWindows (MWAWInputStreamPtr input, MWAWEntry const &entry, libmwaw::DebugFile &ascFile) |
read the RSRC Windows zone: v3 | |
bool | readRSRCWindowsFile () |
read the resource file which ends the file | |
bool | readCNam (MWAWEntry const &entry) |
read the Windows CNam RSRC: v3 (always 256 0's bytes) | |
bool | readCSet (MWAWEntry const &entry) |
read the Windows CSet RSRC: v3 (contains the string Default) | |
bool | readPrinterDev (MWAWEntry const &entry) |
read the Windows DevM RSRC: v3 (main data of the printer device) | |
bool | readPage (MWAWEntry const &entry) |
read the Windows Page RSRC: v3 | |
bool | readPrinterSST (MWAWEntry const &entry) |
read the Windows PSST RSRC: v3 (the printer, device name, ...) | |
bool | readUnknownZoneHeader () |
read the first unknown zone | |
bool | readUnknownZone0 () |
read an unknown zone: contains a layer name, some font id,sz, ... | |
bool | readUnknownZone1 () |
read an unknown zone | |
bool | readUnknownZone2 () |
read an unknown zone | |
bool | readUnknownZone3 () |
read an unknown zone | |
bool | readUnknownZone4 () |
read an unknown zone: the last zone of a v2 files | |
bool | send (CanvasParserInternal::Layer const &layer) |
tries to send a layer | |
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 | |
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 | |
bool | decode (long length) |
try to decode some data: length==-1 means decode end of input | |
![]() | |
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 | |
Protected Attributes | |
std::shared_ptr< CanvasParserInternal::State > | m_state |
the state | |
std::shared_ptr< CanvasGraph > | m_graphParser |
the graph parser | |
std::shared_ptr< CanvasStyleManager > | m_styleManager |
the style manager | |
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(), readString(), 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().