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);
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:567
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
int m_blockId
the block id
Definition: MacWrtProParser.cxx:181
SubDocument(MacWrtProParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MacWrtProParser.cxx:257
@ Time
Definition: libmwaw_internal.hxx:401
TextZoneData()
Definition: MacWrtProParser.cxx:92
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:299
Internal: the state of a MacWrtProParser.
Definition: MacWrtProParser.cxx:217
Token()
Definition: MacWrtProParser.cxx:124
a note
Definition: libmwaw_internal.hxx:445
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:211
bool parseTextZone(std::shared_ptr< MacWrtProParserInternal::Zone > zone)
parse a text zone
Definition: MacWrtProParser.cxx:991
#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
int m_length
the text length
Definition: MacWrtProParser.cxx:117
std::map< int, std::shared_ptr< Zone > > m_dataMap
the list of blockId->data zone
Definition: MacWrtProParser.cxx:237
std::vector< int > const & getGraphicIdCalledByToken() const
return the list of graphicid called by token.
Definition: MacWrtProParser.cxx:371
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:752
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:237
long m_pos
the position
Definition: MacWrtProParser.cxx:1401
Zone()
Definition: MacWrtProParser.cxx:66
int m_blockId
the first block id
Definition: MacWrtProParser.cxx:81
int m_col
the number of columns in MWII
Definition: MacWrtProParser.cxx:246
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:619
std::vector< TextZoneData > m_ids[2]
two vector list of id ( charIds, paragraphIds)
Definition: MacWrtProParser.cxx:205
@ MWAW_T_MACWRITEPRO
MacWrite II/Pro.
Definition: MWAWDocument.hxx:135
friend std::ostream & operator<<(std::ostream &o, Token const &tkn)
operator<<
Definition: MacWrtProParser.cxx:133
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:347
int numSection() const
returns the actual section
Definition: MacWrtProStructures.hxx:92
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
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:565
int version() const
returns the works version
Definition: MWAWParser.hxx:108
int m_length
the text length
Definition: MacWrtProParser.cxx:179
bool readTextEntries(std::shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MWAWEntry > &res, int textLength)
try to read the text block entries
Definition: MacWrtProParser.cxx:1041
void setUnit(librevenge::RVNGUnit newUnit)
sets the dimension unit
Definition: MWAWPosition.hxx:225
std::vector< Token > m_tokens
the tokens list
Definition: MacWrtProParser.cxx:208
void checkUnparsed()
a debug function which can be used to save the unparsed block
Definition: MacWrtProParser.cxx:1716
int numColumns(double &sep) const
returns the document number of columns and the column separator width in inch( filed in MWII)
Definition: MacWrtProParser.cxx:337
static bool double2Time(double val, int &H, int &M, int &S)
conversion beetween double: second since 0:00 and time
Definition: MWAWCell.cxx:590
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
bool operator()(DataPosition const &p1, DataPosition const &p2) const
comparaison function
Definition: MacWrtProParser.cxx:1405
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:1390
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
std::shared_ptr< MWAWStream > getStreamForBlock(int bId)
returns a stream corresponding to a block
Definition: MacWrtProParser.cxx:432
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:1397
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
static std::string convertDateToDebugString(unsigned date)
convert a date in a string (for debugging)
Definition: MacWrtProParser.cxx:1765
bool sendText(std::shared_ptr< MacWrtProParserInternal::TextZone > zone, bool mainZone=false)
try to send a text
Definition: MacWrtProParser.cxx:1418
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:220
std::shared_ptr< MWAWSubDocument > getSubDocument(int blockId)
returns a subdocument corresponding to a blockid
Definition: MacWrtProParser.cxx:376
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
bool send(int graphicId)
try to send a graphic which corresponds to graphicid
Definition: MacWrtProStructures.cxx:2869
bool sendEmptyFrameZone(MWAWPosition const &pos, MWAWGraphicStyle const &style)
try to send an empty zone (can exist in MacWrtPro1.5)
Definition: MacWrtProParser.cxx:1319
friend std::ostream & operator<<(std::ostream &o, TextZoneData const &tData)
Definition: MacWrtProParser.cxx:98
static bool double2Date(double val, int &Y, int &M, int &D)
conversion beetween double days since 1900 and a date, ie val=0 corresponds to 1/1/1900,...
Definition: MWAWCell.cxx:510
Defines MWAWCell (cell content and format)
int m_textLength
the text length
Definition: MacWrtProParser.cxx:199
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:91
@ 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:135
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
int getPageSpan() const
Definition: MWAWPageSpan.hxx:170
SubDocumentType
Definition: libmwaw_internal.hxx:188
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:1115
std::shared_ptr< MWAWStream > m_stream
the storage
Definition: MacWrtProParser.cxx:84
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:1180
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
~SubDocument() final
destructor
Definition: MacWrtProParser.cxx:264
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:277
int findNumHardBreaks(int blockId)
compute the number of hard page break
Definition: MacWrtProParser.cxx:1331
T y() const
second element
Definition: libmwaw_internal.hxx:673
bool sendTextBoxZone(int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
send a textbox zone
Definition: MacWrtProParser.cxx:1376
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:699
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
void setSize(MWAWVec2f const &sz)
sets the frame size
Definition: MWAWPosition.hxx:215
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacWrtProParser.cxx:550
T x() const
first element
Definition: libmwaw_internal.hxx:668
~Zone()
Definition: MacWrtProParser.cxx:73
void init()
inits all internal variables
Definition: MacWrtProParser.cxx:322
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:67
MacWrtProParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MacWrtProParser.cxx:310
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:561
MWAWBox2f m_box
the bdbox ( filled in MWII for figure)
Definition: MacWrtProParser.cxx:183
bool getFreeZoneList(std::vector< int > &blockLists)
return the chain list of block ( used to get free blocks): MWPro only
Definition: MacWrtProParser.cxx:510
@ PageBreak
Definition: MWAWListener.hxx:58
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MacWrtProParser.cxx:296
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
Definition: libmwaw_internal.hxx:144
void setOrigin(MWAWVec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:210
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
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
bool sendPictureZone(int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1601
double m_colSeparator
the columns separator in inch MWII
Definition: MacWrtProParser.cxx:247
bool createZones()
finds the different objects zones
Definition: MacWrtProParser.cxx:585
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition: MacWrtProParser.cxx:384
bool isSent(int graphicId)
returns true if the graphic is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2863
int m_numPages
the number of page of the final document
Definition: MacWrtProParser.cxx:248
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:169
the comparison structure
Definition: MacWrtProParser.cxx:1403
a field
Definition: libmwaw_internal.hxx:399
@ PageNumber
Definition: libmwaw_internal.hxx:401
~MacWrtProParser() final
destructor
Definition: MacWrtProParser.cxx:318
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
small structure use to store a stream and it debug file
Definition: MWAWStream.hxx:41
@ 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:2916
int m_type
the type : 0(text), 1(graphic)
Definition: MacWrtProParser.cxx:78
bool sendTextZone(int blockId, bool mainZone=false)
send a text box
Definition: MacWrtProParser.cxx:1365
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
std::shared_ptr< MacWrtProStructures > m_structures
the structures parser
Definition: MacWrtProParser.hxx:188
Internal: the subdocument of a MacWrtProParser.
Definition: MacWrtProParser.cxx:255
int m_type
the type
Definition: MacWrtProParser.cxx:115
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
void sendChar(char c)
send a character
Definition: MacWrtProStructures.cxx:2939
State()
constructor
Definition: MacWrtProParser.cxx:219
int m_fileNumPages
the number of page in MWII
Definition: MacWrtProParser.cxx:245
bool sendParagraph(int id)
try to send a paragraph
Definition: MacWrtProStructures.cxx:3028
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
bool m_parsed
true if the zone is sended
Definition: MacWrtProParser.cxx:87
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:1613
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:189
the main class to read the structures part of MacWrite Pro file
Definition: MacWrtProStructures.hxx:136
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:198
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:202
std::map< int, std::shared_ptr< TextZone > > m_textMap
the list of blockId->text zone
Definition: MacWrtProParser.cxx:240
Internal: a struct used to store a text zone.
Definition: MacWrtProParser.cxx:123
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
bool hasTitlePage() const
returns true if the document has a title page
Definition: MacWrtProParser.cxx:366
TextZone()
Definition: MacWrtProParser.cxx:190
@ XLeft
Definition: MWAWPosition.hxx:55
@ YBottom
Definition: MWAWPosition.hxx:57
int m_actPage
the actual page
Definition: MacWrtProParser.cxx:248
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
std::set< int > m_parsedBlocks
the list of retrieved block : block
Definition: MacWrtProParser.cxx:234
bool m_hasTitlePage
flag to know if we have a title page
Definition: MacWrtProParser.cxx:249
Definition: MWAWDocument.hxx:57
int m_id
an id
Definition: MacWrtProParser.cxx:119
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
bool sendFont(int id)
try to send a character style
Definition: MacWrtProStructures.cxx:3014
int m_type
the type
Definition: MacWrtProParser.cxx:177
Internal: the structures of a MacWrtProParser.
Definition: MacWrtProParser.cxx:62
@ Title
Definition: libmwaw_internal.hxx:401
int m_id
an id
Definition: MacWrtProParser.cxx:1399
unsigned int m_flags[4]
some flags
Definition: MacWrtProParser.cxx:185
void insertSoftPageBreak()
insert a page break ( if we are not on a new page )
Definition: MacWrtProStructures.cxx:2879
Internal and low level: structure used to sort the position of data.
Definition: MacWrtProParser.cxx:1388
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
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:99
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:163
std::shared_ptr< MacWrtProParserInternal::State > m_state
the state
Definition: MacWrtProParser.hxx:185
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: MWAWStringStream.hxx:37
int m_id
the subdocument id
Definition: MacWrtProParser.cxx:274
std::vector< int > m_graphicIdsCallByTokens
the list of graphicId called by tokens
Definition: MacWrtProParser.cxx:243
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20