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 const &input, MWAWParserStatePtr const &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...
 
std::shared_ptr< MWAWParserStatem_parserState
 the parser state More...
 
std::shared_ptr< MsWks4ZoneInternal::Statem_state
 the internal state More...
 
std::shared_ptr< MsWksDocumentm_document
 the zone data More...
 

Private Member Functions

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

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() [1/2]

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

constructor

◆ ~MsWks4Zone()

MsWks4Zone::~MsWks4Zone ( )

destructor

◆ MsWks4Zone() [2/2]

MsWks4Zone::MsWks4Zone ( MsWks4Zone const &  orig)
privatedelete

Member Function Documentation

◆ ascii()

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

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

◆ createListener()

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

creates the main listener

◆ createZones()

bool MsWks4Zone::createZones ( bool  mainOle)
protected

finds and parses all the zones to prepare the data

Referenced by MsWksDocument::sendTextbox().

◆ getInput()

MWAWInputStreamPtr MsWks4Zone::getInput ( )
protected

returns the actual input

◆ getTextHeight()

double MsWks4Zone::getTextHeight ( ) const
protected

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

Referenced by createListener().

◆ getTextPosition()

MWAWEntry MsWks4Zone::getTextPosition ( ) const
protected

return the text positions ( used for frame text)

Referenced by MsWksDocument::sendTextbox().

◆ init()

void MsWks4Zone::init ( )
protected

inits all internal variables

Referenced by MsWks4Zone().

◆ newPage()

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

adds a new page

Referenced by readContentZones().

◆ operator=()

MsWks4Zone& MsWks4Zone::operator= ( MsWks4Zone const &  orig)
privatedelete

◆ parseHeaderIndex()

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

◆ parseHeaderIndexEntry()

bool MsWks4Zone::parseHeaderIndexEntry ( MWAWInputStreamPtr input)
protected

parses an index entry

Referenced by parseHeaderIndex().

◆ readContentZones()

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

◆ readDOP()

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

◆ readFootNote()

void MsWks4Zone::readFootNote ( int  id)
protected

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

◆ readFRAM()

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

◆ readPRNT()

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

◆ readRLRB()

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

◆ readSELN()

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

◆ setAscii()

void MsWks4Zone::setAscii ( std::string const &  oleName)
protected

inits the ascii file

Referenced by MsWks4Zone().

Friends And Related Function Documentation

◆ MsWks4Text

friend class MsWks4Text
friend

◆ MsWksDocument

friend class MsWksDocument
friend

Referenced by MsWks4Zone().

◆ MsWksDRParser

friend class MsWksDRParser
friend

◆ MsWksParser

friend class MsWksParser
friend

Member Data Documentation

◆ m_document

◆ m_mainParser

MWAWParser* MsWks4Zone::m_mainParser
protected

the main parser

Referenced by readContentZones().

◆ m_parserState

std::shared_ptr<MWAWParserState> MsWks4Zone::m_parserState
protected

◆ m_state

std::shared_ptr<MsWks4ZoneInternal::State> MsWks4Zone::m_state
protected

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

Generated on Fri Sep 18 2020 18:14:52 for libmwaw by doxygen 1.8.20