Go to the documentation of this file.
34 #ifndef MACDRAFT_PARSER
35 # define MACDRAFT_PARSER
40 #include <librevenge/librevenge.h>
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
MWAWVariable< Justification > m_justify
the justification
Definition: MWAWParagraph.hxx:167
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
@ Text
Definition: MacDraftParser.cxx:88
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
@ smallCapsBit
Definition: MWAWFont.hxx:192
MWAWBox2f getBdBox() const
returns the basic bdbox
Definition: MWAWGraphicShape.hxx:197
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWFont m_font
the font ( for a text box)
Definition: MacDraftParser.cxx:193
bool readPattern()
try to read a pattern
Definition: MacDraftParser.cxx:1195
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
@ Unknown
Definition: MacDraftParser.cxx:88
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:415
void transform(float rotate, bool flipX, MWAWVec2f const ¢er)
transform a shape
Definition: MacDraftParser.cxx:126
bool readZone()
try to a unknown zone
Definition: MacDraftParser.cxx:562
float m_labelWidth
the 1D label width in point
Definition: MacDraftParser.cxx:199
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
~MacDraftParser() final
destructor
Definition: MacDraftParser.cxx:344
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:74
@ boldBit
Definition: MWAWFont.hxx:190
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:520
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacDraftParser.cxx:296
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
MacDraftParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacDraftParser.cxx:337
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
std::vector< size_t > m_childList
the child list ( for a group )
Definition: MacDraftParser.cxx:201
void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed)
set the interline
Definition: MWAWParagraph.hxx:129
int m_id
the shape id
Definition: MacDraftParser.cxx:189
@ Label
Definition: MacDraftParser.cxx:88
MWAWEntry m_entry
the data position
Definition: MacDraftParser.cxx:82
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
unsigned long m_id
the bitmap id
Definition: MacDraftParser.cxx:76
the class to store a color
Definition: libmwaw_internal.hxx:192
Shape()
constructor
Definition: MacDraftParser.cxx:91
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
static MWAWGraphicShape line(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a line
Definition: MWAWGraphicShape.cxx:228
bool createZones()
finds the different objects zones
Definition: MacDraftParser.cxx:418
int m_nextId
the following id (if set)
Definition: MacDraftParser.cxx:191
@ 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
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
std::vector< Shape > m_shapeList
the shapes list
Definition: MacDraftParser.cxx:240
std::vector< MWAWGraphicStyle::Pattern > m_patternList
the patterns list
Definition: MacDraftParser.cxx:238
std::vector< unsigned long > m_bitmapIdList
the list of bitmap id ( for a bitmap)
Definition: MacDraftParser.cxx:203
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
int m_version
the file version
Definition: MacDraftParser.cxx:236
SubDocument(MacDraftParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MacDraftParser.cxx:286
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
std::vector< unsigned char > m_data
the pattern data: a sequence of data: p[0..7,0],p[8..15,0]...p[0..7,1],p[8..15,1],...
Definition: MWAWGraphicStyle.hxx:363
void set(int i, int j, MWAWColor const &v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:529
int m_patternId
the pattern id
Definition: MacDraftParser.cxx:183
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
@ embossBit
Definition: MWAWFont.hxx:190
std::shared_ptr< MacDraftParserInternal::State > m_state
the state
Definition: MacDraftParser.hxx:118
@ uppercaseBit
Definition: MWAWFont.hxx:192
static MWAWGraphicShape circle(MWAWBox2f const &box)
static constructor to create a circle
Definition: MWAWGraphicShape.hxx:129
MWAWGraphicStyle m_style
the graphic style
Definition: MacDraftParser.cxx:181
bool send(MacDraftParserInternal::Shape const &shape)
try to send a shape
Definition: MacDraftParser.cxx:1684
void setRow(int j, MWAWColor const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:534
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
MWAWParagraph m_paragraph
the paragraph ( for a text box)
Definition: MacDraftParser.cxx:195
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:277
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
SubDocumentType
Definition: libmwaw_internal.hxx:188
bool getPattern(int id, MWAWGraphicStyle::Pattern &pat)
returns a pattern if posible
Definition: MacDraftParser.cxx:222
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
@ shadowBit
Definition: MWAWFont.hxx:191
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
std::map< unsigned long, BitmapFileData > m_idToBitmapMap
map id to bitmap file data
Definition: MacDraftParser.cxx:242
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
Type m_type
the graphic type
Definition: MacDraftParser.cxx:175
@ MWAW_T_MACDRAFT
MacDraft: v1, v4-v5.
Definition: MWAWDocument.hxx:123
T y() const
second element
Definition: libmwaw_internal.hxx:673
void translate(MWAWVec2f const &dir)
translate a shape
Definition: MacDraftParser.cxx:118
MWAWGraphicShape m_shape
the graphic shape ( for basic geometric form )
Definition: MacDraftParser.cxx:185
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
bool readLabel()
try to read a label
Definition: MacDraftParser.cxx:1249
bool sendBitmap(MacDraftParserInternal::Shape const &bitmap, MWAWPosition const &position)
try to send a bitmap
Definition: MacDraftParser.cxx:1773
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:508
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
void setEnd(long off)
sets the end offset
Definition: MWAWEntry.hxx:77
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacDraftParser.cxx:396
T x() const
first element
Definition: libmwaw_internal.hxx:668
MWAWBox2f getBdBox() const
return the shape bdbox
Definition: MacDraftParser.cxx:113
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
bool readBitmapData()
try to read bitmap data
Definition: MacDraftParser.cxx:1066
MWAWBox2f m_box
the shape bdbox
Definition: MacDraftParser.cxx:177
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
bool readBitmapDefinition(MacDraftParserInternal::Shape &bitmap)
try to read bitmap definition
Definition: MacDraftParser.cxx:1123
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
bool m_isLine
flag to know if the shape is a line
Definition: MacDraftParser.cxx:187
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
#define M_PI
Definition: libmwaw_internal.hxx:52
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:358
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
low level: bitmap file position in a MacDraft file
Definition: MacDraftParser.cxx:59
bool readPrintInfo()
try to read the print info zone
Definition: MacDraftParser.cxx:1622
static MWAWBox2f rotateBox(MWAWBox2f const &box, float angle, MWAWVec2f const ¢er)
returns the rotation of a box
Definition: MacDraftParser.cxx:159
Type m_type
the type
Definition: MWAWGraphicShape.hxx:216
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
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
void setOrigin(MWAWVec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:210
Internal: the subdocument of a MacDraftParser.
Definition: MacDraftParser.cxx:284
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
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
SubDocument(SubDocument const &orig)=delete
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:426
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
MWAWBox2i m_dimension
the bitmap dimension
Definition: MacDraftParser.cxx:80
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
MWAWEntry m_textEntry
the textbox entry (main text)
Definition: MacDraftParser.cxx:197
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
@ Basic
Definition: MacDraftParser.cxx:88
bool ok() const
check is the entry is coherent
Definition: MacDraftParser.cxx:69
generic class used to store shape in MWAWDraftParser
Definition: MacDraftParser.cxx:86
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
MWAWVec2f m_cornerWidth
the rectangle round corner
Definition: MWAWGraphicShape.hxx:222
bool m_isSent
a flag used to know if the object is sent to the listener or not
Definition: MacDraftParser.cxx:207
static MWAWGraphicShape arc(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a arc
Definition: MWAWGraphicShape.hxx:137
bool readObject()
try to read an object
Definition: MacDraftParser.cxx:593
@ Bitmap
Definition: MacDraftParser.cxx:88
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:361
std::vector< MWAWBox2i > m_bitmapDimensionList
the list of bitmap dimension ( for a bitmap)
Definition: MacDraftParser.cxx:205
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: MacDraftParser.cxx:361
Type
the different shape
Definition: MacDraftParser.cxx:88
~SubDocument() final
destructor
Definition: MacDraftParser.cxx:293
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
@ Group
Definition: MacDraftParser.cxx:88
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
void initPatterns()
init the patterns list
Definition: MacDraftParser.cxx:245
MWAWVec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:1072
@ italicBit
Definition: MWAWFont.hxx:190
int m_rowSize
the row size
Definition: MacDraftParser.cxx:78
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
void init()
inits all internal variables
Definition: MacDraftParser.cxx:348
bool readDocHeader()
try to the doc header zone ( mainly unknown )
Definition: MacDraftParser.cxx:1444
BitmapFileData()
constructor
Definition: MacDraftParser.cxx:61
@ Page
Definition: MWAWPosition.hxx:51
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
@ JustificationRight
Definition: MWAWParagraph.hxx:91
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWVec2f m_origin
the shape origin
Definition: MacDraftParser.cxx:179
SubDocument & operator=(SubDocument const &orig)=delete
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:198
Internal: the structures of a MacDraftParser.
Definition: MacDraftParser.cxx:57
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
void scale(MWAWVec2f const &factor)
rescale all the coordinate
Definition: MWAWGraphicShape.cxx:368
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MacDraftParser.cxx:316
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
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:544
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
the main class to read a MacDraft v1 file
Definition: MacDraftParser.hxx:59
Internal: the state of a MacDraftParser.
Definition: MacDraftParser.cxx:212
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:469
Class to store font.
Definition: MWAWFont.hxx:44
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MacDraftParser.cxx:1363
State()
constructor
Definition: MacDraftParser.cxx:214
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
int m_id
the subdocument id
Definition: MacDraftParser.cxx:310
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
bool sendText(int zoneId)
try to send a text zone to the listener
Definition: MacDraftParser.cxx:1853
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
@ lowercaseBit
Definition: MWAWFont.hxx:193
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20