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 | ~MWAWParser () |
virtual destructor | |
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 |
checks if the document header is correct (or not)
Implements MWAWParser.
Referenced by CanvasStyleManager, and parse().
|
protected |
creates the listener which will be associated to the document
Referenced by CanvasStyleManager, and parse().
|
protected |
finds the different objects zones
Referenced by CanvasStyleManager, and parse().
|
protected |
try to decode some data: length==-1 means decode end of input
Referenced by CanvasStyleManager, createZones(), readBrushes(), readEndV3(), readLayers(), readRSRCWindowsFile(), readSprays(), readUnknownZone2(), readUnknownZone3(), readUnknownZone4(), and readViews().
|
protected |
returns the current input
Referenced by CanvasStyleManager, 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 CanvasStyleManager, parse(), readBrushes(), readFileHeader(), and readString().
|
finalvirtual |
virtual function used to parse the input
Implements MWAWGraphicParser.
Referenced by CanvasStyleManager.
|
protected |
try to read the brush
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the Windows CNam RSRC: v3 (always 256 0's bytes)
Referenced by CanvasStyleManager, and readRSRCWindowsFile().
|
protected |
read the Windows CSet RSRC: v3 (contains the string Default)
Referenced by CanvasStyleManager, and readRSRCWindowsFile().
|
protected |
read the document header
Referenced by CanvasStyleManager, and createZones().
|
protected |
try to read the end zone: v3
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the file header: list of unknown numbers
Referenced by CanvasStyleManager, and parse().
|
protected |
read the formats' zone, mainly an unit's conversion table
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the grid: or a list which begins by a grid
Referenced by CanvasStyleManager, and createZones().
|
protected |
try to read the layers
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the RSRC LPol zone: v3
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the macro names
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the Windows Page RSRC: v3
Referenced by CanvasStyleManager, and readRSRCWindowsFile().
|
protected |
read the Windows DevM RSRC: v3 (main data of the printer device)
Referenced by CanvasStyleManager, and readRSRCWindowsFile().
|
protected |
read the Windows PSST RSRC: v3 (the printer, device name, ...)
Referenced by CanvasStyleManager, and readRSRCWindowsFile().
|
protected |
read the print info zone
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the RSRC HeAd(a copy of file header) zone: v3
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the resource file which ends the file
Referenced by CanvasStyleManager, and createZones().
|
protected |
try to read the spray
Referenced by CanvasStyleManager, and createZones().
|
protected |
try to read a pascal string in the data fork or a Pascal/C string depending on the file type
Referenced by CanvasStyleManager, readCSet(), readDocumentHeader(), readFormats(), readGrids(), readLayers(), readMacroNames(), readPage(), readPrinterDev(), readPrinterSST(), readRSRCWindowsFile(), readString(), readUnknownZone0(), readUsers(), and readViews().
|
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 CanvasStyleManager, and createZones().
|
protected |
read an unknown zone
Referenced by CanvasStyleManager, and createZones().
|
protected |
read an unknown zone
Referenced by CanvasStyleManager, and createZones().
|
protected |
read an unknown zone
Referenced by CanvasStyleManager, and createZones().
|
protected |
read an unknown zone: the last zone of a v2 files
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the first unknown zone
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the RSRC user zone: v3
Referenced by CanvasStyleManager, and createZones().
|
protected |
try to read the views
Referenced by CanvasStyleManager, and createZones().
|
protected |
read the RSRC Windows zone: v3
Referenced by CanvasStyleManager, and createZones().
|
protected |
tries to send a layer
Referenced by CanvasStyleManager, and parse().
|
friend |
Referenced by CanvasGraph, and CanvasParser().
|
friend |
Referenced by CanvasParser(), and CanvasStyleManager.
|
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().