Go to the documentation of this file.
34 #ifndef MACDRAFT5_PARSER
35 # define MACDRAFT5_PARSER
40 #include <librevenge/librevenge.h>
75 void parse(librevenge::RVNGDrawingInterface *documentInterface);
82 void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
94 bool sendText(
int layoutId,
long shapeId);
151 shared_ptr<MacDraft5ParserInternal::State>
m_state;
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
std::vector< int > m_childList
the child list id ( for a group )
Definition: MacDraft5Parser.cxx:168
MWAWVec2f m_origin
the origin of the picture
Definition: MacDraft5Parser.cxx:366
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:293
a public structure used to return the version
Definition: MWAWRSRCParser.hxx:133
std::string m_string
the major string
Definition: MWAWRSRCParser.hxx:144
MWAWBox2f getBdBox() const
return the shape bdbox
Definition: MacDraft5Parser.cxx:78
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:262
std::vector< int > m_bitmapIdList
the list of bitmap id ( for a bitmap)
Definition: MacDraft5Parser.cxx:170
MWAWBox2f getBdBox() const
returns the basic bdbox
Definition: MWAWGraphicShape.hxx:172
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:785
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:332
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:156
MWAWParagraph m_paragraph
the paragraph ( for a text box)
Definition: MacDraft5Parser.cxx:164
bool readText(MacDraft5ParserInternal::Shape &shape)
try to read the text data corresponding to a text shape
Definition: MacDraft5Parser.cxx:2091
friend std::ostream & operator<<(std::ostream &o, Image const &im)
operator<<
Definition: MacDraft5Parser.cxx:338
bool isParsed() const
a flag to know if the entry was parsed or not
Definition: MWAWEntry.hxx:110
static MWAWGraphicShape pie(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a pie
Definition: MWAWGraphicShape.hxx:130
void translate(MWAWVec2f const &delta)
translate all the coordinate by delta
Definition: MWAWGraphicShape.cxx:351
State()
constructor
Definition: MacDraft5Parser.cxx:358
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:69
@ boldBit
Definition: MWAWFont.hxx:182
bool readPICTList(MWAWEntry const &entry, bool inRsrc)
try to read the PICT unknown entry: pnot:0
Definition: MacDraft5Parser.cxx:2510
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:387
MacDraft5Parser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: MacDraft5Parser.cxx:434
librevenge::RVNGString m_name
the layout name
Definition: MacDraft5Parser.cxx:219
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:320
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:83
std::map< long, MWAWFont > m_posToFontMap
the font ( for a text box)
Definition: MacDraft5Parser.cxx:162
int id() const
returns the id
Definition: MWAWEntry.hxx:153
std::vector< MWAWGraphicShape > m_otherShapeList
other graphic shapes ( for complex basic geometric form )
Definition: MacDraft5Parser.cxx:150
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:202
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
the class to store a color
Definition: libmwaw_internal.hxx:182
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:425
std::vector< shared_ptr< Layout > > m_layoutList
the layer list
Definition: MacDraft5Parser.cxx:368
std::vector< shared_ptr< Shape > > m_shapeList
the shapes list
Definition: MacDraft5Parser.cxx:221
long m_modifierId
the modifier id
Definition: MacDraft5Parser.cxx:158
static MWAWGraphicShape line(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a line
Definition: MWAWGraphicShape.cxx:227
std::string m_extra
extra data
Definition: MacDraft5Parser.cxx:351
int m_id
the layout id
Definition: MacDraft5Parser.cxx:211
std::string const & type() const
returns the type of the entry
Definition: MWAWEntry.hxx:126
bool isEmpty() const
returns true if the layout contains no shape
Definition: MacDraft5Parser.cxx:184
MWAWBox2f m_box
the shape bdbox
Definition: MacDraft5Parser.cxx:140
Layout(int id)
constructor
Definition: MacDraft5Parser.cxx:180
int m_objectId
the object number
Definition: MacDraft5Parser.cxx:217
MWAWEntry m_entry
the layout position in the data fork
Definition: MacDraft5Parser.cxx:213
@ Unknown
Definition: MacDraft5Parser.cxx:67
int m_layoutId
the layout id
Definition: MacDraft5Parser.cxx:404
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
shared_ptr< MacDraft5ParserInternal::State > m_state
the state
Definition: MacDraft5Parser.hxx:151
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:187
@ Simple
Definition: MWAWFont.hxx:49
MWAWVec2f rotatePointAroundCenter(MWAWVec2f const &point, MWAWVec2f const ¢er, float angle)
rotate a point around center, angle is given in degree
Definition: libmwaw_internal.cxx:689
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
void transform(float rotate, bool flipX, MWAWVec2f const ¢er)
transform a shape
Definition: MacDraft5Parser.cxx:91
SubDocument(SubDocument const &orig)
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:115
bool readLibraryFooter()
try to read last library zone
Definition: MacDraft5Parser.cxx:904
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:193
SubDocument(MacDraft5Parser &pars, MWAWInputStreamPtr input, int layoutId, long zoneId)
Definition: MacDraft5Parser.cxx:378
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:277
static MWAWGraphicShape measure(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a measure
Definition: MWAWGraphicShape.cxx:245
MWAWVec2f m_origin
the shape origin
Definition: MacDraft5Parser.cxx:142
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:2550
shared_ptr< Shape > findShape(long id, bool normallyExist=true) const
returns a child corresponding to an id
Definition: MacDraft5Parser.cxx:189
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:381
static MWAWGraphicShape circle(MWAWBox2f const &box)
static constructor to create a circle
Definition: MWAWGraphicShape.hxx:112
@ Group
Definition: MacDraft5Parser.cxx:67
MWAWEntry m_textEntry
the textbox entry (main text)
Definition: MacDraft5Parser.cxx:166
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
long m_id
the shape id
Definition: MacDraft5Parser.cxx:154
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:172
@ Polygon
Definition: MWAWGraphicShape.hxx:49
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1070
bool sendText(int layoutId, long shapeId)
try to send text with given id
Definition: MacDraft5Parser.cxx:2811
long m_nameId
the name id
Definition: MacDraft5Parser.cxx:160
SubDocumentType
Definition: libmwaw_internal.hxx:178
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
@ JustificationCenter
Definition: MWAWParagraph.hxx:87
Internal and low level: a class used to store layout definition of a MacDraf5Parser.
Definition: MacDraft5Parser.cxx:178
friend std::ostream & operator<<(std::ostream &o, Layout const &lay)
operator<<
Definition: MacDraft5Parser.cxx:203
std::vector< MWAWGraphicStyle > m_otherStyleList
the other graphic style ( for complex basic geometric form )
Definition: MacDraft5Parser.cxx:148
librevenge::RVNGString m_name
the image name
Definition: MacDraft5Parser.cxx:349
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:105
std::string getDebugString(shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
@ MWAW_T_MACDRAFT
MacDraft: v1, v4-v5.
Definition: MWAWDocument.hxx:123
T y() const
second element
Definition: libmwaw_internal.hxx:620
MWAWRSRCParserPtr & getRSRCParser()
returns the rsrc parser
Definition: MWAWParser.hxx:190
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:501
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:197
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:375
Type
the different shape
Definition: MacDraft5Parser.cxx:67
bool readObject(MacDraft5ParserInternal::Layout &layout)
try to read an object
Definition: MacDraft5Parser.cxx:989
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:177
double getFormLength() const
returns the form length
Definition: MWAWParser.hxx:170
virtual ~MacDraft5Parser()
destructor
Definition: MacDraft5Parser.cxx:440
T x() const
first element
Definition: libmwaw_internal.hxx:615
virtual ~SubDocument()
destructor
Definition: MacDraft5Parser.cxx:381
std::vector< MWAWBox2i > m_bitmapDimensionList
the list of bitmap dimension ( for a bitmap)
Definition: MacDraft5Parser.cxx:172
MWAWGraphicShape m_shape
the graphic shape ( for basic geometric form )
Definition: MacDraft5Parser.cxx:146
Image()
constructor
Definition: MacDraft5Parser.cxx:334
bool readStringList()
try to read a list of strings
Definition: MacDraft5Parser.cxx:2243
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:2289
bool readViews(MWAWEntry const &entry, bool inRsrc)
try to read a list of views : VIEW:1
Definition: MacDraft5Parser.cxx:2434
bool m_isLibrary
flag to know if we read a library
Definition: MacDraft5Parser.cxx:364
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:56
std::vector< MWAWVec2f > m_vertices
the list of vertices for lines or polygons
Definition: MWAWGraphicShape.hxx:201
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:437
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:113
std::map< long, size_t > m_idToShapePosMap
a map id to position in shapeList
Definition: MacDraft5Parser.cxx:225
bool readDocFooter()
try to read last doc zone
Definition: MacDraft5Parser.cxx:838
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
#define M_PI
Definition: libmwaw_internal.hxx:49
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:82
@ Path
Definition: MWAWGraphicShape.hxx:49
@ PageBreak
Definition: MWAWListener.hxx:58
Type m_type
the type
Definition: MWAWGraphicShape.hxx:191
Definition: libmwaw_internal.hxx:142
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:72
double getFormWidth() const
returns the form width
Definition: MWAWParser.hxx:175
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:61
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:377
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:430
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:1134
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:223
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:243
static MWAWBox2f rotateBox(MWAWBox2f const &box, float angle, MWAWVec2f const ¢er)
returns the rotation of a box
Definition: MacDraft5Parser.cxx:119
@ Bitmap
Definition: MacDraft5Parser.cxx:67
bool readModifier(MacDraft5ParserInternal::Shape &shape)
try to read a modifier
Definition: MacDraft5Parser.cxx:2167
bool readDocHeader()
try to read the doc header zone ( mainly unknown )
Definition: MacDraft5Parser.cxx:674
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:197
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:218
@ Basic
Definition: MacDraft5Parser.cxx:67
bool createZones()
finds the different objects zones
Definition: MacDraft5Parser.cxx:533
bool m_isLine
flag to know if the shape is a line
Definition: MacDraft5Parser.cxx:152
MWAWGraphicStyle m_style
the graphic style
Definition: MacDraft5Parser.cxx:144
static MWAWGraphicShape arc(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a arc
Definition: MWAWGraphicShape.hxx:120
void setPageName(librevenge::RVNGString const &name)
set the page name
Definition: MWAWPageSpan.hxx:222
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
long end() const
returns the end offset
Definition: MWAWEntry.hxx:77
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:254
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:383
void parse(librevenge::RVNGDrawingInterface *documentInterface)
virtual function used to parse the input
Definition: MacDraft5Parser.cxx:458
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1132
bool m_isSent
a flag used to know if the object is sent to the listener or not
Definition: MacDraft5Parser.cxx:174
std::string m_extra
extra data
Definition: MacDraft5Parser.cxx:227
@ italicBit
Definition: MWAWFont.hxx:182
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
std::vector< shared_ptr< Image > > m_imageList
the image list
Definition: MacDraft5Parser.cxx:370
long m_id
the first shape id ( in general a group )
Definition: MacDraft5Parser.cxx:347
bool readLibraryHeader()
try to read the library header zone ( mainly unknown )
Definition: MacDraft5Parser.cxx:873
long m_id
the subdocument id
Definition: MacDraft5Parser.cxx:406
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: MacDraft5Parser.cxx:616
int m_N
the number of elements
Definition: MacDraft5Parser.cxx:215
@ Page
Definition: MWAWPosition.hxx:51
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
@ JustificationRight
Definition: MWAWParagraph.hxx:88
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:73
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:373
int m_fileType
the file type
Definition: MacDraft5Parser.cxx:138
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:192
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:88
Internal: the subdocument of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:376
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:122
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
virtual bool operator==(MWAWSubDocument const &doc) const
operator!==
Definition: MacDraft5Parser.cxx:395
Internal: the state of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:356
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacDraft5Parser.cxx:501
bool readPICT(MWAWEntry const &entry, librevenge::RVNGBinaryData &pict)
try to read a PICT entry (in data fork)
Definition: MacDraft5Parser.cxx:2404
shared_ptr< MacDraft5StyleManager > m_styleManager
the style manager
Definition: MacDraft5Parser.hxx:149
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1008
int m_version
the file version
Definition: MacDraft5Parser.cxx:362
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:136
void scale(MWAWVec2f const &factor)
rescale all the coordinate
Definition: MWAWGraphicShape.cxx:363
bool readLayout(MacDraft5ParserInternal::Layout &layout)
try to read the layout zone
Definition: MacDraft5Parser.cxx:2348
Internal: the structures of a MacDraft5Parser.
Definition: MacDraft5Parser.cxx:63
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:254
void init()
inits all internal variables
Definition: MacDraft5Parser.cxx:444
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:421
@ 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:207
void updateRelations()
try to check/update the parent relations are compatible with group childs, no loop exist,...
Definition: MacDraft5Parser.cxx:230
bool sendBitmap(MacDraft5ParserInternal::Shape const &bitmap, MWAWPosition const &position)
try to send a bitmap
Definition: MacDraft5Parser.cxx:2788
SubDocument & operator=(SubDocument const &orig)
@ 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:2637
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:2668
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:309
static MWAWGraphicShape rectangle(MWAWBox2f const &box, MWAWVec2f const &corners=MWAWVec2f(0, 0))
static constructor to create a rectangle
Definition: MWAWGraphicShape.hxx:103
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:781
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:445
void resetGraphicListener()
resets the listener
Definition: MWAWParser.cxx:118
shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
virtual bool operator!=(MWAWSubDocument const &doc) const
operator!=
Definition: MacDraft5Parser.cxx:384
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:96
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:195
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: MacDraft5Parser.cxx:412
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:304
Generated on Wed Jun 17 2020 06:30:10 for libmwaw by
doxygen 1.8.18