Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
MacWrtProStructures Class Reference

the main class to read the structures part of MacWrite Pro file More...

`#include <MacWrtProStructures.hxx>`

## Public Member Functions
| MacWrtProStructures (MacWrtProParser &mainParser)
| constructor More...
virtual | ~MacWrtProStructures ()
| destructor More...
int | version () const
| returns the file version. More...
void | setAsciiName (char const *name)
| Debugging: change the default ascii file (by default struct ) More...

## Protected Member Functions
void | init ()
| inits all internal variables More...
bool | createZones ()
| finds the different objects zones More...
bool | createZonesV2 ()
| finds the different objects zones in a MacWriteII file More...
int | numPages () const
| returns the number of pages More...
bool | sendMainZone ()
| send the main zone More...
int | getHeaderId (int page, int &numSimillar) const
| return the header blockid ( or 0) More...
int | getFooterId (int page, int &numSimillar) const
| return the footer blockid ( or 0) More...
void | flushExtra ()
| flush not send zones More...
void | buildPageStructures ()
| look for pages structures More...
void | buildTableStructures ()
| look for tables structures and if so, prepare data More...
bool | readStyles ()
| try to read the paragraph styles zone which begins at address 0x200 More...
bool | readStyle (int styleId)
| try to read a style More...
bool | readCharStyles ()
| try to read the character styles zone More...
bool | readParagraphs ()
| try to read a list of paragraph More...
bool | readParagraph (MacWrtProStructuresInternal::Paragraph &para)
| try to read a paragraph More...
int | getEndBlockSize ()
| returns the size of the block end data More...
std::shared_ptr< MacWrtProStructuresInternal::Block > | readBlock ()
| try to read a block entry More...
std::shared_ptr< MacWrtProStructuresInternal::Block > | readBlockV2 (int id)
| try to read a block entry More...
bool | readBlocksList ()
| try to read the list of block entries More...
bool | readFontsName ()
| try to read the fonts zone More...
bool | readFontsDef ()
| try to read the list of fonts More...
bool | readFont (MacWrtProStructuresInternal::Font &font)
| try to read a font More...
bool | readSections (std::vector< MacWrtProStructuresInternal::Section > &sections)
| try to read the section info ? More...
bool | readSelection ()
| try to read a 16 bytes the zone which follow the char styles zone ( the selection?) More...
bool | readStructB ()
| try to read a zone which follow the fonts zone(checkme) More...
bool | getColor (int colId, MWAWColor &color) const
| try to return the color corresponding to colId More...
bool | getPattern (int patId, float &patternPercent) const
| try to return the pattern corresponding to patId More...
bool | getColor (int colId, int patId, MWAWColor &color) const
| try to return the color corresponding to colId and patId More...
bool | isSent (int blockId)
| returns true if the block is already sent ( or does not exists) More...
bool | send (int blockId, bool mainZone=false)
| try to send a block which corresponds to blockid More...
MWAWTextListenerPtr & | getTextListener ()
| returns the actual listener More...
libmwaw::DebugFile & | ascii ()
| returns the debug file More...
std::string const & | asciiName () const
| return the ascii file name More...

## Static Protected Member Functions
static bool | readString (MWAWInputStreamPtr input, std::string &res)
| try to read a string More...

## Protected Attributes
MWAWParserStatePtr | m_parserState
| the parser state More...
MWAWInputStreamPtr | m_input
| the main input More...
MacWrtProParser & | m_mainParser
| the main parser More...
std::shared_ptr< MacWrtProStructuresInternal::State > | m_state
| the state More...
libmwaw::DebugFile | m_asciiFile
| the debug file More...
std::string | m_asciiName
| the debug file name More...

## Friends
class | MacWrtProParser
class | MacWrtProParserInternal::SubDocument
struct | MacWrtProStructuresInternal::Cell
class | MacWrtProStructuresListenerState

## Detailed Description

the main class to read the structures part of MacWrite Pro file

## Constructor & Destructor Documentation

## ◆ MacWrtProStructures()

MacWrtProStructures::MacWrtProStructures | ( | MacWrtProParser & | mainParser | ) |
| explicit

constructor

## ◆ ~MacWrtProStructures()

MacWrtProStructures::~MacWrtProStructures | ( |  | ) |
| virtual

destructor

## Member Function Documentation

## ◆ ascii()

libmwaw::DebugFile& MacWrtProStructures::ascii | ( |  | ) |
| inline protected

returns the debug file

Referenced by createZones(), createZonesV2(), readBlock(), readBlocksList(), readBlockV2(), readCharStyles(), readFontsDef(), readFontsName(), readParagraph(), readParagraphs(), readSections(), readSelection(), readStructB(), readStyle(), readStyles(), and ~MacWrtProStructures().

## ◆ asciiName()

std::string const& MacWrtProStructures::asciiName | ( |  | ) | const
| inline protected

return the ascii file name

Referenced by createZones(), and createZonesV2().

## ◆ buildPageStructures()

void MacWrtProStructures::buildPageStructures | ( |  | ) |
| protected

look for pages structures

Referenced by createZones().

## ◆ buildTableStructures()

void MacWrtProStructures::buildTableStructures | ( |  | ) |
| protected

look for tables structures and if so, prepare data

Referenced by createZones().

## ◆ createZones()

bool MacWrtProStructures::createZones | ( |  | ) |
| protected

finds the different objects zones

## ◆ createZonesV2()

bool MacWrtProStructures::createZonesV2 | ( |  | ) |
| protected

finds the different objects zones in a MacWriteII file

Note
  : this function is called by createZones

Referenced by createZones().

## ◆ flushExtra()

void MacWrtProStructures::flushExtra | ( |  | ) |
| protected

flush not send zones

## ◆ getColor() [1/2]

bool MacWrtProStructures::getColor | ( | int | colId,
|  | MWAWColor & | color
| ) |  | const
| protected

try to return the color corresponding to colId

Referenced by getColor(), readBlock(), and readFont().

## ◆ getColor() [2/2]

bool MacWrtProStructures::getColor | ( | int | colId,
|  | int | patId,
|  | MWAWColor & | color
| ) |  | const
| protected

try to return the color corresponding to colId and patId

## ◆ getEndBlockSize()

int MacWrtProStructures::getEndBlockSize | ( |  | ) |
| protected

returns the size of the block end data

Referenced by readBlock(), and readBlocksList().

## ◆ getFooterId()

int MacWrtProStructures::getFooterId | ( | int | page,
|  | int & | numSimillar
| ) |  | const
| protected

return the footer blockid ( or 0)

## ◆ getHeaderId()

int MacWrtProStructures::getHeaderId | ( | int | page,
|  | int & | numSimillar
| ) |  | const
| protected

return the header blockid ( or 0)

## ◆ getPattern()

bool MacWrtProStructures::getPattern | ( | int | patId,
|  | float & | patternPercent
| ) |  | const
| protected

try to return the pattern corresponding to patId

Referenced by getColor().

## ◆ getTextListener()

MWAWTextListenerPtr & MacWrtProStructures::getTextListener | ( |  | ) |
| protected

returns the actual listener

## ◆ init()

void MacWrtProStructures::init | ( |  | ) |
| protected

inits all internal variables

Referenced by MacWrtProStructures().

## ◆ isSent()

bool MacWrtProStructures::isSent | ( | int | blockId | ) |
| protected

returns true if the block is already sent ( or does not exists)

## ◆ numPages()

int MacWrtProStructures::numPages | ( |  | ) | const
| protected

returns the number of pages

## ◆ readBlock()

std::shared_ptr< MacWrtProStructuresInternal::Block > MacWrtProStructures::readBlock | ( |  | ) |
| protected

try to read a block entry

Referenced by readBlocksList().

## ◆ readBlocksList()

bool MacWrtProStructures::readBlocksList | ( |  | ) |
| protected

try to read the list of block entries

Referenced by createZones().

## ◆ readBlockV2()

std::shared_ptr< MacWrtProStructuresInternal::Block > MacWrtProStructures::readBlockV2 | ( | int | id | ) |
| protected

try to read a block entry

Referenced by createZonesV2().

## ◆ readCharStyles()

bool MacWrtProStructures::readCharStyles | ( |  | ) |
| protected

try to read the character styles zone

Referenced by createZones(), and createZonesV2().

## ◆ readFont()

bool MacWrtProStructures::readFont | ( | MacWrtProStructuresInternal::Font & | font | ) |
| protected

try to read a font

Referenced by readCharStyles(), readFontsDef(), and readStyle().

## ◆ readFontsDef()

bool MacWrtProStructures::readFontsDef | ( |  | ) |
| protected

try to read the list of fonts

Referenced by createZones(), and createZonesV2().

## ◆ readFontsName()

bool MacWrtProStructures::readFontsName | ( |  | ) |
| protected

try to read the fonts zone

Referenced by createZones(), and createZonesV2().

## ◆ readParagraph()

bool MacWrtProStructures::readParagraph | ( | MacWrtProStructuresInternal::Paragraph & | para | ) |
| protected

try to read a paragraph

seems difficult to set bottom a percentage of the line unit, so do the strict minimum...

Referenced by readParagraphs(), and readStyle().

## ◆ readParagraphs()

bool MacWrtProStructures::readParagraphs | ( |  | ) |
| protected

try to read a list of paragraph

Referenced by createZones(), and createZonesV2().

## ◆ readSections()

bool MacWrtProStructures::readSections | ( | std::vector< MacWrtProStructuresInternal::Section > & | sections | ) |
| protected

try to read the section info ?

Referenced by createZones().

## ◆ readSelection()

bool MacWrtProStructures::readSelection | ( |  | ) |
| protected

try to read a 16 bytes the zone which follow the char styles zone ( the selection?)

Referenced by createZones().

## ◆ readString()

bool MacWrtProStructures::readString | ( | MWAWInputStreamPtr | input,
|  | std::string & | res
| ) |  |
| static protected

try to read a string

Referenced by createZones(), and readBlocksList().

## ◆ readStructB()

bool MacWrtProStructures::readStructB | ( |  | ) |
| protected

try to read a zone which follow the fonts zone(checkme)

Referenced by createZones().

## ◆ readStyle()

bool MacWrtProStructures::readStyle | ( | int | styleId | ) |
| protected

try to read a style

Referenced by readStyles().

## ◆ readStyles()

bool MacWrtProStructures::readStyles | ( |  | ) |
| protected

try to read the paragraph styles zone which begins at address 0x200

Referenced by createZones().

## ◆ send()

bool MacWrtProStructures::send | ( | int | blockId,
|  | bool | mainZone = `false`
| ) |  |
| protected

try to send a block which corresponds to blockid

note: blockId=-noteId to send footnote in MW2

Referenced by flushExtra(), and sendMainZone().

## ◆ sendMainZone()

bool MacWrtProStructures::sendMainZone | ( |  | ) |
| protected

send the main zone

## ◆ setAsciiName()

void MacWrtProStructures::setAsciiName | ( | char const * | name | ) |
| inline

Debugging: change the default ascii file (by default struct )

## ◆ version()

int MacWrtProStructures::version | ( |  | ) | const

returns the file version.

this version is only correct after the header is parsed

Referenced by createZones(), createZonesV2(), flushExtra(), getColor(), getFooterId(), getHeaderId(), getPattern(), isSent(), readCharStyles(), readFont(), readFontsDef(), readFontsName(), readParagraph(), readParagraphs(), send(), and sendMainZone().

## Friends And Related Function Documentation

## ◆ MacWrtProParser

friend class MacWrtProParser
| friend

## ◆ MacWrtProParserInternal::SubDocument

friend class MacWrtProParserInternal::SubDocument
| friend

## ◆ MacWrtProStructuresInternal::Cell

friend struct MacWrtProStructuresInternal::Cell
| friend

## ◆ MacWrtProStructuresListenerState

friend class MacWrtProStructuresListenerState
| friend

## Member Data Documentation

## ◆ m_asciiFile

libmwaw::DebugFile MacWrtProStructures::m_asciiFile
| protected

the debug file

## ◆ m_asciiName

std::string MacWrtProStructures::m_asciiName
| protected

the debug file name

Referenced by init().

## ◆ m_input

MWAWInputStreamPtr MacWrtProStructures::m_input
| protected

the main input

Referenced by createZones(), createZonesV2(), getEndBlockSize(), readBlock(), readBlocksList(), readBlockV2(), readCharStyles(), readFont(), readFontsDef(), readFontsName(), readParagraph(), readParagraphs(), readSections(), readSelection(), readStructB(), readStyle(), and readStyles().

## ◆ m_mainParser

MacWrtProParser& MacWrtProStructures::m_mainParser
| protected

the main parser

Referenced by buildPageStructures(), createZones(), createZonesV2(), readBlocksList(), and send().

## ◆ m_parserState

MWAWParserStatePtr MacWrtProStructures::m_parserState
| protected

the parser state

Referenced by flushExtra(), getTextListener(), readCharStyles(), readFontsDef(), readFontsName(), readStyle(), send(), and version().

## ◆ m_state

std::shared_ptr<MacWrtProStructuresInternal::State> MacWrtProStructures::m_state
| protected

the state

Referenced by buildPageStructures(), buildTableStructures(), createZones(), createZonesV2(), flushExtra(), getFooterId(), getHeaderId(), init(), isSent(), numPages(), readBlock(), readBlocksList(), readFontsDef(), readParagraphs(), send(), sendMainZone(), and version().

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

- MacWrtProStructures.hxx
- MacWrtProStructures.cxx