Go to the documentation of this file.
34 #ifndef MACDRAW_PARSER
35 # define MACDRAW_PARSER
40 #include <librevenge/librevenge.h>
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
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
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MacDrawParser.cxx:246
MWAWEntry m_textEntry
the textbox entry (main text)
Definition: MacDrawParser.cxx:105
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
MWAWBox2f getBdBox() const
returns the basic bdbox
Definition: MWAWGraphicShape.hxx:197
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: MacDrawParser.cxx:291
int m_nextId
the following id (if set)
Definition: MacDrawParser.cxx:99
#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
MWAWBox2f m_box
the shape bdbox
Definition: MacDrawParser.cxx:91
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
bool readPrefs()
try to the prefs zone ( mainly unknown )
Definition: MacDrawParser.cxx:987
MWAWGraphicStyle m_style
the graphic style
Definition: MacDrawParser.cxx:93
static MWAWGraphicShape pie(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a pie
Definition: MWAWGraphicShape.hxx:147
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:74
@ boldBit
Definition: MWAWFont.hxx:190
@ Bitmap
Definition: MacDrawParser.cxx:61
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
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
std::shared_ptr< MacDrawParserInternal::State > m_state
the state
Definition: MacDrawParser.hxx:109
Shape()
constructor
Definition: MacDrawParser.cxx:64
@ Text
Definition: MacDrawParser.cxx:61
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
bool createZones()
finds the different objects zones
Definition: MacDrawParser.cxx:348
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
the class to store a color
Definition: libmwaw_internal.hxx:192
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
int version() const
returns the works version
Definition: MWAWParser.hxx:108
Definition: MacDrawParser.cxx:59
MWAWParagraph m_paragraph
the paragraph ( for a text box)
Definition: MacDrawParser.cxx:103
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
std::vector< Shape > m_shapeList
the shape list
Definition: MacDrawParser.cxx:148
@ 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
MacDrawParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacDrawParser.cxx:267
@ 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
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:292
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
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
MWAWGraphicShape m_shape
the graphic shape ( for basic geometric form )
Definition: MacDrawParser.cxx:95
@ MWAW_T_MACDRAW
MacDraw: v0-v1.
Definition: MWAWDocument.hxx:124
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
static MWAWGraphicShape circle(MWAWBox2f const &box)
static constructor to create a circle
Definition: MWAWGraphicShape.hxx:129
int m_version
the file version
Definition: MacDrawParser.cxx:144
void init()
inits all internal variables
Definition: MacDrawParser.cxx:278
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
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:277
std::vector< size_t > m_childList
the child list ( for a group )
Definition: MacDrawParser.cxx:107
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
the main class to read a MacDraw v0,v1 file
Definition: MacDrawParser.hxx:59
State()
constructor
Definition: MacDrawParser.cxx:124
@ Polygon
Definition: MWAWGraphicShape.hxx:49
Type m_type
the graphic type
Definition: MacDrawParser.cxx:89
@ Rectangle
Definition: MWAWGraphicShape.hxx:49
void initPatterns()
init the patterns list
Definition: MacDrawParser.cxx:151
SubDocumentType
Definition: libmwaw_internal.hxx:188
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
~MacDrawParser() final
destructor
Definition: MacDrawParser.cxx:274
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
@ JustificationCenter
Definition: MWAWParagraph.hxx:90
SubDocument(MacDrawParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MacDrawParser.cxx:216
@ shadowBit
Definition: MWAWFont.hxx:191
bool sendBitmap(MacDrawParserInternal::Shape const &shape, MWAWPosition const &pos)
try to send a bitmap to the listener
Definition: MacDrawParser.cxx:1152
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
int m_id
the subdocument id
Definition: MacDrawParser.cxx:240
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
bool m_isSent
a flag used to know if the object is sent to the listener or not
Definition: MacDrawParser.cxx:117
Internal: the structures of a MacDrawParser.
Definition: MacDrawParser.cxx:57
int m_numBytesByRow
the number of bytes by row (for a bitmap)
Definition: MacDrawParser.cxx:109
T y() const
second element
Definition: libmwaw_internal.hxx:673
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
int m_id
the shape id
Definition: MacDrawParser.cxx:97
T x() const
first element
Definition: libmwaw_internal.hxx:668
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
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
SubDocument & operator=(SubDocument const &orig)=delete
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
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
MWAWEntry m_bitmapEntry
the bitmap entry (data)
Definition: MacDrawParser.cxx:115
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
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MacDrawParser.cxx:906
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
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
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
bool sendText(int zoneId)
try to send a text zone to the listener
Definition: MacDrawParser.cxx:1219
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
@ Group
Definition: MacDrawParser.cxx:61
MWAWFont m_font
the font ( for a text box)
Definition: MacDrawParser.cxx:101
bool getPattern(int id, MWAWGraphicStyle::Pattern &pat)
returns a pattern if posible
Definition: MacDrawParser.cxx:131
static MWAWGraphicShape arc(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a arc
Definition: MWAWGraphicShape.hxx:137
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:361
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
bool send(MacDrawParserInternal::Shape const &shape)
try to send a shape
Definition: MacDrawParser.cxx:1100
static ReadResult check(MWAWInputStreamPtr const &input, int size, MWAWBox2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:100
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacDrawParser.cxx:326
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
Type
the different shape
Definition: MacDrawParser.cxx:61
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
@ Line
Definition: MWAWGraphicShape.hxx:49
std::vector< MWAWGraphicStyle::Pattern > m_patternList
the patterns list
Definition: MacDrawParser.cxx:146
@ italicBit
Definition: MWAWFont.hxx:190
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
@ Unknown
Definition: MacDrawParser.cxx:61
@ Page
Definition: MWAWPosition.hxx:51
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
@ JustificationRight
Definition: MWAWParagraph.hxx:91
Internal: the state of a MacDrawParser.
Definition: MacDrawParser.cxx:122
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
SubDocument(SubDocument const &orig)=delete
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
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
@ Arc
Definition: MWAWGraphicShape.hxx:49
@ Circle
Definition: MWAWGraphicShape.hxx:49
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 setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
int readObject()
try to read an object.
Definition: MacDrawParser.cxx:370
bool readPrintInfo()
try to read the print info zone
Definition: MacDrawParser.cxx:1038
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:469
Class to store font.
Definition: MWAWFont.hxx:44
static MWAWGraphicShape rectangle(MWAWBox2f const &box, MWAWVec2f const &corners=MWAWVec2f(0, 0))
static constructor to create a rectangle
Definition: MWAWGraphicShape.hxx:120
@ GroupEnd
Definition: MacDrawParser.cxx:61
@ Basic
Definition: MacDrawParser.cxx:61
MWAWBox2i m_bitmapFileDim
the bitmap dimension (in the file)
Definition: MacDrawParser.cxx:113
MWAWBox2i m_bitmapDim
the bitmap dimension (in page)
Definition: MacDrawParser.cxx:111
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
Internal: the subdocument of a MacDrawParser.
Definition: MacDrawParser.cxx:214
~SubDocument() final
destructor
Definition: MacDrawParser.cxx:223
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
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
MWAWBox2f getBdBox() const
return the shape bdbox
Definition: MacDrawParser.cxx:84
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacDrawParser.cxx:226
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20