MsWks4Zone Class Reference documentation

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
| ~MsWks4Zone ()
| destructor

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

## Protected Attributes
MWAWParser * | m_mainParser
| the main parser
std::shared_ptr< MWAWParserState > | m_parserState
| the parser state
std::shared_ptr< MsWks4ZoneInternal::State > | m_state
| the internal state
std::shared_ptr< MsWksDocument > | m_document
| the zone data

## Private Member Functions
| MsWks4Zone (MsWks4Zone const &orig)=delete
MsWks4Zone & | operator= (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

Referenced by MsWks4Zone(), and operator=().

## ◆ ~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 Symbol Documentation

## ◆ MsWks4Text

friend class MsWks4Text
| friend

Referenced by MsWks4Text.

## ◆ MsWksDocument

friend class MsWksDocument
| friend

Referenced by MsWks4Zone(), and MsWksDocument.

## ◆ MsWksDRParser

friend class MsWksDRParser
| friend

Referenced by MsWksDRParser.

## ◆ MsWksParser

friend class MsWksParser
| friend

Referenced by MsWksParser.

## Member Data Documentation

## ◆ m_document

std::shared_ptr<MsWksDocument> MsWks4Zone::m_document
| protected

the zone data

Referenced by ascii(), createListener(), createZones(), getInput(), getTextPosition(), init(), MsWks4Zone(), newPage(), parseHeaderIndex(), parseHeaderIndexEntry(), readContentZones(), readDOP(), readFootNote(), readFRAM(), readPRNT(), readRLRB(), readSELN(), and setAscii().

## ◆ m_mainParser

MWAWParser* MsWks4Zone::m_mainParser
| protected

the main parser

Referenced by MsWks4Zone(), and readContentZones().

## ◆ m_parserState

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

the parser state

Referenced by createListener(), createZones(), getTextHeight(), MsWks4Zone(), newPage(), and readContentZones().

## ◆ m_state

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

the internal state

Referenced by createListener(), createZones(), init(), MsWks4Zone(), newPage(), readContentZones(), readDOP(), and readFRAM().

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

- MsWks4Zone.hxx
- MsWks4Zone.cxx