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
 ~MSK4Zone ()
 destructor
- Public Member Functions inherited from MSKParser
 MSKParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor
 MSKParser (MWAWInputStreamPtr input, MWAWParserStatePtr parserState)
 constructor using the parser state
virtual ~MSKParser ()
 destructor
MWAWInputStreamPtrgetInput ()
 returns the actual input
bool getColor (int id, MWAWColor &col, int vers=-1) const
 return the color which correspond to an index
bool checkIfPositionValid (long pos)
 check if a position is inside the file
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor
int version () const
 returns the works version
void setVersion (int vers)
 sets the works version

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

MSK4Parserm_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< MSK4Textm_textParser
 the text parser
shared_ptr< MSKGraphm_graphParser
 the graph parser
- Protected Attributes inherited from MSKParser
shared_ptr
< MSKParserInternal::State
m_state
 the state
MWAWInputStreamPtr m_input
 the input which can be an OLE in MSWorks 4 file
libmwaw::DebugFile m_asciiFile
 the debug file of the actual input

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

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::getPageTopLeft ( ) 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 Wed May 22 2013 18:12:45 for libmwaw by doxygen 1.8.1.2