the main class to read a MacWrite II and MacWrite Pro file More...
#include <MWProParser.hxx>
Public Member Functions | |
MWProParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header) | |
constructor More... | |
virtual | ~MWProParser () |
destructor More... | |
bool | checkHeader (MWAWHeader *header, bool strict=false) |
checks if the document header is correct (or not) More... | |
void | parse (WPXDocumentInterface *documentInterface) |
virtual function used to parse the input More... | |
![]() | |
virtual | ~MWAWParser () |
virtual destructor More... | |
int | version () const |
returns the works version More... | |
void | setVersion (int vers) |
sets the works version More... | |
Protected Member Functions | |
void | init () |
inits all internal variables More... | |
void | createDocument (WPXDocumentInterface *documentInterface) |
creates the listener which will be associated to the document More... | |
bool | createZones () |
finds the different objects zones More... | |
bool | getZoneData (WPXBinaryData &data, int blockId) |
retrieve the data which corresponds to a zone More... | |
bool | getFreeZoneList (int blockId, std::vector< int > &blockLists) |
return the chain list of block ( used to get free blocks) More... | |
bool | parseDataZone (int blockId, int type) |
parse a data zone More... | |
bool | parseTextZone (shared_ptr< MWProParserInternal::Zone > zone) |
parse a text zone More... | |
bool | readTextEntries (shared_ptr< MWProParserInternal::Zone > zone, std::vector< MWAWEntry > &res, int textLength) |
try to read the text block entries More... | |
bool | readTextIds (shared_ptr< MWProParserInternal::Zone > zone, std::vector< MWProParserInternal::TextZoneData > &res, int textLength, int type) |
try to read the text id entries More... | |
bool | readTextTokens (shared_ptr< MWProParserInternal::Zone > zone, std::vector< MWProParserInternal::Token > &res, int textLength) |
try to read the text token entries More... | |
std::vector< int > const & | getBlocksCalledByToken () const |
return the list of blockid called by token. More... | |
float | pageHeight () const |
returns the page height, ie. paper size less margin (in inches) More... | |
int | numColumns () const |
returns the document number of columns ( filed in MWII) More... | |
void | newPage (int number, bool softBreak=false) |
adds a new page More... | |
bool | sendTextZone (int blockId, bool mainZone=false) |
send a text box More... | |
int | findNumHardBreaks (int blockId) |
compute the number of hard page break More... | |
bool | sendPictureZone (int blockId, MWAWPosition const &pictPos, WPXPropertyList extras=WPXPropertyList()) |
try to send a picture More... | |
bool | sendTextBoxZone (int blockId, MWAWPosition const &pos, WPXPropertyList extras=WPXPropertyList()) |
send a textbox zone More... | |
bool | sendEmptyFrameZone (MWAWPosition const &pos, WPXPropertyList extras) |
try to send an empty zone (can exist in MWPro1.5) More... | |
bool | readPrintInfo () |
read the print info zone More... | |
bool | readDocHeader () |
try to read the doc header zone More... | |
bool | sendPicture (shared_ptr< MWProParserInternal::Zone > zone, MWAWPosition pictPos, WPXPropertyList const &extras) |
try to send a picture More... | |
bool | sendText (shared_ptr< MWProParserInternal::TextZone > zone, bool mainZone=false) |
try to send a text More... | |
int | findNumHardBreaks (shared_ptr< MWProParserInternal::TextZone > zone) |
compute the number of hard page break More... | |
void | checkUnparsed () |
a debug function which can be used to save the unparsed block More... | |
![]() | |
MWAWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header) | |
constructor (protected) More... | |
MWAWParser (MWAWParserStatePtr state) | |
constructor using a state More... | |
MWAWParserStatePtr | getParserState () |
returns the parser state More... | |
MWAWHeader * | getHeader () |
returns the header More... | |
MWAWInputStreamPtr & | getInput () |
returns the actual input More... | |
MWAWGraphicListenerPtr & | getGraphicListener () |
returns the graphic listener More... | |
MWAWContentListenerPtr & | getListener () |
returns the listener More... | |
MWAWPageSpan const & | getPageSpan () const |
returns the actual page dimension More... | |
MWAWPageSpan & | getPageSpan () |
returns the actual page dimension More... | |
double | getFormLength () const |
returns the form length More... | |
double | getFormWidth () const |
returns the form width More... | |
double | getPageLength () const |
returns the page length (form length without margin ) More... | |
double | getPageWidth () const |
returns the page width (form width without margin ) More... | |
MWAWRSRCParserPtr & | getRSRCParser () |
returns the rsrc parser More... | |
void | setListener (MWAWContentListenerPtr &listener) |
sets the listener More... | |
void | resetListener () |
resets the listener More... | |
MWAWFontConverterPtr & | getFontConverter () |
returns the font converter More... | |
void | setFontConverter (MWAWFontConverterPtr fontConverter) |
sets the font convertor More... | |
libmwaw::DebugFile & | ascii () |
a DebugFile used to write what we recognize when we parse the document More... | |
void | setAsciiName (char const *name) |
Debugging: change the default ascii file. More... | |
std::string const & | asciiName () const |
return the ascii file name More... | |
Protected Attributes | |
shared_ptr < MWProParserInternal::State > | m_state |
the state More... | |
shared_ptr< MWProStructures > | m_structures |
the structures parser More... | |
Friends | |
class | MWProStructures |
class | MWProStructuresListenerState |
class | MWProParserInternal::SubDocument |
the main class to read a MacWrite II and MacWrite Pro file
MWProParser::MWProParser | ( | MWAWInputStreamPtr | input, |
MWAWRSRCParserPtr | rsrcParser, | ||
MWAWHeader * | header | ||
) |
constructor
|
virtual |
destructor
|
virtual |
|
protected |
a debug function which can be used to save the unparsed block
Referenced by parse().
|
protected |
creates the listener which will be associated to the document
Referenced by parse().
|
protected |
finds the different objects zones
Referenced by parse().
|
protected |
compute the number of hard page break
Referenced by MWProStructures::createZonesV2().
|
protected |
compute the number of hard page break
|
protected |
return the list of blockid called by token.
A hack to help structures to retrieve the page attachment
Referenced by MWProStructures::buildPageStructures().
|
protected |
return the chain list of block ( used to get free blocks)
Referenced by parse().
|
protected |
retrieve the data which corresponds to a zone
Referenced by MWProStructures::createZones(), MWProStructures::createZonesV2(), and parseDataZone().
|
protected |
inits all internal variables
Referenced by MWProParser().
|
protected |
adds a new page
|
protected |
returns the document number of columns ( filed in MWII)
|
protected |
returns the page height, ie. paper size less margin (in inches)
|
virtual |
virtual function used to parse the input
Implements MWAWParser.
|
protected |
parse a data zone
Referenced by MWProStructures::createZonesV2(), MWProStructures::readBlocksList(), and readTextTokens().
|
protected |
parse a text zone
Referenced by parseDataZone().
|
protected |
try to read the doc header zone
then find 000000fd0000000000018200000100002f00 44[40|80] followed by something like a7c3ec07|a7c4c3c6 : 2 ptrs ? 6f6600000000000000080009000105050506010401
Referenced by createZones().
|
protected |
read the print info zone
Referenced by checkHeader(), and createZones().
|
protected |
try to read the text block entries
Referenced by parseTextZone().
|
protected |
try to read the text id entries
Referenced by parseTextZone().
|
protected |
try to read the text token entries
Referenced by parseTextZone().
|
protected |
try to send an empty zone (can exist in MWPro1.5)
Referenced by MWProStructures::send().
|
protected |
try to send a picture
Referenced by sendPictureZone().
|
protected |
try to send a picture
Referenced by MWProStructures::send(), and sendText().
|
protected |
try to send a text
Referenced by sendTextZone().
|
protected |
send a textbox zone
Referenced by MWProStructures::send().
|
protected |
send a text box
Referenced by MWProStructures::send().
|
friend |
|
friend |
Referenced by init().
|
friend |
|
protected |
the state
Referenced by checkHeader(), checkUnparsed(), createDocument(), findNumHardBreaks(), getBlocksCalledByToken(), getFreeZoneList(), getZoneData(), init(), newPage(), numColumns(), parse(), parseDataZone(), parseTextZone(), readDocHeader(), readTextEntries(), readTextTokens(), sendPictureZone(), and sendTextZone().
|
protected |
the structures parser
Referenced by createDocument(), createZones(), init(), parse(), MWProParserInternal::SubDocument::parse(), and sendText().