Go to the documentation of this file.
34 #ifndef MACDRAFT5_PARSER
35 # define MACDRAFT5_PARSER
40 #include <librevenge/librevenge.h>
94 bool sendText(
int layoutId,
long shapeId);
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MacDraft5Parser.cxx:445
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
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: MacDraft5Parser.cxx:492
std::vector< int > m_childList
the child list id ( for a group )
Definition: MacDraft5Parser.cxx:185
MWAWVec2f m_origin
the origin of the picture
Definition: MacDraft5Parser.cxx:399
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:314
a public structure used to return the version
Definition: MWAWRSRCParser.hxx:133
std::string m_string
the major string
Definition: MWAWRSRCParser.hxx:150
MWAWBox2f getBdBox() const
return the shape bdbox
Definition: MacDraft5Parser.cxx:95
std::shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:549
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacDraft5Parser.cxx:422
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
MacDraft5Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacDraft5Parser.cxx:466
std::vector< int > m_bitmapIdList
the list of bitmap id ( for a bitmap)
Definition: MacDraft5Parser.cxx:187
MWAWBox2f getBdBox() const
returns the basic bdbox
Definition: MWAWGraphicShape.hxx:197
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
Internal and low level: a image of a library used in MacDraf5Parser.
Definition: MacDraft5Parser.cxx:357
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
generic class used to store shape in MWAWDraftParser
Definition: MacDraft5Parser.cxx:65
friend class MacDraft5StyleManager
Definition: MacDraft5Parser.hxx:63
long m_parentId
the parent id
Definition: MacDraft5Parser.cxx:173
MWAWParagraph m_paragraph
the paragraph ( for a text box)
Definition: MacDraft5Parser.cxx:181
bool readText(MacDraft5ParserInternal::Shape &shape)
try to read the text data corresponding to a text shape
Definition: MacDraft5Parser.cxx:2128
friend std::ostream & operator<<(std::ostream &o, Image const &im)
operator<<
Definition: MacDraft5Parser.cxx:366
bool isParsed() const
a flag to know if the entry was parsed or not
Definition: MWAWEntry.hxx:121
static MWAWGraphicShape pie(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a pie
Definition: MWAWGraphicShape.hxx:147
void translate(MWAWVec2f const &delta)
translate all the coordinate by delta
Definition: MWAWGraphicShape.cxx:356
State()
constructor
Definition: MacDraft5Parser.cxx:386
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:74
@ boldBit
Definition: MWAWFont.hxx:190
bool readPICTList(MWAWEntry const &entry, bool inRsrc)
try to read the PICT unknown entry: pnot:0
Definition: MacDraft5Parser.cxx:2547
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:520
librevenge::RVNGString m_name
the layout name
Definition: MacDraft5Parser.cxx:245
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:341
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
void translate(MWAWVec2f const &dir)
translate a shape
Definition: MacDraft5Parser.cxx:100
std::map< long, MWAWFont > m_posToFontMap
the font ( for a text box)
Definition: MacDraft5Parser.cxx:179
int id() const
returns the id
Definition: MWAWEntry.hxx:164
std::vector< MWAWGraphicShape > m_otherShapeList
other graphic shapes ( for complex basic geometric form )
Definition: MacDraft5Parser.cxx:167
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
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
long m_modifierId
the modifier id
Definition: MacDraft5Parser.cxx:175
static MWAWGraphicShape line(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a line
Definition: MWAWGraphicShape.cxx:228
std::string m_extra
extra data
Definition: MacDraft5Parser.cxx:379
int m_id
the layout id
Definition: MacDraft5Parser.cxx:237
std::string const & type() const
returns the type of the entry
Definition: MWAWEntry.hxx:137
bool isEmpty() const
returns true if the layout contains no shape
Definition: MacDraft5Parser.cxx:210
std::shared_ptr< MacDraft5StyleManager > m_styleManager
the style manager
Definition: MacDraft5Parser.hxx:149
MWAWBox2f m_box
the shape bdbox
Definition: MacDraft5Parser.cxx:157
Layout(int id)
constructor
Definition: MacDraft5Parser.cxx:197
int m_objectId
the object number
Definition: MacDraft5Parser.cxx:243
MWAWEntry m_entry
the layout position in the data fork
Definition: MacDraft5Parser.cxx:239
@ Unknown
Definition: MacDraft5Parser.cxx:67
std::shared_ptr< MacDraft5ParserInternal::State > m_state
the state
Definition: MacDraft5Parser.hxx:151
int m_layoutId
the layout id
Definition: MacDraft5Parser.cxx:437
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
class to store the paragraph properties
Definition: MWAWParagraph.hxx:85
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
@ Simple
Definition: MWAWFont.hxx:49
#define MWAW_FALLTHROUGH
Definition: libmwaw_internal.hxx:118
MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const ¢er, float angle)
rotate a point around center, angle is given in degree
Definition: libmwaw_internal.cxx:700
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
void transform(float rotate, bool flipX, MWAWVec2f const ¢er)
transform a shape
Definition: MacDraft5Parser.cxx:108
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:126
bool readLibraryFooter()
try to read last library zone
Definition: MacDraft5Parser.cxx:939
class to read/store MacDraft5 v4-v5 styles
Definition: MacDraft5StyleManager.hxx:58
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:42
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
MWAWBox2f m_bdBox
the shape bdbox
Definition: MWAWGraphicShape.hxx:218
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:410
static MWAWGraphicShape measure(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a measure
Definition: MWAWGraphicShape.cxx:246
MWAWVec2f m_origin
the shape origin
Definition: MacDraft5Parser.cxx:159
~MacDraft5Parser() final
destructor
Definition: MacDraft5Parser.cxx:474
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
bool readLayoutDefinitions(MWAWEntry const &entry, bool inRsrc)
try to read a LAYI:0 resource
Definition: MacDraft5Parser.cxx:2587
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:514
std::vector< std::shared_ptr< Shape > > m_shapeList
the shapes list
Definition: MacDraft5Parser.cxx:247
static MWAWGraphicShape circle(MWAWBox2f const &box)
static constructor to create a circle
Definition: MWAWGraphicShape.hxx:129
@ Group
Definition: MacDraft5Parser.cxx:67
MWAWEntry m_textEntry
the textbox entry (main text)
Definition: MacDraft5Parser.cxx:183
std::vector< std::shared_ptr< Image > > m_imageList
the image list
Definition: MacDraft5Parser.cxx:403
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
long m_id
the shape id
Definition: MacDraft5Parser.cxx:171
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
@ Polygon
Definition: MWAWGraphicShape.hxx:49
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1129
bool sendText(int layoutId, long shapeId)
try to send text with given id
Definition: MacDraft5Parser.cxx:2848
long m_nameId
the name id
Definition: MacDraft5Parser.cxx:177
SubDocumentType
Definition: libmwaw_internal.hxx:188
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
@ JustificationCenter
Definition: MWAWParagraph.hxx:90
Internal and low level: a class used to store layout definition of a MacDraf5Parser.
Definition: MacDraft5Parser.cxx:195
friend std::ostream & operator<<(std::ostream &o, Layout const &lay)
operator<<
Definition: MacDraft5Parser.cxx:229
std::vector< MWAWGraphicStyle > m_otherStyleList
the other graphic style ( for complex basic geometric form )
Definition: MacDraft5Parser.cxx:165
librevenge::RVNGString m_name
the image name
Definition: MacDraft5Parser.cxx:377
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
@ MWAW_T_MACDRAFT
MacDraft: v1, v4-v5.
Definition: MWAWDocument.hxx:123
T y() const
second element
Definition: libmwaw_internal.hxx:673
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
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:508
Type
the different shape
Definition: MacDraft5Parser.cxx:67
bool readObject(MacDraft5ParserInternal::Layout &layout)
try to read an object
Definition: MacDraft5Parser.cxx:1024
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
double getFormLength() const
returns the form length
Definition: MWAWParser.hxx:170
T x() const
first element
Definition: libmwaw_internal.hxx:668
std::vector< MWAWBox2i > m_bitmapDimensionList
the list of bitmap dimension ( for a bitmap)
Definition: MacDraft5Parser.cxx:189
MWAWGraphicShape m_shape
the graphic shape ( for basic geometric form )
Definition: MacDraft5Parser.cxx:163
Image()
constructor
Definition: MacDraft5Parser.cxx:359
bool readStringList()
try to read a list of strings
Definition: MacDraft5Parser.cxx:2280
Shape()
constructor
Definition: MacDraft5Parser.cxx:70
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
bool readPrintInfo()
try to read the print info zone
Definition: MacDraft5Parser.cxx:2326
bool readViews(MWAWEntry const &entry, bool inRsrc)
try to read a list of views : VIEW:1
Definition: MacDraft5Parser.cxx:2471
bool m_isLibrary
flag to know if we read a library
Definition: MacDraft5Parser.cxx:397
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
std::vector< MWAWVec2f > m_vertices
the list of vertices for lines or polygons
Definition: MWAWGraphicShape.hxx:226
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:560
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
std::map< long, size_t > m_idToShapePosMap
a map id to position in shapeList
Definition: MacDraft5Parser.cxx:251
bool readDocFooter()
try to read last doc zone
Definition: MacDraft5Parser.cxx:873
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
#define M_PI
Definition: libmwaw_internal.hxx:52
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
@ Path
Definition: MWAWGraphicShape.hxx:49
@ PageBreak
Definition: MWAWListener.hxx:58
Type m_type
the type
Definition: MWAWGraphicShape.hxx:216
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
std::vector< std::shared_ptr< Layout > > m_layoutList
the layer list
Definition: MacDraft5Parser.cxx:401
Definition: libmwaw_internal.hxx:144
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
double getFormWidth() const
returns the form width
Definition: MWAWParser.hxx:175
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
MWAWGraphicShape rotate(float angle, MWAWVec2f const ¢er) const
return a new shape corresponding to a rotation from center.
Definition: MWAWGraphicShape.cxx:381
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:553
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
the main class to read a MacDraft5 v4-v5 file
Definition: MacDraft5Parser.hxx:62
std::vector< size_t > m_rootList
the root position list
Definition: MacDraft5Parser.cxx:249
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
static MWAWBox2f rotateBox(MWAWBox2f const &box, float angle, MWAWVec2f const ¢er)
returns the rotation of a box
Definition: MacDraft5Parser.cxx:136
@ Bitmap
Definition: MacDraft5Parser.cxx:67
bool readModifier(MacDraft5ParserInternal::Shape &shape)
try to read a modifier
Definition: MacDraft5Parser.cxx:2204
bool readDocHeader()
try to read the doc header zone ( mainly unknown )
Definition: MacDraft5Parser.cxx:708
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
@ Basic
Definition: MacDraft5Parser.cxx:67
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MacDraft5Parser.cxx:650
bool createZones()
finds the different objects zones
Definition: MacDraft5Parser.cxx:567
bool m_isLine
flag to know if the shape is a line
Definition: MacDraft5Parser.cxx:169
MWAWGraphicStyle m_style
the graphic style
Definition: MacDraft5Parser.cxx:161
static MWAWGraphicShape arc(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a arc
Definition: MWAWGraphicShape.hxx:137
void setPageName(librevenge::RVNGString const &name)
set the page name
Definition: MWAWPageSpan.hxx:228
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:516
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
bool m_isSent
a flag used to know if the object is sent to the listener or not
Definition: MacDraft5Parser.cxx:191
std::string m_extra
extra data
Definition: MacDraft5Parser.cxx:253
@ italicBit
Definition: MWAWFont.hxx:190
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
long m_id
the first shape id ( in general a group )
Definition: MacDraft5Parser.cxx:375
bool readLibraryHeader()
try to read the library header zone ( mainly unknown )
Definition: MacDraft5Parser.cxx:908
long m_id
the subdocument id
Definition: MacDraft5Parser.cxx:439
int m_N
the number of elements
Definition: MacDraft5Parser.cxx:241
std::shared_ptr< Shape > findShape(long id, bool normallyExist=true) const
returns a child corresponding to an id
Definition: MacDraft5Parser.cxx:215
@ Page
Definition: MWAWPosition.hxx:51
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
@ JustificationRight
Definition: MWAWParagraph.hxx:91
~SubDocument() final
destructor
Definition: MacDraft5Parser.cxx:419
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:506
int m_fileType
the file type
Definition: MacDraft5Parser.cxx:155
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 subdocument of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:409
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:130
Internal: the state of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:384
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacDraft5Parser.cxx:535
bool readPICT(MWAWEntry const &entry, librevenge::RVNGBinaryData &pict)
try to read a PICT entry (in data fork)
Definition: MacDraft5Parser.cxx:2441
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
SubDocument(SubDocument const &orig)=delete
SubDocument(MacDraft5Parser &pars, MWAWInputStreamPtr const &input, int layoutId, long zoneId)
Definition: MacDraft5Parser.cxx:411
SubDocument & operator=(SubDocument const &orig)=delete
int m_version
the file version
Definition: MacDraft5Parser.cxx:395
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
Type m_type
the graphic type
Definition: MacDraft5Parser.cxx:153
void scale(MWAWVec2f const &factor)
rescale all the coordinate
Definition: MWAWGraphicShape.cxx:368
bool readLayout(MacDraft5ParserInternal::Layout &layout)
try to read the layout zone
Definition: MacDraft5Parser.cxx:2385
Internal: the structures of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:63
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:270
Definition: MWAWDocument.hxx:57
void init()
inits all internal variables
Definition: MacDraft5Parser.cxx:478
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:544
@ Text
Definition: MacDraft5Parser.cxx:67
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
void updateRelations()
try to check/update the parent relations are compatible with group childs, no loop exist,...
Definition: MacDraft5Parser.cxx:256
bool sendBitmap(MacDraft5ParserInternal::Shape const &bitmap, MWAWPosition const &position)
try to send a bitmap
Definition: MacDraft5Parser.cxx:2825
@ QuotationSurface
Definition: MacDraft5Parser.cxx:67
Class to store font.
Definition: MWAWFont.hxx:44
bool readLinks(MWAWEntry const &entry, bool inRsrc)
try to read Link:128 resource
Definition: MacDraft5Parser.cxx:2674
a simple path component
Definition: MWAWGraphicShape.hxx:53
bool send(MacDraft5ParserInternal::Image const &image)
try to send all shapes in an image
Definition: MacDraft5Parser.cxx:2705
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:442
static MWAWGraphicShape rectangle(MWAWBox2f const &box, MWAWVec2f const &corners=MWAWVec2f(0, 0))
static constructor to create a rectangle
Definition: MWAWGraphicShape.hxx:120
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
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:466
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
MWAWBox2f m_formBox
the internal shape bdbox ( used for arc, circle to store the circle bdbox )
Definition: MWAWGraphicShape.hxx:220
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20