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

Protected Member Functions

void init ()
 inits all internal variables More...
 
bool createZones (std::shared_ptr< MWAWStream > &stream, int numPages)
 finds the different objects zones More...
 
bool createZonesII (std::shared_ptr< MWAWStream > &stream, int numPages)
 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...
 
void updatePageSpan (int page, bool hasTitlePage, MWAWPageSpan &pageSpan)
 update the page span 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 (std::shared_ptr< MWAWStream > &stream)
 try to read the paragraph styles zone which begins at address 0x200 More...
 
bool readStyle (std::shared_ptr< MWAWStream > &stream, int styleId)
 try to read a style More...
 
bool readCharStyles (std::shared_ptr< MWAWStream > &stream)
 try to read the character styles zone More...
 
bool readParagraphs (std::shared_ptr< MWAWStream > &stream)
 try to read a list of paragraph More...
 
bool readParagraph (std::shared_ptr< MWAWStream > &stream, MacWrtProStructuresInternal::Paragraph &para)
 try to read a paragraph More...
 
bool readGraphicsList (std::shared_ptr< MWAWStream > &stream, int nuumPages)
 try to read the list of graphic entries: 1.0 1.5 More...
 
std::shared_ptr< MacWrtProStructuresInternal::GraphicreadGraphic (std::shared_ptr< MWAWStream > &stream)
 try to read a graphic entry: 1.0, 1.5 More...
 
bool readPagesListII (std::shared_ptr< MWAWStream > const &stream, int numPages)
 try to parse the list of page: II More...
 
bool readPageII (std::shared_ptr< MWAWStream > const &stream, int wh, MacWrtProStructuresInternal::Page &page)
 try to read a page entry: II More...
 
bool readGraphicII (std::shared_ptr< MWAWStream > const &stream, int id, bool mainGraphic, MacWrtProStructuresInternal::Graphic &graphic)
 try to read a graphic structure: II More...
 
bool readFontsName (std::shared_ptr< MWAWStream > &stream)
 try to read the fonts zone More...
 
bool readFontsDef (std::shared_ptr< MWAWStream > &stream)
 try to read the list of fonts More...
 
bool readFont (std::shared_ptr< MWAWStream > &stream, MacWrtProStructuresInternal::Font &font)
 try to read a font More...
 
bool readSections (std::shared_ptr< MWAWStream > &stream, std::vector< MacWrtProStructuresInternal::Section > &sections)
 try to read the section info ? More...
 
bool readSelection (std::shared_ptr< MWAWStream > &stream)
 try to read a 16 bytes the zone which follow the char styles zone ( the selection?) More...
 
bool readStructB (std::shared_ptr< MWAWStream > &stream)
 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 graphicId)
 returns true if the graphic is already sent ( or does not exists) More...
 
bool send (int graphicId, bool mainZone=false)
 try to send a graphic which corresponds to graphicid More...
 
MWAWTextListenerPtrgetTextListener ()
 returns the actual listener 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...
 
MacWrtProParserm_mainParser
 the main parser More...
 
std::shared_ptr< MacWrtProStructuresInternal::Statem_state
 the state 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

◆ 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 ( std::shared_ptr< MWAWStream > &  stream,
int  numPages 
)
protected

finds the different objects zones

◆ createZonesII()

bool MacWrtProStructures::createZonesII ( std::shared_ptr< MWAWStream > &  stream,
int  numPages 
)
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,
int  patId,
MWAWColor color 
) const
protected

try to return the color corresponding to colId and patId

◆ getColor() [2/2]

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

try to return the color corresponding to colId

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

◆ 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  graphicId)
protected

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

◆ numPages()

int MacWrtProStructures::numPages ( ) const
protected

returns the number of pages

Referenced by createZones(), createZonesII(), readGraphicsList(), and readPagesListII().

◆ readCharStyles()

bool MacWrtProStructures::readCharStyles ( std::shared_ptr< MWAWStream > &  stream)
protected

try to read the character styles zone

Referenced by createZones(), and createZonesII().

◆ readFont()

bool MacWrtProStructures::readFont ( std::shared_ptr< MWAWStream > &  stream,
MacWrtProStructuresInternal::Font font 
)
protected

try to read a font

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

◆ readFontsDef()

bool MacWrtProStructures::readFontsDef ( std::shared_ptr< MWAWStream > &  stream)
protected

try to read the list of fonts

Referenced by createZones(), and createZonesII().

◆ readFontsName()

bool MacWrtProStructures::readFontsName ( std::shared_ptr< MWAWStream > &  stream)
protected

try to read the fonts zone

Referenced by createZones(), and createZonesII().

◆ readGraphic()

std::shared_ptr< MacWrtProStructuresInternal::Graphic > MacWrtProStructures::readGraphic ( std::shared_ptr< MWAWStream > &  stream)
protected

try to read a graphic entry: 1.0, 1.5

Referenced by readGraphicsList().

◆ readGraphicII()

bool MacWrtProStructures::readGraphicII ( std::shared_ptr< MWAWStream > const &  stream,
int  id,
bool  mainGraphic,
MacWrtProStructuresInternal::Graphic graphic 
)
protected

try to read a graphic structure: II

Referenced by readPageII().

◆ readGraphicsList()

bool MacWrtProStructures::readGraphicsList ( std::shared_ptr< MWAWStream > &  stream,
int  nuumPages 
)
protected

try to read the list of graphic entries: 1.0 1.5

Referenced by createZones().

◆ readPageII()

bool MacWrtProStructures::readPageII ( std::shared_ptr< MWAWStream > const &  stream,
int  wh,
MacWrtProStructuresInternal::Page page 
)
protected

try to read a page entry: II

Referenced by readPagesListII().

◆ readPagesListII()

bool MacWrtProStructures::readPagesListII ( std::shared_ptr< MWAWStream > const &  stream,
int  numPages 
)
protected

try to parse the list of page: II

Referenced by createZonesII().

◆ readParagraph()

bool MacWrtProStructures::readParagraph ( std::shared_ptr< MWAWStream > &  stream,
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 ( std::shared_ptr< MWAWStream > &  stream)
protected

try to read a list of paragraph

Referenced by createZones(), and createZonesII().

◆ readSections()

bool MacWrtProStructures::readSections ( std::shared_ptr< MWAWStream > &  stream,
std::vector< MacWrtProStructuresInternal::Section > &  sections 
)
protected

try to read the section info ?

Referenced by createZones().

◆ readSelection()

bool MacWrtProStructures::readSelection ( std::shared_ptr< MWAWStream > &  stream)
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 
)
staticprotected

try to read a string

Referenced by createZones(), and readGraphicsList().

◆ readStructB()

bool MacWrtProStructures::readStructB ( std::shared_ptr< MWAWStream > &  stream)
protected

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

Referenced by createZones().

◆ readStyle()

bool MacWrtProStructures::readStyle ( std::shared_ptr< MWAWStream > &  stream,
int  styleId 
)
protected

try to read a style

Referenced by readStyles().

◆ readStyles()

bool MacWrtProStructures::readStyles ( std::shared_ptr< MWAWStream > &  stream)
protected

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

Referenced by createZones().

◆ send()

bool MacWrtProStructures::send ( int  graphicId,
bool  mainZone = false 
)
protected

try to send a graphic which corresponds to graphicid

note: graphicId=-noteId to send footnote in MW2

Referenced by flushExtra(), MacWrtProStructuresInternal::Cell::sendContent(), and sendMainZone().

◆ sendMainZone()

bool MacWrtProStructures::sendMainZone ( )
protected

send the main zone

◆ updatePageSpan()

void MacWrtProStructures::updatePageSpan ( int  page,
bool  hasTitlePage,
MWAWPageSpan pageSpan 
)
protected

update the page span

◆ version()

int MacWrtProStructures::version ( ) const

returns the file version.

this version is only correct after the header is parsed

Referenced by createZones(), createZonesII(), flushExtra(), getColor(), getPattern(), readCharStyles(), readFont(), readFontsDef(), readFontsName(), readParagraph(), readParagraphs(), send(), sendMainZone(), and updatePageSpan().

Friends And Related Function Documentation

◆ MacWrtProParser

friend class MacWrtProParser
friend

◆ MacWrtProParserInternal::SubDocument

◆ MacWrtProStructuresInternal::Cell

friend struct MacWrtProStructuresInternal::Cell
friend

◆ MacWrtProStructuresListenerState

friend class MacWrtProStructuresListenerState
friend

Member Data Documentation

◆ m_asciiName

std::string MacWrtProStructures::m_asciiName
protected

the debug file name

◆ m_mainParser

MacWrtProParser& MacWrtProStructures::m_mainParser
protected

◆ m_parserState

MWAWParserStatePtr MacWrtProStructures::m_parserState
protected

◆ m_state


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