MSK4Zone Class Reference

The class which parses the main zones of a mac MS Works document v4. More...

#include <MSK4Zone.hxx>

Inheritance diagram for MSK4Zone:
MSKParser MWAWParser

Public Member Functions

 MSK4Zone (MWAWInputStreamPtr input, MWAWParserStatePtr parserState, MSK4Parser &parser, std::string const &oleName)
 constructor More...
 
 ~MSK4Zone ()
 destructor More...
 
- Public Member Functions inherited from MSKParser
 MSKParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor More...
 
 MSKParser (MWAWInputStreamPtr input, MWAWParserStatePtr parserState)
 constructor using the parser state More...
 
virtual ~MSKParser ()
 destructor More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
bool getColor (int id, MWAWColor &col, int vers=-1) const
 return the color which correspond to an index More...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 
- Public Member Functions inherited from MWAWParser
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...
 
bool parseHeaderIndex (MWAWInputStreamPtr &input)
 tries to find the beginning of the list of indices, then try to find all entries in this list. More...
 
bool parseHeaderIndexEntry (MWAWInputStreamPtr &input)
 parses an index entry More...
 
bool createZones (bool mainOle)
 finds and parses all the zones to prepare the data More...
 
void readContentZones (MWAWEntry const &entry, bool mainOle)
 final reading of a text zone More...
 
MWAWContentListenerPtr createListener (WPXDocumentInterface *interface, MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer)
 creates the main listener More...
 
double getTextHeight () const
 returns the page height, ie. paper size less margin (in inches) less header/footer size More...
 
Vec2f getPageLeftTop () const
 returns the page top left point More...
 
void newPage (int number)
 adds a new page More...
 
void sendFootNote (int id)
 creates a document for a footnote which some id (via MSK4Parser ) More...
 
void readFootNote (int id)
 sends text corresponding to the footnote id to the listener (via MSK4Text) More...
 
void sendFrameText (MWAWEntry const &entry, std::string const &frame)
 send the frame text More...
 
void sendRBIL (int id, Vec2i const &sz)
 send a rbil zone More...
 
void sendOLE (int id, MWAWPosition const &pos, WPXPropertyList frameExtras)
 send an OLE zone More...
 
MWAWEntry getTextPosition () const
 return the text positions ( used for frame text) More...
 
void parse (WPXDocumentInterface *)
 empty implementation of the parse function ( to make the class not virtual) More...
 
bool checkHeader (MWAWHeader *, bool)
 empty implementation of the checkHeader function ( to make the class not virtual) More...
 
bool readPRNT (MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
 reads the PRNT zone which contains the printer properties ( page dimension, margins, ...) More...
 
bool readDOP (MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
 parses the DIO zone which contains the document properties (dimension, ...) More...
 
bool readFRAM (MWAWInputStreamPtr input, MWAWEntry const &entry)
 parses the FRAM zone which contains some information about frames (header, footer, ...) More...
 
bool readRLRB (MWAWInputStreamPtr input, MWAWEntry const &entry)
 parses the RLRB zone which seems to contain some position in the page ? More...
 
bool readSELN (MWAWInputStreamPtr input, MWAWEntry const &entry)
 parses the SELN zone which seems to contain some information about the actual More...
 
void setAscii (std::string const &oleName)
 inits the ascii file More...
 
- Protected Member Functions inherited from MWAWParser
 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...
 
MWAWHeadergetHeader ()
 returns the header More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener More...
 
MWAWContentListenerPtrgetListener ()
 returns the listener More...
 
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension More...
 
MWAWPageSpangetPageSpan ()
 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...
 
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser More...
 
void setListener (MWAWContentListenerPtr &listener)
 sets the listener More...
 
void resetListener ()
 resets the listener More...
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter More...
 
void setFontConverter (MWAWFontConverterPtr fontConverter)
 sets the font convertor More...
 
libmwaw::DebugFileascii ()
 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

MSK4Parserm_mainParser
 the main parser More...
 
shared_ptr
< MSK4ZoneInternal::State
m_state
 the internal state More...
 
std::multimap< std::string,
MWAWEntry
m_entryMap
 the list of entries, name->entry More...
 
shared_ptr< MSK4Textm_textParser
 the text parser More...
 
shared_ptr< MSKGraphm_graphParser
 the graph parser More...
 
- Protected Attributes inherited from MSKParser
MWAWInputStreamPtr m_input
 the input which can be an OLE in MSWorks 4 file More...
 
libmwaw::DebugFile m_asciiFile
 the debug file of the actual input More...
 

Private Member Functions

 MSK4Zone (MSK4Zone const &orig)
 
MSK4Zoneoperator= (MSK4Zone const &orig)
 

Friends

class MSK4ParserInternal::SubDocument
 
class MSK4Parser
 
class MSKGraph
 
class MSK4Text
 

Additional Inherited Members

- Static Public Member Functions inherited from MSKParser
static std::vector< MWAWColor >
const & 
getPalette (int vers)
 return a list of color corresponding to a version More...
 

Detailed Description

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:

  • DOP : main document properties: dimension, ... (only parsed)
  • FRAM : a zone which contains dimensions of objects (textbox, picture, ...) : only parsed
  • PRNT : the printer information which contains page dimensions, margins, ...
  • RLRB : an unknown zone which seems to contain some dimension ( only parsed) : maybe related to RBDR ( see MSK4Graph)
  • SELN : the actual text/... selection

Constructor & Destructor Documentation

MSK4Zone::MSK4Zone ( MWAWInputStreamPtr  input,
MWAWParserStatePtr  parserState,
MSK4Parser parser,
std::string const &  oleName 
)

constructor

MSK4Zone::~MSK4Zone ( )

destructor

MSK4Zone::MSK4Zone ( MSK4Zone const &  orig)
private

Member Function Documentation

bool MSK4Zone::checkHeader ( MWAWHeader ,
bool   
)
inlineprotectedvirtual

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
protectedvirtual

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().

MSK4Zone& MSK4Zone::operator= ( MSK4Zone const &  orig)
private
void MSK4Zone::parse ( WPXDocumentInterface *  )
inlineprotectedvirtual

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

Note
reads all textzone if !entry.valid(), if not does nothing

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, ...)

Note
this zone is only parsed ; the read data are not used.

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, ...)

Note
this zone is only parsed ; the read data are not used

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 ?

Note
this zone is only parsed, maybe MSK4Graph must parse this zone ?

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

Note
this zone is only parsed ; the read data are not used

Referenced by createZones().

void MSK4Zone::sendFootNote ( int  id)
protected

creates a document for a footnote which some id (via MSK4Parser )

Note
if id==-1, the footnote will be empty

Referenced by MSK4Text::readText().

void MSK4Zone::sendFrameText ( MWAWEntry const &  entry,
std::string const &  frame 
)
protectedvirtual

send the frame text

Reimplemented from MSKParser.

void MSK4Zone::sendOLE ( int  id,
MWAWPosition const &  pos,
WPXPropertyList  frameExtras 
)
protectedvirtual

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().

Friends And Related Function Documentation

friend class MSK4Parser
friend
friend class MSK4ParserInternal::SubDocument
friend
friend class MSK4Text
friend

Referenced by init().

friend class MSKGraph
friend

Referenced by init().

Member Data Documentation

std::multimap<std::string, MWAWEntry> MSK4Zone::m_entryMap
protected
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
shared_ptr<MSK4Text> MSK4Zone::m_textParser
protected

The documentation for this class was generated from the following files:

Generated on Tue Mar 10 2015 17:32:09 for libmwaw by doxygen 1.8.5