Go to the documentation of this file.
34 #ifndef CANVAS5_PARSER
35 # define CANVAS5_PARSER
43 #include <librevenge/librevenge.h>
187 , m_type(unsigned(-1))
206 typedef std::function<void(std::shared_ptr<Canvas5Structure::Stream>,
Item const &, std::string
const &)>
DataFunction;
208 static void defDataFunction(std::shared_ptr<Canvas5Structure::Stream>,
Item const &, std::string
const &) {}
210 static void stringDataFunction(std::shared_ptr<Canvas5Structure::Stream> stream, Item
const &item, std::string
const &what);
233 bool readArray9(std::shared_ptr<Canvas5Structure::Stream> stream, std::string
const &what,
250 std::shared_ptr<Canvas5ParserInternal::State>
m_state;
the main class to read/convert the image or movie inside of Canvas 5-11 files
Definition: Canvas5Image.hxx:78
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
bool checkTAG9(Canvas5Structure::Stream &stream, std::string const &tag, int type)
try to check is the following is a tag: v9
Definition: Canvas5Parser.cxx:3509
bool readLayers(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the different layers
Definition: Canvas5Parser.cxx:1908
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Internal: the layer of a Canvas5Parser.
Definition: Canvas5Parser.cxx:90
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
Definition: Canvas5Parser.hxx:208
MWAWFontConverterPtr & getFontConverter()
returns the font converter
Definition: MWAWParser.hxx:150
~Canvas5Parser() final
destructor
Definition: Canvas5Parser.cxx:198
std::shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:549
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
bool readPreview(Stream &stream, bool hasPreviewBitmap)
try to read the preview bitmap
Definition: Canvas5Structure.cxx:546
std::map< int, Layer > m_idToLayer
the layer data
Definition: Canvas5Parser.cxx:161
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
bool isWindowsFile() const
returns true if the file is a windows file
Definition: Canvas5Parser.cxx:202
int m_id
the identifier
Definition: Canvas5Parser.hxx:195
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
@ MWAW_T_CANVAS
Deneba Canvas mac: v2-v3 and v5-v8, windows: v3 and v5-v6 and probably v7-v8 ADC Canvas mac: v9-v10,...
Definition: MWAWDocument.hxx:229
bool readFileDesc(Canvas5Structure::Stream &stream)
try to read the last block: some pathes, ...
Definition: Canvas5Parser.cxx:1592
State()
constructor
Definition: Canvas5Parser.cxx:113
int id() const
returns the id
Definition: MWAWEntry.hxx:164
librevenge::RVNGPropertyList m_metaData
the meta data
Definition: Canvas5Parser.cxx:171
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:63
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
int version() const
returns the works version
Definition: MWAWParser.hxx:108
the main class to read the graphic part of Canvas v5-v11 file
Definition: Canvas5Graph.hxx:85
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
a class used to parse some basic oles Tries to read the different ole parts and stores their contents...
Definition: MWAWOLEParser.hxx:86
static MWAWPictData * get(MWAWInputStreamPtr const &input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
Item()
constructor
Definition: Canvas5Parser.hxx:185
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
std::vector< int > m_shapesId
the shape id
Definition: Canvas5Parser.cxx:104
MWAWInputStreamPtr input()
returns the input file
Definition: Canvas5Structure.hxx:65
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:126
Canvas5Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: Canvas5Parser.cxx:179
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: Canvas5Parser.cxx:253
bool readPnot(Canvas5Structure::Stream &stream, MWAWEntry const &entry)
read the RSRC 0 pnot zone
Definition: Canvas5Parser.cxx:2784
int m_numShapes
the number of shapes
Definition: Canvas5Parser.cxx:165
librevenge::RVNGString m_name
the layer name
Definition: Canvas5Parser.cxx:100
bool readObjectDBRsrc(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the object database: XOBD v6
Definition: Canvas5Parser.cxx:2234
bool readFileRSRCs(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the third big block: a list of resource?, font, ...
Definition: Canvas5Parser.cxx:619
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
void setMasterPageName(librevenge::RVNGString const &name)
set the page master name
Definition: MWAWPageSpan.hxx:243
long m_pos
the data beginning position (may be before the current position: v9)
Definition: Canvas5Parser.hxx:201
bool getTAG9(Canvas5Structure::Stream &stream, std::string &tag, int &type)
try to return a tag, type:0 means begin, type:1 means end: v9
Definition: Canvas5Parser.cxx:3542
bool readSlides(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the list of slides
Definition: Canvas5Parser.cxx:2392
int m_documentSetup
the document setup: 0 full page, 1: two page bottom/down, 2: four page
Definition: Canvas5Parser.cxx:147
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
int m_decal
the decal position
Definition: Canvas5Parser.hxx:203
bool readArray9(std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction)
try to read an array: v9
Definition: Canvas5Parser.cxx:3357
bool readIndexMap(std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction)
try to read a index map
Definition: Canvas5Parser.cxx:3139
Internal: the state of a Canvas5Parser.
Definition: Canvas5Parser.cxx:111
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
static void stringDataFunction(std::shared_ptr< Canvas5Structure::Stream > stream, Item const &item, std::string const &what)
the default function to parse a string
Definition: Canvas5Parser.cxx:3120
bool decodeZone5(MWAWInputStreamPtr input, long endPos, int type, unsigned long finalLength, std::shared_ptr< MWAWStringStream > &stream)
try to decode a zone v5-v6
Definition: Canvas5Structure.cxx:879
MWAWRSRCParserPtr & getRSRCParser()
returns the rsrc parser
Definition: MWAWParser.hxx:190
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:193
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
MWAWVec2f m_dim
the slide dimension
Definition: Canvas5Parser.cxx:82
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
libmwaw::DebugFile & ascii()
return the ascii file
Definition: Canvas5Structure.hxx:70
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
bool readSI200(Canvas5Structure::Stream &stream)
try to read the SI200 zone: v6
Definition: Canvas5Parser.cxx:1518
a namespace used to define basic function or structure to read a Canvas v5-v11 file
Definition: Canvas5BMParser.hxx:64
int m_numLayers
the number of layer
Definition: Canvas5Parser.cxx:159
bool readItemHeader9(Canvas5Structure::Stream &stream, int &id, int &used)
try to read an array item header: v9
Definition: Canvas5Parser.cxx:3484
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: Canvas5Parser.cxx:221
bool readMainBlock9(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the first big block: v9
Definition: Canvas5Parser.cxx:492
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:93
the main class to read a Canvas 5-10 files (and probably some not password protected Windows 11 files...
Definition: Canvas5Parser.hxx:72
double getFormWidth() const
returns the page width
Definition: MWAWPageSpan.hxx:122
@ PageBreak
Definition: MWAWListener.hxx:58
Definition: libmwaw_internal.hxx:144
bool readDefined(Canvas5Structure::Stream &stream, std::vector< bool > &defined, std::string const &what)
try to read the defined list
Definition: Canvas5Parser.cxx:3246
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
Definition: Canvas5Parser.hxx:206
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
bool readTextLinks(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the text links
Definition: Canvas5Parser.cxx:2288
std::vector< int > m_layers
the layer id
Definition: Canvas5Parser.cxx:86
std::map< int, Slide > m_idToSlide
the slide data
Definition: Canvas5Parser.cxx:156
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
bool readMainBlock(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the first big block
Definition: Canvas5Parser.cxx:458
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
std::map< int, librevenge::RVNGString > m_idToTextLink
the id the text link map
Definition: Canvas5Parser.cxx:168
unsigned m_type
the type (if known)
Definition: Canvas5Parser.hxx:197
std::shared_ptr< Canvas5Structure::Stream > m_stream
the current stream
Definition: Canvas5Parser.cxx:140
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:169
int m_fileFlags
the file flags
Definition: Canvas5Parser.cxx:145
int m_numSlides
the number of slides
Definition: Canvas5Parser.cxx:152
bool readFileHeader(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the file header
Definition: Canvas5Parser.cxx:1653
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:203
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:235
int readInteger(Canvas5Structure::Stream &stream, int fieldSize) const
try to read a int: either a cast a double: fieldSize=8 or a int32/int16
Definition: Canvas5Parser.cxx:2906
std::shared_ptr< Canvas5StyleManager > m_styleManager
the style manager
Definition: Canvas5Parser.hxx:256
bool readOLnkRsrc(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the OLnk rsrc block: v6
Definition: Canvas5Parser.cxx:2176
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.
Definition: Canvas5Parser.cxx:3039
int m_type
the layer type (unknonw)
Definition: Canvas5Parser.cxx:106
bool createZones()
finds the different objects zones
Definition: Canvas5Parser.cxx:381
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
a structure used to store the item data of a Canvas5Parser
Definition: Canvas5Parser.hxx:183
Internal: the structures of a Canvas5Parser.
Definition: Canvas5Parser.cxx:71
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
bool m_facingPages
true if the document uses facing page
Definition: Canvas5Parser.cxx:149
bool m_isWindowsFile
true if this is a windows file
Definition: Canvas5Parser.cxx:138
std::vector< int > m_slideIds
the slides id
Definition: Canvas5Parser.cxx:154
std::set< int > m_layerIdInMasterSet
the list of layer present in the master page
Definition: Canvas5Parser.cxx:163
friend class Canvas5StyleManager
Definition: Canvas5Parser.hxx:75
bool readPicture(Canvas5Structure::Stream &stream, MWAWEntry const &entry)
read the RSRC Pict zone
Definition: Canvas5Parser.cxx:2812
std::string getString(unsigned val)
very low level: debug print some uint32_t either at char4 or sample int
Definition: Canvas5Structure.cxx:47
int m_type
the document type 1: graphic, 2: list of pages, 3: slides
Definition: Canvas5Parser.cxx:143
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
bool readSummaryInformation(MWAWInputStreamPtr input, std::string const &oleName, int &encoding, librevenge::RVNGPropertyList &pList, libmwaw::DebugFile &ascii, long endPos=-1) const
the summary information and the doc summary information
Definition: MWAWOLEParser.cxx:772
long m_length
the data length (from current position)
Definition: Canvas5Parser.hxx:199
bool readUsed(Canvas5Structure::Stream &stream, std::string const &what)
try to read the used list
Definition: Canvas5Parser.cxx:3300
a sub stream of Canvas5Structure
Definition: Canvas5Structure.hxx:49
bool send(Canvas5ParserInternal::Slide const &slide)
try to send a page/slide
Definition: Canvas5Parser.cxx:2856
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:198
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
Internal: the slide data of a Canvas5Parser.
Definition: Canvas5Parser.cxx:73
static MWAWInputStreamPtr decode(MWAWInputStreamPtr input, int version)
try to decode the input stream
Definition: Canvas5Parser.cxx:3598
bool readDataHeader(Canvas5Structure::Stream &stream, int expectedSize, int &N)
try to read a data header, ie. N fields with a given size
Definition: Canvas5Parser.cxx:3018
Slide()
Definition: Canvas5Parser.cxx:74
bool readDocumentSettings(std::shared_ptr< Canvas5Structure::Stream > stream)
read the document settings
Definition: Canvas5Parser.cxx:1774
int m_numShapes
the number of shape
Definition: Canvas5Parser.cxx:102
friend class Canvas5Graph
Definition: Canvas5Parser.hxx:73
std::shared_ptr< Canvas5Image > m_imageParser
the image parser
Definition: Canvas5Parser.hxx:254
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: Canvas5Parser.cxx:2718
Definition: MWAWDocument.hxx:57
std::shared_ptr< Canvas5ParserInternal::State > m_state
the state
Definition: Canvas5Parser.hxx:250
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
librevenge::RVNGString getTextLink(int textLinkId) const
returns the link corresponding to a text id
Definition: Canvas5Parser.cxx:208
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
Definition: Canvas5Parser.cxx:2971
int m_numLayers
the number of layer
Definition: Canvas5Parser.cxx:84
the main class to read the style part of Canvas 5 file
Definition: Canvas5StyleManager.hxx:86
bool readPrinterRsrc(Canvas5Structure::Stream &stream)
try to read a printer rsrc
Definition: Canvas5Parser.cxx:2015
std::shared_ptr< Canvas5Graph > m_graphParser
the graph parser
Definition: Canvas5Parser.hxx:252
double getFormLength() const
returns the page length
Definition: MWAWPageSpan.hxx:117
a structure use to store a character style
Definition: Canvas5StyleManager.hxx:92
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
Layer()
constructor
Definition: Canvas5Parser.cxx:92
friend class Canvas5Image
Definition: Canvas5Parser.hxx:74
void resetGraphicListener()
resets the listener
Definition: MWAWParser.cxx:130
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:60
bool readDouble(Canvas5Structure::Stream &stream, double &val, bool &isNaN) const
try to read a double 8
Definition: Canvas5Parser.cxx:2959
Generated on Mon Jul 26 2021 00:00:00 for libmwaw by
doxygen 1.8.20