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);
175 bool sendText(std::shared_ptr<MacWrtProParserInternal::TextZone> zone,
bool mainZone =
false);
188 std::shared_ptr<MacWrtProParserInternal::State>
m_state;
MWAWInputStreamPtr m_input
the main input
Definition: MacWrtProParser.cxx:96
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:565
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
int m_blockId
the block id
Definition: MacWrtProParser.cxx:196
SubDocument(MacWrtProParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MacWrtProParser.cxx:270
Definition: libmwaw_internal.hxx:401
TextZoneData()
Definition: MacWrtProParser.cxx:107
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:549
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:298
Internal: the state of a MacWrtProParser.
Definition: MacWrtProParser.cxx:232
Token()
Definition: MacWrtProParser.cxx:139
a note
Definition: libmwaw_internal.hxx:445
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:226
bool parseTextZone(std::shared_ptr< MacWrtProParserInternal::Zone > zone)
parse a text zone
Definition: MacWrtProParser.cxx:996
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:840
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:132
std::map< int, std::shared_ptr< Zone > > m_dataMap
the list of blockId->data zone
Definition: MacWrtProParser.cxx:251
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:768
libmwaw::DebugFile m_asciiFile
the debug file
Definition: MacWrtProParser.cxx:99
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:236
long m_pos
the position
Definition: MacWrtProParser.cxx:1407
Zone()
Definition: MacWrtProParser.cxx:66
int m_blockId
the first block id
Definition: MacWrtProParser.cxx:90
int m_col
the number of columns in MWII
Definition: MacWrtProParser.cxx:259
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MacWrtProParser.cxx:634
std::vector< TextZoneData > m_ids[2]
two vector list of id ( charIds, paragraphIds)
Definition: MacWrtProParser.cxx:220
MacWrite II/Pro.
Definition: MWAWDocument.hxx:135
friend std::ostream & operator<<(std::ostream &o, Token const &tkn)
operator<<
Definition: MacWrtProParser.cxx:148
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:360
int numSection() const
returns the actual section
Definition: MacWrtProStructures.hxx:96
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:206
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:563
int version() const
returns the works version
Definition: MWAWParser.hxx:108
int m_length
the text length
Definition: MacWrtProParser.cxx:194
bool readTextEntries(std::shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MWAWEntry > &res, int textLength)
try to read the text block entries
Definition: MacWrtProParser.cxx:1046
void setUnit(librevenge::RVNGUnit newUnit)
sets the dimension unit
Definition: MWAWPosition.hxx:224
std::vector< Token > m_tokens
the tokens list
Definition: MacWrtProParser.cxx:223
std::string getFontDebugString(int fontId)
debug function which returns a string corresponding to a fontId
Definition: MacWrtProStructures.cxx:2977
void checkUnparsed()
a debug function which can be used to save the unparsed block
Definition: MacWrtProParser.cxx:1770
int numColumns(double &sep) const
returns the document number of columns and the column separator width in inch( filed in MWII)
Definition: MacWrtProParser.cxx:350
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:191
bool operator()(DataPosition const &p1, DataPosition const &p2) const
comparaison function
Definition: MacWrtProParser.cxx:1411
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:1396
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
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:1403
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
bool sendText(std::shared_ptr< MacWrtProParserInternal::TextZone > zone, bool mainZone=false)
try to send a text
Definition: MacWrtProParser.cxx:1424
const MWAWVec2f & size() const
returns the frame size
Definition: MWAWPosition.hxx:134
bool parseDataZone(int blockId, int type)
parse a data zone
Definition: MacWrtProParser.cxx:953
Internal: a struct used to store a zone.
Definition: MacWrtProParser.cxx:65
void setNaturalSize(MWAWVec2f const &naturalSz)
sets the natural size (if known)
Definition: MWAWPosition.hxx:219
std::shared_ptr< MWAWSubDocument > getSubDocument(int blockId)
returns a subdocument corresponding to a blockid
Definition: MacWrtProParser.cxx:389
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:248
bool sendEmptyFrameZone(MWAWPosition const &pos, MWAWGraphicStyle const &style)
try to send an empty zone (can exist in MacWrtPro1.5)
Definition: MacWrtProParser.cxx:1325
friend std::ostream & operator<<(std::ostream &o, TextZoneData const &tData)
Definition: MacWrtProParser.cxx:113
int m_textLength
the text length
Definition: MacWrtProParser.cxx:214
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:106
Definition: libmwaw_internal.hxx:401
Definition: MWAWListener.hxx:58
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:176
int getPageSpan() const
Definition: MWAWPageSpan.hxx:168
SubDocumentType
Definition: libmwaw_internal.hxx:188
bool resendAll()
force resent data : font + paragraph
Definition: MacWrtProStructures.cxx:2945
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:1121
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:1185
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:308
~SubDocument() final
destructor
Definition: MacWrtProParser.cxx:277
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:290
int findNumHardBreaks(int blockId)
compute the number of hard page break
Definition: MacWrtProParser.cxx:1337
T y() const
second element
Definition: libmwaw_internal.hxx:671
bool sendTextBoxZone(int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
send a textbox zone
Definition: MacWrtProParser.cxx:1382
const MWAWPageSpan & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
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:715
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:181
void setSize(MWAWVec2f const &sz)
sets the frame size
Definition: MWAWPosition.hxx:214
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacWrtProParser.cxx:568
T x() const
first element
Definition: libmwaw_internal.hxx:666
~Zone()
Definition: MacWrtProParser.cxx:75
void init()
inits all internal variables
Definition: MacWrtProParser.cxx:335
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:47
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:66
MacWrtProParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacWrtProParser.cxx:323
const std::string & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
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:559
MWAWBox2f m_box
the bdbox ( filled in MWII for figure)
Definition: MacWrtProParser.cxx:198
bool getFreeZoneList(std::vector< int > &blockLists)
return the chain list of block ( used to get free blocks): MWPro only
Definition: MacWrtProParser.cxx:528
std::vector< int > m_blocksCallByTokens
the list of blockId called by tokens
Definition: MacWrtProParser.cxx:257
Definition: MWAWListener.hxx:58
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacWrtProParser.cxx:309
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:448
Definition: libmwaw_internal.hxx:143
void setOrigin(MWAWVec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:209
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:71
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1191
bool sendPictureZone(int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1613
double m_colSeparator
the columns separator in inch MWII
Definition: MacWrtProParser.cxx:260
bool createZones()
finds the different objects zones
Definition: MacWrtProParser.cxx:603
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition: MacWrtProParser.cxx:397
int m_numPages
the number of page of the final document
Definition: MacWrtProParser.cxx:261
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:168
the comparison structure
Definition: MacWrtProParser.cxx:1409
a field
Definition: libmwaw_internal.hxx:399
Definition: libmwaw_internal.hxx:401
~MacWrtProParser() final
destructor
Definition: MacWrtProParser.cxx:331
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:201
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:235
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:2858
int m_type
the type : 0(text), 1(graphic)
Definition: MacWrtProParser.cxx:87
bool sendTextZone(int blockId, bool mainZone=false)
send a text box
Definition: MacWrtProParser.cxx:1371
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
std::shared_ptr< MacWrtProStructures > m_structures
the structures parser
Definition: MacWrtProParser.hxx:191
Internal: the subdocument of a MacWrtProParser.
Definition: MacWrtProParser.cxx:267
int m_type
the type
Definition: MacWrtProParser.cxx:130
void sendChar(char c)
send a character
Definition: MacWrtProStructures.cxx:2870
State()
constructor
Definition: MacWrtProParser.cxx:234
bool sendParagraph(int id)
try to send a paragraph
Definition: MacWrtProStructures.cxx:3000
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:3023
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:102
bool sendPicture(std::shared_ptr< MacWrtProParserInternal::Zone > zone, MWAWPosition pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1625
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:204
the main class to read the structures part of MacWrite Pro file
Definition: MacWrtProStructures.hxx:154
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
librevenge::RVNGBinaryData m_data
the storage
Definition: MacWrtProParser.cxx:93
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:196
bool isSent(int blockId)
returns true if the block is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2808
an interface to transmit the info of MacWrtProStructures to a listener
Definition: MacWrtProStructures.hxx:70
std::vector< MWAWEntry > m_entries
the list of entries
Definition: MacWrtProParser.cxx:217
std::map< int, std::shared_ptr< TextZone > > m_textMap
the list of blockId->text zone
Definition: MacWrtProParser.cxx:254
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:138
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:65
Definition: libmwaw_internal.hxx:447
bool hasTitlePage() const
returns true if the document has a title page
Definition: MacWrtProParser.cxx:379
TextZone()
Definition: MacWrtProParser.cxx:205
Definition: MWAWPosition.hxx:55
Definition: MWAWPosition.hxx:57
int m_actPage
the actual page
Definition: MacWrtProParser.cxx:261
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:551
bool m_hasTitlePage
flag to know if we have a title page
Definition: MacWrtProParser.cxx:262
Definition: MWAWDocument.hxx:56
const std::vector< int > & getBlocksCalledByToken() const
return the list of blockid called by token.
Definition: MacWrtProParser.cxx:384
int m_id
an id
Definition: MacWrtProParser.cxx:134
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:211
bool sendFont(int id)
try to send a character style
Definition: MacWrtProStructures.cxx:2954
int m_type
the type
Definition: MacWrtProParser.cxx:192
Internal: the structures of a MacWrtProParser.
Definition: MacWrtProParser.cxx:61
Definition: libmwaw_internal.hxx:401
libmwaw::DebugFile & ascii()
returns the debug file
Definition: MacWrtProParser.cxx:81
int m_id
an id
Definition: MacWrtProParser.cxx:1405
unsigned int m_flags[4]
some flags
Definition: MacWrtProParser.cxx:200
bool send(int blockId)
try to send a block which corresponds to blockid
Definition: MacWrtProStructures.cxx:2814
void insertSoftPageBreak()
insert a page break ( if we are not on a new page )
Definition: MacWrtProStructures.cxx:2821
Internal and low level: structure used to sort the position of data.
Definition: MacWrtProParser.cxx:1394
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:836
the main class to read a MacWrite II and MacWrite Pro file
Definition: MacWrtProParser.hxx:67
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:97
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:163
std::shared_ptr< MacWrtProParserInternal::State > m_state
the state
Definition: MacWrtProParser.hxx:188
int m_id
the subdocument id
Definition: MacWrtProParser.cxx:287
Generated on Wed Jul 24 2024 03:55:49 for libmwaw by
doxygen 1.8.16