the main class to read a MacWrite II and MacWrite Pro file More...
#include <MacWrtProParser.hxx>
Public Member Functions | |
| MacWrtProParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header) | |
| constructor | |
| virtual | ~MacWrtProParser () |
| destructor | |
| bool | checkHeader (MWAWHeader *header, bool strict=false) |
| checks if the document header is correct (or not) | |
| void | parse (librevenge::RVNGTextInterface *documentInterface) |
| virtual function used to parse the input | |
Protected Member Functions | |
| void | init () |
| inits all internal variables | |
| void | createDocument (librevenge::RVNGTextInterface *documentInterface) |
| creates the listener which will be associated to the document | |
| bool | createZones () |
| finds the different objects zones | |
| bool | getZoneData (librevenge::RVNGBinaryData &data, int blockId) |
| retrieve the data which corresponds to a zone | |
| bool | getFreeZoneList (int blockId, std::vector< int > &blockLists) |
| return the chain list of block ( used to get free blocks) | |
| bool | parseDataZone (int blockId, int type) |
| parse a data zone | |
| bool | parseTextZone (shared_ptr< MacWrtProParserInternal::Zone > zone) |
| parse a text zone | |
| bool | readTextEntries (shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MWAWEntry > &res, int textLength) |
| try to read the text block entries | |
| bool | readTextIds (shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MacWrtProParserInternal::TextZoneData > &res, int textLength, int type) |
| try to read the text id entries | |
| bool | readTextTokens (shared_ptr< MacWrtProParserInternal::Zone > zone, std::vector< MacWrtProParserInternal::Token > &res, int textLength) |
| try to read the text token entries | |
| std::vector< int > const & | getBlocksCalledByToken () const |
| return the list of blockid called by token. | |
| float | pageHeight () const |
| returns the page height, ie. paper size less margin (in inches) | |
| int | numColumns () const |
| returns the document number of columns ( filed in MWII) | |
| void | newPage (int number, bool softBreak=false) |
| adds a new page | |
| bool | sendTextZone (int blockId, bool mainZone=false) |
| send a text box | |
| int | findNumHardBreaks (int blockId) |
| compute the number of hard page break | |
| bool | sendPictureZone (int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) |
| try to send a picture | |
| bool | sendTextBoxZone (int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) |
| send a textbox zone | |
| bool | sendEmptyFrameZone (MWAWPosition const &pos, MWAWGraphicStyle const &style) |
| try to send an empty zone (can exist in MacWrtPro1.5) | |
| bool | readPrintInfo () |
| read the print info zone | |
| bool | readDocHeader () |
| try to read the doc header zone | |
| bool | sendPicture (shared_ptr< MacWrtProParserInternal::Zone > zone, MWAWPosition pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle()) |
| try to send a picture | |
| bool | sendText (shared_ptr< MacWrtProParserInternal::TextZone > zone, bool mainZone=false) |
| try to send a text | |
| int | findNumHardBreaks (shared_ptr< MacWrtProParserInternal::TextZone > zone) |
| compute the number of hard page break | |
| void | checkUnparsed () |
| a debug function which can be used to save the unparsed block | |
Protected Attributes | |
| shared_ptr < MacWrtProParserInternal::State > | m_state |
| the state | |
| shared_ptr< MacWrtProStructures > | m_structures |
| the structures parser | |
Friends | |
| class | MacWrtProStructures |
| class | MacWrtProStructuresListenerState |
| class | MacWrtProParserInternal::SubDocument |
the main class to read a MacWrite II and MacWrite Pro file
| MacWrtProParser::MacWrtProParser | ( | MWAWInputStreamPtr | input, |
| MWAWRSRCParserPtr | rsrcParser, | ||
| MWAWHeader * | header | ||
| ) |
constructor
| MacWrtProParser::~MacWrtProParser | ( | ) | [virtual] |
destructor
| bool MacWrtProParser::checkHeader | ( | MWAWHeader * | header, |
| bool | strict = false |
||
| ) | [virtual] |
| void MacWrtProParser::checkUnparsed | ( | ) | [protected] |
a debug function which can be used to save the unparsed block
Referenced by parse().
| void MacWrtProParser::createDocument | ( | librevenge::RVNGTextInterface * | documentInterface | ) | [protected] |
creates the listener which will be associated to the document
Referenced by parse().
| bool MacWrtProParser::createZones | ( | ) | [protected] |
finds the different objects zones
Referenced by parse().
| int MacWrtProParser::findNumHardBreaks | ( | int | blockId | ) | [protected] |
compute the number of hard page break
Referenced by MacWrtProStructures::createZonesV2().
| int MacWrtProParser::findNumHardBreaks | ( | shared_ptr< MacWrtProParserInternal::TextZone > | zone | ) | [protected] |
compute the number of hard page break
| std::vector< int > const & MacWrtProParser::getBlocksCalledByToken | ( | ) | const [protected] |
return the list of blockid called by token.
A hack to help structures to retrieve the page attachment
Referenced by MacWrtProStructures::buildPageStructures().
| bool MacWrtProParser::getFreeZoneList | ( | int | blockId, |
| std::vector< int > & | blockLists | ||
| ) | [protected] |
return the chain list of block ( used to get free blocks)
Referenced by parse().
| bool MacWrtProParser::getZoneData | ( | librevenge::RVNGBinaryData & | data, |
| int | blockId | ||
| ) | [protected] |
retrieve the data which corresponds to a zone
Referenced by MacWrtProStructures::createZones(), MacWrtProStructures::createZonesV2(), and parseDataZone().
| void MacWrtProParser::init | ( | ) | [protected] |
inits all internal variables
Referenced by MacWrtProParser().
| void MacWrtProParser::newPage | ( | int | number, |
| bool | softBreak = false |
||
| ) | [protected] |
adds a new page
| int MacWrtProParser::numColumns | ( | ) | const [protected] |
returns the document number of columns ( filed in MWII)
| float MacWrtProParser::pageHeight | ( | ) | const [protected] |
returns the page height, ie. paper size less margin (in inches)
| void MacWrtProParser::parse | ( | librevenge::RVNGTextInterface * | documentInterface | ) | [virtual] |
virtual function used to parse the input
Implements MWAWTextParser.
| bool MacWrtProParser::parseDataZone | ( | int | blockId, |
| int | type | ||
| ) | [protected] |
parse a data zone
Referenced by MacWrtProStructures::createZonesV2(), MacWrtProStructures::readBlocksList(), and readTextTokens().
| bool MacWrtProParser::parseTextZone | ( | shared_ptr< MacWrtProParserInternal::Zone > | zone | ) | [protected] |
parse a text zone
Referenced by parseDataZone().
| bool MacWrtProParser::readDocHeader | ( | ) | [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().
| bool MacWrtProParser::readPrintInfo | ( | ) | [protected] |
read the print info zone
Referenced by checkHeader(), and createZones().
| bool MacWrtProParser::readTextEntries | ( | shared_ptr< MacWrtProParserInternal::Zone > | zone, |
| std::vector< MWAWEntry > & | res, | ||
| int | textLength | ||
| ) | [protected] |
try to read the text block entries
Referenced by parseTextZone().
| bool MacWrtProParser::readTextIds | ( | shared_ptr< MacWrtProParserInternal::Zone > | zone, |
| std::vector< MacWrtProParserInternal::TextZoneData > & | res, | ||
| int | textLength, | ||
| int | type | ||
| ) | [protected] |
try to read the text id entries
Referenced by parseTextZone().
| bool MacWrtProParser::readTextTokens | ( | shared_ptr< MacWrtProParserInternal::Zone > | zone, |
| std::vector< MacWrtProParserInternal::Token > & | res, | ||
| int | textLength | ||
| ) | [protected] |
try to read the text token entries
Referenced by parseTextZone().
| bool MacWrtProParser::sendEmptyFrameZone | ( | MWAWPosition const & | pos, |
| MWAWGraphicStyle const & | style | ||
| ) | [protected] |
try to send an empty zone (can exist in MacWrtPro1.5)
Referenced by MacWrtProStructures::send().
| bool MacWrtProParser::sendPicture | ( | shared_ptr< MacWrtProParserInternal::Zone > | zone, |
| MWAWPosition | pictPos, | ||
| MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() |
||
| ) | [protected] |
try to send a picture
Referenced by sendPictureZone().
| bool MacWrtProParser::sendPictureZone | ( | int | blockId, |
| MWAWPosition const & | pictPos, | ||
| MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() |
||
| ) | [protected] |
try to send a picture
Referenced by MacWrtProStructures::send(), and sendText().
| bool MacWrtProParser::sendText | ( | shared_ptr< MacWrtProParserInternal::TextZone > | zone, |
| bool | mainZone = false |
||
| ) | [protected] |
try to send a text
Referenced by sendTextZone().
| bool MacWrtProParser::sendTextBoxZone | ( | int | blockId, |
| MWAWPosition const & | pos, | ||
| MWAWGraphicStyle const & | style = MWAWGraphicStyle::emptyStyle() |
||
| ) | [protected] |
send a textbox zone
Referenced by MacWrtProStructures::send().
| bool MacWrtProParser::sendTextZone | ( | int | blockId, |
| bool | mainZone = false |
||
| ) | [protected] |
send a text box
Referenced by MacWrtProStructures::send().
friend class MacWrtProParserInternal::SubDocument [friend] |
friend class MacWrtProStructures [friend] |
Referenced by init().
friend class MacWrtProStructuresListenerState [friend] |
shared_ptr<MacWrtProParserInternal::State> MacWrtProParser::m_state [protected] |
the state
Referenced by checkHeader(), checkUnparsed(), createDocument(), findNumHardBreaks(), getBlocksCalledByToken(), getFreeZoneList(), getZoneData(), init(), newPage(), numColumns(), parse(), parseDataZone(), parseTextZone(), readDocHeader(), readTextEntries(), readTextTokens(), sendPictureZone(), and sendTextZone().
shared_ptr<MacWrtProStructures> MacWrtProParser::m_structures [protected] |
the structures parser
Referenced by createDocument(), createZones(), init(), parse(), MacWrtProParserInternal::SubDocument::parse(), and sendText().