Go to the documentation of this file.
35 #ifndef MAC_WRT_PRO_PARSER
36 # define MAC_WRT_PRO_PARSER
112 std::vector<
MWAWEntry> &res,
int textLength);
116 int textLength,
int type);
132 void newPage(
int number,
bool softBreak=false);
171 bool sendText(std::shared_ptr<MacWrtProParserInternal::TextZone> zone,
bool mainZone =
false);
184 std::shared_ptr<MacWrtProParserInternal::State>
m_state;
MWAWInputStreamPtr m_input
the main input
Definition: MacWrtProParser.cxx:94
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:563
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
int m_blockId
the block id
Definition: MacWrtProParser.cxx:194
SubDocument(MacWrtProParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MacWrtProParser.cxx:264
@ Time
Definition: libmwaw_internal.hxx:401
TextZoneData()
Definition: MacWrtProParser.cxx:105
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:547
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:299
Internal: the state of a MacWrtProParser.
Definition: MacWrtProParser.cxx:230
Token()
Definition: MacWrtProParser.cxx:137
a note
Definition: libmwaw_internal.hxx:445
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:262
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:224
bool getFreeZoneList(int blockId, std::vector< int > &blockLists)
return the chain list of block ( used to get free blocks)
Definition: MacWrtProParser.cxx:511
bool parseTextZone(std::shared_ptr< MacWrtProParserInternal::Zone > zone)
parse a text zone
Definition: MacWrtProParser.cxx:1029
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:838
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
int m_length
the text length
Definition: MacWrtProParser.cxx:130
std::map< int, std::shared_ptr< Zone > > m_dataMap
the list of blockId->data zone
Definition: MacWrtProParser.cxx:247
float pageHeight() const
returns the page height, ie. paper size less margin (in inches)
bool readDocHeader()
try to read the doc header zone
Definition: MacWrtProParser.cxx:811
libmwaw::DebugFile m_asciiFile
the debug file
Definition: MacWrtProParser.cxx:97
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:234
long m_pos
the position
Definition: MacWrtProParser.cxx:1438
Zone()
Definition: MacWrtProParser.cxx:64
int m_blockId
the first block id
Definition: MacWrtProParser.cxx:88
int m_col
the number of columns in MWII
Definition: MacWrtProParser.cxx:255
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:65
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MacWrtProParser.cxx:677
std::vector< TextZoneData > m_ids[2]
two vector list of id ( charIds, paragraphIds)
Definition: MacWrtProParser.cxx:218
@ MWAW_T_MACWRITEPRO
MacWrite II/Pro.
Definition: MWAWDocument.hxx:135
friend std::ostream & operator<<(std::ostream &o, Token const &tkn)
operator<<
Definition: MacWrtProParser.cxx:146
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
void newPage(int number, bool softBreak=false)
adds a new page
Definition: MacWrtProParser.cxx:353
int numColumns() const
returns the document number of columns ( filed in MWII)
Definition: MacWrtProParser.cxx:344
int numSection() const
returns the actual section
Definition: MacWrtProStructures.hxx:96
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:202
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
std::shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:561
int version() const
returns the works version
Definition: MWAWParser.hxx:108
int m_length
the text length
Definition: MacWrtProParser.cxx:192
bool readTextEntries(std::shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MWAWEntry > &res, int textLength)
try to read the text block entries
Definition: MacWrtProParser.cxx:1079
void setUnit(librevenge::RVNGUnit newUnit)
sets the dimension unit
Definition: MWAWPosition.hxx:222
std::vector< Token > m_tokens
the tokens list
Definition: MacWrtProParser.cxx:221
std::string getFontDebugString(int fontId)
debug function which returns a string corresponding to a fontId
Definition: MacWrtProStructures.cxx:2884
void checkUnparsed()
a debug function which can be used to save the unparsed block
Definition: MacWrtProParser.cxx:1803
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:187
bool operator()(DataPosition const &p1, DataPosition const &p2) const
comparaison function
Definition: MacWrtProParser.cxx:1442
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
DataPosition(int type=-1, int id=-1, long pos=0)
constructor
Definition: MacWrtProParser.cxx:1427
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
std::vector< int > const & getBlocksCalledByToken() const
return the list of blockid called by token.
Definition: MacWrtProParser.cxx:372
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
int m_type
the type
Definition: MacWrtProParser.cxx:1434
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
bool sendText(std::shared_ptr< MacWrtProParserInternal::TextZone > zone, bool mainZone=false)
try to send a text
Definition: MacWrtProParser.cxx:1455
bool parseDataZone(int blockId, int type)
parse a data zone
Definition: MacWrtProParser.cxx:986
Internal: a struct used to store a zone.
Definition: MacWrtProParser.cxx:63
void setNaturalSize(MWAWVec2f const &naturalSz)
sets the natural size (if known)
Definition: MWAWPosition.hxx:217
friend class MacWrtProStructures
Definition: MacWrtProParser.hxx:69
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
std::map< int, long > m_blocksMap
the list of retrieved block : block -> new address
Definition: MacWrtProParser.cxx:244
bool sendEmptyFrameZone(MWAWPosition const &pos, MWAWGraphicStyle const &style)
try to send an empty zone (can exist in MacWrtPro1.5)
Definition: MacWrtProParser.cxx:1356
friend std::ostream & operator<<(std::ostream &o, TextZoneData const &tData)
Definition: MacWrtProParser.cxx:111
int m_textLength
the text length
Definition: MacWrtProParser.cxx:212
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:104
@ Date
Definition: libmwaw_internal.hxx:401
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
@ SoftPageBreak
Definition: MWAWListener.hxx:58
MWAWVec2f const & size() const
returns the frame size
Definition: MWAWPosition.hxx:132
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:172
SubDocumentType
Definition: libmwaw_internal.hxx:188
bool resendAll()
force resent data : font + paragraph
Definition: MacWrtProStructures.cxx:2852
bool readTextIds(std::shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MacWrtProParserInternal::TextZoneData > &res, int textLength, int type)
try to read the text id entries
Definition: MacWrtProParser.cxx:1154
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
bool readTextTokens(std::shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MacWrtProParserInternal::Token > &res, int textLength)
try to read the text token entries
Definition: MacWrtProParser.cxx:1218
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:304
~SubDocument() final
destructor
Definition: MacWrtProParser.cxx:271
void setTextListener(MWAWTextListenerPtr &listener)
sets the text listener
Definition: MWAWParser.cxx:158
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
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MacWrtProParser.cxx:284
int findNumHardBreaks(int blockId)
compute the number of hard page break
Definition: MacWrtProParser.cxx:1368
T y() const
second element
Definition: libmwaw_internal.hxx:669
bool sendTextBoxZone(int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
send a textbox zone
Definition: MacWrtProParser.cxx:1413
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 readPrintInfo()
read the print info zone
Definition: MacWrtProParser.cxx:758
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:177
void setSize(MWAWVec2f const &sz)
sets the frame size
Definition: MWAWPosition.hxx:212
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacWrtProParser.cxx:576
T x() const
first element
Definition: libmwaw_internal.hxx:664
~Zone()
Definition: MacWrtProParser.cxx:73
void init()
inits all internal variables
Definition: MacWrtProParser.cxx:329
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:65
MacWrtProParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacWrtProParser.cxx:317
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:557
MWAWBox2f m_box
the bdbox ( filled in MWII for figure)
Definition: MacWrtProParser.cxx:196
std::vector< int > m_blocksCallByTokens
the list of blockId called by tokens
Definition: MacWrtProParser.cxx:253
@ PageBreak
Definition: MWAWListener.hxx:58
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacWrtProParser.cxx:303
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
bool getZoneData(librevenge::RVNGBinaryData &data, int blockId)
retrieve the data which corresponds to a zone
Definition: MacWrtProParser.cxx:431
Definition: libmwaw_internal.hxx:144
void setOrigin(MWAWVec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:207
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:70
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1189
bool sendPictureZone(int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1646
bool createZones()
finds the different objects zones
Definition: MacWrtProParser.cxx:646
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition: MacWrtProParser.cxx:381
int m_numPages
the number of page of the final document
Definition: MacWrtProParser.cxx:256
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:167
the comparison structure
Definition: MacWrtProParser.cxx:1440
a field
Definition: libmwaw_internal.hxx:399
@ PageNumber
Definition: libmwaw_internal.hxx:401
~MacWrtProParser() final
destructor
Definition: MacWrtProParser.cxx:325
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:235
@ Char
Definition: MWAWPosition.hxx:51
std::vector< int > getPageBreaksPos() const
return a list of page break position ( as some page break are soft )
Definition: MacWrtProStructures.cxx:2765
int m_type
the type : 0(text), 1(graphic)
Definition: MacWrtProParser.cxx:85
bool sendTextZone(int blockId, bool mainZone=false)
send a text box
Definition: MacWrtProParser.cxx:1402
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
std::shared_ptr< MacWrtProStructures > m_structures
the structures parser
Definition: MacWrtProParser.hxx:187
Internal: the subdocument of a MacWrtProParser.
Definition: MacWrtProParser.cxx:262
int m_type
the type
Definition: MacWrtProParser.cxx:128
void sendChar(char c)
send a character
Definition: MacWrtProStructures.cxx:2777
State()
constructor
Definition: MacWrtProParser.cxx:232
bool sendParagraph(int id)
try to send a paragraph
Definition: MacWrtProStructures.cxx:2907
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
std::string getParagraphDebugString(int paraId)
debug function which returns a string corresponding to a paragrapId
Definition: MacWrtProStructures.cxx:2930
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:100
Defines MWAWTextListener: the libmwaw word processor listener.
bool sendPicture(std::shared_ptr< MacWrtProParserInternal::Zone > zone, MWAWPosition pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1658
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:202
the main class to read the structures part of MacWrite Pro file
Definition: MacWrtProStructures.hxx:153
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
librevenge::RVNGBinaryData m_data
the storage
Definition: MacWrtProParser.cxx:91
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:192
bool isSent(int blockId)
returns true if the block is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2723
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:227
an interface to transmit the info of MacWrtProStructures to a listener
Definition: MacWrtProStructures.hxx:71
std::vector< MWAWEntry > m_entries
the list of entries
Definition: MacWrtProParser.cxx:215
std::map< int, std::shared_ptr< TextZone > > m_textMap
the list of blockId->text zone
Definition: MacWrtProParser.cxx:250
int m_flags[4]
some flags
Definition: MacWrtProParser.cxx:198
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:136
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
@ FootNote
Definition: libmwaw_internal.hxx:447
TextZone()
Definition: MacWrtProParser.cxx:203
@ XLeft
Definition: MWAWPosition.hxx:55
@ YBottom
Definition: MWAWPosition.hxx:57
int m_actPage
the actual page
Definition: MacWrtProParser.cxx:256
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:549
Definition: MWAWDocument.hxx:57
int m_id
an id
Definition: MacWrtProParser.cxx:132
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:207
bool sendFont(int id)
try to send a character style
Definition: MacWrtProStructures.cxx:2861
int m_type
the type
Definition: MacWrtProParser.cxx:190
Internal: the structures of a MacWrtProParser.
Definition: MacWrtProParser.cxx:60
@ Title
Definition: libmwaw_internal.hxx:401
libmwaw::DebugFile & ascii()
returns the debug file
Definition: MacWrtProParser.cxx:79
int m_id
an id
Definition: MacWrtProParser.cxx:1436
bool send(int blockId)
try to send a block which corresponds to blockid
Definition: MacWrtProStructures.cxx:2729
void insertSoftPageBreak()
insert a page break ( if we are not on a new page )
Definition: MacWrtProStructures.cxx:2736
Internal and low level: structure used to sort the position of data.
Definition: MacWrtProParser.cxx:1425
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:834
the main class to read a MacWrite II and MacWrite Pro file
Definition: MacWrtProParser.hxx:68
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:96
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:163
std::shared_ptr< MacWrtProParserInternal::State > m_state
the state
Definition: MacWrtProParser.hxx:184
int m_id
the subdocument id
Definition: MacWrtProParser.cxx:281
Generated on Tue Apr 24 2018 22:55:11 for libmwaw by
doxygen 1.8.20