MsWks4Zone Class Reference

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

#include <MsWks4Zone.hxx>

Public Member Functions

 MsWks4Zone (MWAWInputStreamPtr input, MWAWParserStatePtr parserState, MWAWParser &parser, std::string const &oleName)
 constructor More...
 
 ~MsWks4Zone ()
 destructor More...
 

Protected Member Functions

void init ()
 inits all internal variables More...
 
MWAWInputStreamPtr getInput ()
 returns the actual input 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...
 
MWAWTextListenerPtr createListener (librevenge::RVNGTextInterface *interface)
 creates the main listener More...
 
double getTextHeight () const
 returns the page height, ie. paper size less margin (in inches) less header/footer size More...
 
void newPage (int number, bool soft=false)
 adds a new page More...
 
void readFootNote (int id)
 sends text corresponding to the footnote id to the listener (via MsWks4Text) More...
 
MWAWEntry getTextPosition () const
 return the text positions ( used for frame text) 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...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 

Protected Attributes

MWAWParserm_mainParser
 the main parser More...
 
shared_ptr< MWAWParserStatem_parserState
 the parser state More...
 
shared_ptr
< MsWks4ZoneInternal::State
m_state
 the internal state More...
 
shared_ptr< MsWksDocumentm_document
 the zone data More...
 

Private Member Functions

 MsWks4Zone (MsWks4Zone const &orig)
 
MsWks4Zoneoperator= (MsWks4Zone const &orig)
 

Friends

class MsWksDocument
 
class MsWksDRParser
 
class MsWksParser
 
class MsWks4Text
 

Detailed Description

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

This class must be associated with a MsWksParser or a MsWksDocument, 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 MsWksGraph, a MsWks4Text 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 MsWks4Graph)
  • SELN : the actual text/... selection

Constructor & Destructor Documentation

MsWks4Zone::MsWks4Zone ( MWAWInputStreamPtr  input,
MWAWParserStatePtr  parserState,
MWAWParser parser,
std::string const &  oleName 
)

constructor

MsWks4Zone::~MsWks4Zone ( )

destructor

MsWks4Zone::MsWks4Zone ( MsWks4Zone const &  orig)
private

Member Function Documentation

libmwaw::DebugFile & MsWks4Zone::ascii ( )
protected

a DebugFile used to write what we recognize when we parse the document

MWAWTextListenerPtr MsWks4Zone::createListener ( librevenge::RVNGTextInterface *  interface)
protected

creates the main listener

bool MsWks4Zone::createZones ( bool  mainOle)
protected

finds and parses all the zones to prepare the data

Referenced by MsWksDocument::sendTextbox().

MWAWInputStreamPtr MsWks4Zone::getInput ( )
protected

returns the actual input

double MsWks4Zone::getTextHeight ( ) const
protected

returns the page height, ie. paper size less margin (in inches) less header/footer size

Referenced by createListener().

MWAWEntry MsWks4Zone::getTextPosition ( ) const
protected

return the text positions ( used for frame text)

Referenced by MsWksDocument::sendTextbox().

void MsWks4Zone::init ( )
protected

inits all internal variables

Referenced by MsWks4Zone().

void MsWks4Zone::newPage ( int  number,
bool  soft = false 
)
protected

adds a new page

Referenced by readContentZones().

MsWks4Zone& MsWks4Zone::operator= ( MsWks4Zone const &  orig)
private
bool MsWks4Zone::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 MsWks4Zone::parseHeaderIndexEntry ( MWAWInputStreamPtr input)
protected

parses an index entry

Referenced by parseHeaderIndex().

void MsWks4Zone::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 MsWksDocument::sendTextbox().

bool MsWks4Zone::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 MsWks4Zone::readFootNote ( int  id)
protected

sends text corresponding to the footnote id to the listener (via MsWks4Text)

bool MsWks4Zone::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 MsWks4Zone::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 MsWks4Zone::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 MsWksGraph must parse this zone ?

Referenced by createZones().

bool MsWks4Zone::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 MsWks4Zone::setAscii ( std::string const &  oleName)
protected

inits the ascii file

Referenced by MsWks4Zone().

Friends And Related Function Documentation

friend class MsWks4Text
friend
friend class MsWksDocument
friend

Referenced by MsWks4Zone().

friend class MsWksDRParser
friend
friend class MsWksParser
friend

Member Data Documentation

MWAWParser* MsWks4Zone::m_mainParser
protected

the main parser

Referenced by readContentZones().

shared_ptr<MWAWParserState> MsWks4Zone::m_parserState
protected
shared_ptr<MsWks4ZoneInternal::State> MsWks4Zone::m_state
protected

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

Generated on Thu Jul 9 2015 20:26:38 for libmwaw by doxygen 1.8.8