The class which parses the main zones of a mac MS Works document v4. More...
#include <MSK4Zone.hxx>
Public Member Functions | |
MSK4Zone (MWAWInputStreamPtr input, MWAWParserStatePtr parserState, MSK4Parser &parser, std::string const &oleName) | |
constructor | |
~MSK4Zone () | |
destructor | |
Protected Member Functions | |
void | init () |
inits all internal variables | |
bool | parseHeaderIndex (MWAWInputStreamPtr &input) |
tries to find the beginning of the list of indices, then try to find all entries in this list. | |
bool | parseHeaderIndexEntry (MWAWInputStreamPtr &input) |
parses an index entry | |
bool | createZones (bool mainOle) |
finds and parses all the zones to prepare the data | |
void | readContentZones (MWAWEntry const &entry, bool mainOle) |
final reading of a text zone | |
MWAWContentListenerPtr | createListener (WPXDocumentInterface *interface, MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer) |
creates the main listener | |
double | getTextHeight () const |
returns the page height, ie. paper size less margin (in inches) less header/footer size | |
Vec2f | getPageLeftTop () const |
returns the page top left point | |
void | newPage (int number) |
adds a new page | |
void | sendFootNote (int id) |
creates a document for a footnote which some id (via MSK4Parser ) | |
void | readFootNote (int id) |
sends text corresponding to the footnote id to the listener (via MSK4Text) | |
void | sendFrameText (MWAWEntry const &entry, std::string const &frame) |
send the frame text | |
void | sendRBIL (int id, Vec2i const &sz) |
send a rbil zone | |
void | sendOLE (int id, MWAWPosition const &pos, WPXPropertyList frameExtras) |
send an OLE zone | |
MWAWEntry | getTextPosition () const |
return the text positions ( used for frame text) | |
void | parse (WPXDocumentInterface *) |
empty implementation of the parse function ( to make the class not virtual) | |
bool | checkHeader (MWAWHeader *, bool) |
empty implementation of the checkHeader function ( to make the class not virtual) | |
bool | readPRNT (MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page) |
reads the PRNT zone which contains the printer properties ( page dimension, margins, ...) | |
bool | readDOP (MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page) |
parses the DIO zone which contains the document properties (dimension, ...) | |
bool | readFRAM (MWAWInputStreamPtr input, MWAWEntry const &entry) |
parses the FRAM zone which contains some information about frames (header, footer, ...) | |
bool | readRLRB (MWAWInputStreamPtr input, MWAWEntry const &entry) |
parses the RLRB zone which seems to contain some position in the page ? | |
bool | readSELN (MWAWInputStreamPtr input, MWAWEntry const &entry) |
parses the SELN zone which seems to contain some information about the actual | |
void | setAscii (std::string const &oleName) |
inits the ascii file | |
Protected Attributes | |
MSK4Parser * | m_mainParser |
the main parser | |
shared_ptr < MSK4ZoneInternal::State > | m_state |
the internal state | |
std::multimap< std::string, MWAWEntry > | m_entryMap |
the list of entries, name->entry | |
shared_ptr< MSK4Text > | m_textParser |
the text parser | |
shared_ptr< MSKGraph > | m_graphParser |
the graph parser | |
Private Member Functions | |
MSK4Zone (MSK4Zone const &orig) | |
MSK4Zone & | operator= (MSK4Zone const &orig) |
Friends | |
class | MSK4ParserInternal::SubDocument |
class | MSK4Parser |
class | MSKGraph |
class | MSK4Text |
The class which parses the main zones of a mac MS Works document v4.
This class must be associated with a MSK4Parser, which gives it the oles to parse. This oles can be MN0, MacWorks/QHdr, MacWorks/QFtr, MacWorks/QFootnotes and MacWorks/QFrm<number> .
It creates a MSKGraph, a MSK4Text to parse the the graphic and the text parts.
It reads the entries:
MSK4Zone::MSK4Zone | ( | MWAWInputStreamPtr | input, |
MWAWParserStatePtr | parserState, | ||
MSK4Parser & | parser, | ||
std::string const & | oleName | ||
) |
constructor
destructor
MSK4Zone::MSK4Zone | ( | MSK4Zone const & | orig | ) | [private] |
bool MSK4Zone::checkHeader | ( | MWAWHeader * | , |
bool | |||
) | [inline, protected, virtual] |
empty implementation of the checkHeader function ( to make the class not virtual)
Implements MWAWParser.
MWAWContentListenerPtr MSK4Zone::createListener | ( | WPXDocumentInterface * | interface, |
MWAWSubDocumentPtr & | header, | ||
MWAWSubDocumentPtr & | footer | ||
) | [protected] |
creates the main listener
bool MSK4Zone::createZones | ( | bool | mainOle | ) | [protected] |
finds and parses all the zones to prepare the data
Referenced by MSK4ParserInternal::SubDocument::parse(), and MSK4Parser::sendFrameText().
Vec2f MSK4Zone::getPageLeftTop | ( | ) | const [protected, virtual] |
returns the page top left point
Implements MSKParser.
double MSK4Zone::getTextHeight | ( | ) | const [protected] |
returns the page height, ie. paper size less margin (in inches) less header/footer size
MWAWEntry MSK4Zone::getTextPosition | ( | ) | const [protected] |
return the text positions ( used for frame text)
Referenced by MSK4Parser::sendFrameText().
void MSK4Zone::init | ( | ) | [protected] |
inits all internal variables
Referenced by MSK4Zone().
void MSK4Zone::newPage | ( | int | number | ) | [protected] |
adds a new page
Referenced by readContentZones(), and MSK4Text::readText().
void MSK4Zone::parse | ( | WPXDocumentInterface * | ) | [inline, protected, virtual] |
empty implementation of the parse function ( to make the class not virtual)
Implements MWAWParser.
bool MSK4Zone::parseHeaderIndex | ( | MWAWInputStreamPtr & | input | ) | [protected] |
tries to find the beginning of the list of indices, then try to find all entries in this list.
Stores result in nameTable, offsetTable
Referenced by createZones().
bool MSK4Zone::parseHeaderIndexEntry | ( | MWAWInputStreamPtr & | input | ) | [protected] |
parses an index entry
Referenced by parseHeaderIndex().
void MSK4Zone::readContentZones | ( | MWAWEntry const & | entry, |
bool | mainOle | ||
) | [protected] |
final reading of a text zone
Referenced by MSK4ParserInternal::SubDocument::parse(), and MSK4Parser::sendFrameText().
bool MSK4Zone::readDOP | ( | MWAWInputStreamPtr | input, |
MWAWEntry const & | entry, | ||
MWAWPageSpan & | page | ||
) | [protected] |
parses the DIO zone which contains the document properties (dimension, ...)
Referenced by createZones().
void MSK4Zone::readFootNote | ( | int | id | ) | [protected] |
sends text corresponding to the footnote id to the listener (via MSK4Text)
Referenced by MSK4ParserInternal::SubDocument::parse().
bool MSK4Zone::readFRAM | ( | MWAWInputStreamPtr | input, |
MWAWEntry const & | entry | ||
) | [protected] |
parses the FRAM zone which contains some information about frames (header, footer, ...)
Referenced by createZones().
bool MSK4Zone::readPRNT | ( | MWAWInputStreamPtr | input, |
MWAWEntry const & | entry, | ||
MWAWPageSpan & | page | ||
) | [protected] |
reads the PRNT zone which contains the printer properties ( page dimension, margins, ...)
Referenced by createZones().
bool MSK4Zone::readRLRB | ( | MWAWInputStreamPtr | input, |
MWAWEntry const & | entry | ||
) | [protected] |
parses the RLRB zone which seems to contain some position in the page ?
Referenced by createZones().
bool MSK4Zone::readSELN | ( | MWAWInputStreamPtr | input, |
MWAWEntry const & | entry | ||
) | [protected] |
parses the SELN zone which seems to contain some information about the actual
Referenced by createZones().
void MSK4Zone::sendFootNote | ( | int | id | ) | [protected] |
creates a document for a footnote which some id (via MSK4Parser )
Referenced by MSK4Text::readText().
void MSK4Zone::sendFrameText | ( | MWAWEntry const & | entry, |
std::string const & | frame | ||
) | [protected, virtual] |
send the frame text
Reimplemented from MSKParser.
void MSK4Zone::sendOLE | ( | int | id, |
MWAWPosition const & | pos, | ||
WPXPropertyList | frameExtras | ||
) | [protected, virtual] |
send an OLE zone
Reimplemented from MSKParser.
void MSK4Zone::sendRBIL | ( | int | id, |
Vec2i const & | sz | ||
) | [protected] |
send a rbil zone
Referenced by MSK4Text::readText().
void MSK4Zone::setAscii | ( | std::string const & | oleName | ) | [protected] |
inits the ascii file
Referenced by MSK4Zone().
friend class MSK4Parser [friend] |
friend class MSK4ParserInternal::SubDocument [friend] |
std::multimap<std::string, MWAWEntry> MSK4Zone::m_entryMap [protected] |
the list of entries, name->entry
Referenced by createZones(), MSK4Text::findFDPStructures(), MSK4Text::findFDPStructuresByHand(), parseHeaderIndex(), parseHeaderIndexEntry(), readContentZones(), and MSK4Text::readStructures().
shared_ptr<MSKGraph> MSK4Zone::m_graphParser [protected] |
the graph parser
Referenced by createZones(), init(), newPage(), readContentZones(), and sendRBIL().
MSK4Parser* MSK4Zone::m_mainParser [protected] |
the main parser
Referenced by sendFootNote(), sendFrameText(), and sendOLE().
shared_ptr<MSK4ZoneInternal::State> MSK4Zone::m_state [protected] |
the internal state
Reimplemented from MSKParser.
Referenced by createZones(), getPageLeftTop(), getTextHeight(), init(), newPage(), readContentZones(), readDOP(), and readFRAM().
shared_ptr<MSK4Text> MSK4Zone::m_textParser [protected] |
the text parser
Referenced by createZones(), getTextPosition(), init(), readContentZones(), and readFootNote().