Go to the documentation of this file.
34 #ifndef CANVAS5_PARSER
35 # define CANVAS5_PARSER
43 #include <librevenge/librevenge.h>
87 static std::
string getString(
unsigned val);
208 std::shared_ptr<Canvas5ParserInternal::State>
m_state;
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Internal: the layer of a Canvas5Parser.
Definition: Canvas5Parser.cxx:88
MWAWFontConverterPtr & getFontConverter()
returns the font converter
Definition: MWAWParser.hxx:150
bool readSlides(Canvas5Structure::Stream &stream)
try to read the list of slides
Definition: Canvas5Parser.cxx:1666
~Canvas5Parser() final
destructor
Definition: Canvas5Parser.cxx:181
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
std::map< int, Layer > m_idToLayer
the layer data
Definition: Canvas5Parser.cxx:154
#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:185
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
bool readLayers(Canvas5Structure::Stream &stream)
try to read the different layers
Definition: Canvas5Parser.cxx:1251
@ MWAW_T_CANVAS
Deneba Canvas: v2-v3 and v5.
Definition: MWAWDocument.hxx:228
bool readFileDesc(Canvas5Structure::Stream &stream)
try to read the last block: some pathes, ...
Definition: Canvas5Parser.cxx:750
bool readExtendedHeader(Canvas5Structure::Stream &stream, int expectedValue, std::string const &what, DataFunction const &func)
try to read an extended data header, ie.
Definition: Canvas5Parser.cxx:2119
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
State()
constructor
Definition: Canvas5Parser.cxx:111
bool readTextLinks(Canvas5Structure::Stream &stream)
try to read the text links
Definition: Canvas5Parser.cxx:1565
int id() const
returns the id
Definition: MWAWEntry.hxx:164
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
bool readPreview(Canvas5Structure::Stream &stream)
try to read the preview picture
Definition: Canvas5Parser.cxx:1356
the class to store a color
Definition: libmwaw_internal.hxx:192
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
the main class to read the graphic part of Canvas5 file
Definition: Canvas5Graph.hxx:83
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
bool readIndexMap(Canvas5Structure::Stream &stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction)
try to read a index map
Definition: Canvas5Parser.cxx:2288
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:232
static MWAWPictData * get(MWAWInputStreamPtr const &input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
std::vector< int > m_shapesId
the shape id
Definition: Canvas5Parser.cxx:102
MWAWInputStreamPtr input()
returns the input file
Definition: Canvas5Structure.hxx:62
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:164
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: Canvas5Parser.cxx:230
bool readPnot(Canvas5Structure::Stream &stream, MWAWEntry const &entry)
read the RSRC 0 pnot zone
Definition: Canvas5Parser.cxx:1918
void set(int i, int j, MWAWColor const &v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:537
int m_numShapes
the number of shapes
Definition: Canvas5Parser.cxx:156
librevenge::RVNGString m_name
the layer name
Definition: Canvas5Parser.cxx:98
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
bool readFileRSRCs(Canvas5Structure::Stream &stream)
try to read the third big block: a list of resource?, font, ...
Definition: Canvas5Parser.cxx:432
int m_documentSetup
the document setup: 0 full page, 1: two page bottom/down, 2: four page
Definition: Canvas5Parser.cxx:140
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
Internal: the state of a Canvas5Parser.
Definition: Canvas5Parser.cxx:109
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
T y() const
second element
Definition: libmwaw_internal.hxx:673
MWAWRSRCParserPtr & getRSRCParser()
returns the rsrc parser
Definition: MWAWParser.hxx:190
static MWAWInputStreamPtr decode(MWAWInputStreamPtr input)
try to decode the input stream
Definition: Canvas5Parser.cxx:2505
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
T x() const
first element
Definition: libmwaw_internal.hxx:668
MWAWVec2f m_dim
the slide dimension
Definition: Canvas5Parser.cxx:80
bool readSpecialData(long len, unsigned type, std::string &extra)
try to read a special shape data (internal helper to understand vkfl structure)
Definition: Canvas5Parser.cxx:190
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
libmwaw::DebugFile & ascii()
return the ascii file
Definition: Canvas5Structure.hxx:67
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
a namespace used to define basic structure to read a Canvas 5 file
Definition: Canvas5Graph.hxx:60
int m_numLayers
the number of layer
Definition: Canvas5Parser.cxx:152
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:198
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 files
Definition: Canvas5Parser.hxx:71
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:2391
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
std::vector< int > m_layers
the layer id
Definition: Canvas5Parser.cxx:84
std::map< int, Slide > m_idToSlide
the slide data
Definition: Canvas5Parser.cxx:149
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
bool readMainBlock(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the first big block
Definition: Canvas5Parser.cxx:399
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
std::shared_ptr< Canvas5Structure::Stream > m_stream
the current stream
Definition: Canvas5Parser.cxx:133
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:169
static void defDataFunction(Canvas5Structure::Stream &, int, std::string const &, long)
the default function to parse the data of a index map/a extended header
Definition: Canvas5Parser.hxx:176
int m_fileFlags
the file flags
Definition: Canvas5Parser.cxx:138
int m_numSlides
the number of slides
Definition: Canvas5Parser.cxx:145
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
std::shared_ptr< Canvas5StyleManager > m_styleManager
the style manager
Definition: Canvas5Parser.hxx:212
int m_type
the layer type (unknonw)
Definition: Canvas5Parser.cxx:104
bool createZones()
finds the different objects zones
Definition: Canvas5Parser.cxx:342
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
static std::string getString(unsigned val)
very low level: debug print some uint32_t either at char4 or sample int
Definition: Canvas5Parser.cxx:2570
bool readDocumentSettings(Canvas5Structure::Stream &stream)
read the document settings
Definition: Canvas5Parser.cxx:914
Internal: the structures of a Canvas5Parser.
Definition: Canvas5Parser.cxx:69
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
bool m_facingPages
true if the document uses facing page
Definition: Canvas5Parser.cxx:142
bool m_isWindowsFile
true if this is a windows file
Definition: Canvas5Parser.cxx:131
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
Definition: Canvas5Parser.cxx:2272
std::vector< int > m_slideIds
the slides id
Definition: Canvas5Parser.cxx:147
friend class Canvas5StyleManager
Definition: Canvas5Parser.hxx:73
bool readPicture(Canvas5Structure::Stream &stream, MWAWEntry const &entry)
read the RSRC Pict zone
Definition: Canvas5Parser.cxx:1946
bool decodeZone(MWAWInputStreamPtr input, long endPos, int type, unsigned long finalLength, std::shared_ptr< MWAWStringStream > &stream)
try to decode a zone
Definition: Canvas5Structure.cxx:304
int m_type
the document type 1: graphic, 2: list of pages, 3: slides
Definition: Canvas5Parser.cxx:136
bool readFileHeader(Canvas5Structure::Stream &stream)
try to read the file header
Definition: Canvas5Parser.cxx:811
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
a bitmap of int to store indexed bitmap
Definition: MWAWPictBitmap.hxx:361
bool readUsed(Canvas5Structure::Stream &stream, std::string const &what)
try to read the used list
Definition: Canvas5Parser.cxx:2445
a sub stream of Canvas5Structure
Definition: Canvas5Structure.hxx:46
bool send(Canvas5ParserInternal::Slide const &slide)
try to send a page/slide
Definition: Canvas5Parser.cxx:1990
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:71
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:2098
Slide()
Definition: Canvas5Parser.cxx:72
int m_numShapes
the number of shape
Definition: Canvas5Parser.cxx:100
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
Definition: Canvas5Parser.cxx:2187
friend class Canvas5Graph
Definition: Canvas5Parser.hxx:72
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: Canvas5Parser.cxx:1866
Definition: MWAWDocument.hxx:57
std::shared_ptr< Canvas5ParserInternal::State > m_state
the state
Definition: Canvas5Parser.hxx:208
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:475
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
Definition: Canvas5Parser.hxx:174
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:2051
int m_numLayers
the number of layer
Definition: Canvas5Parser.cxx:82
the main class to read the style part of Canvas 5 file
Definition: Canvas5StyleManager.hxx:77
bool readPrinterRsrc(Canvas5Structure::Stream &stream)
try to read a printer rsrc
Definition: Canvas5Parser.cxx:1426
std::shared_ptr< Canvas5Graph > m_graphParser
the graph parser
Definition: Canvas5Parser.hxx:210
double getFormLength() const
returns the page length
Definition: MWAWPageSpan.hxx:117
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:90
void resetGraphicListener()
resets the listener
Definition: MWAWParser.cxx:130
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
bool readBitmap(Canvas5Structure::Stream &stream, MWAWEmbeddedObject &object, MWAWColor *avgColor=nullptr)
try to read a bitmap
Definition: Canvas5Parser.cxx:1032
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:2039
Generated on Wed Apr 7 2021 00:00:00 for libmwaw by
doxygen 1.8.20