the main class to read the structures part of MacWrite Pro file More...
#include <MWProStructures.hxx>
Public Member Functions | |
MWProStructures (MWProParser &mainParser) | |
constructor | |
virtual | ~MWProStructures () |
destructor | |
int | version () const |
returns the file version. | |
void | setAsciiName (char const *name) |
Debugging: change the default ascii file (by default struct ) | |
Protected Member Functions | |
void | init () |
inits all internal variables | |
bool | createZones () |
finds the different objects zones | |
bool | createZonesV2 () |
finds the different objects zones in a MacWriteII file | |
int | numPages () const |
returns the number of pages | |
bool | sendMainZone () |
send the main zone | |
int | getHeaderId (int page, int &numSimillar) const |
return the header blockid ( or 0) | |
int | getFooterId (int page, int &numSimillar) const |
return the footer blockid ( or 0) | |
void | flushExtra () |
flush not send zones | |
void | buildPageStructures () |
look for pages structures | |
void | buildTableStructures () |
look for tables structures and if so, prepare data | |
bool | readStyles () |
try to read the paragraph styles zone which begins at address 0x200 | |
bool | readStyle (int styleId) |
try to read a style | |
bool | readCharStyles () |
try to read the character styles zone | |
bool | readParagraphs () |
try to read a list of paragraph | |
bool | readParagraph (MWProStructuresInternal::Paragraph ¶) |
try to read a paragraph | |
int | getEndBlockSize () |
returns the size of the block end data | |
shared_ptr < MWProStructuresInternal::Block > | readBlock () |
try to read a block entry | |
shared_ptr < MWProStructuresInternal::Block > | readBlockV2 (int id) |
try to read a block entry | |
bool | readBlocksList () |
try to read the list of block entries | |
bool | readFontsName () |
try to read the fonts zone | |
bool | readFontsDef () |
try to read the list of fonts | |
bool | readFont (MWProStructuresInternal::Font &font) |
try to read a font | |
bool | readSections (std::vector< MWProStructuresInternal::Section > §ions) |
try to read the section info ? | |
bool | readSelection () |
try to read a 16 bytes the zone which follow the char styles zone ( the selection?) | |
bool | readStructB () |
try to read a zone which follow the fonts zone(checkme) | |
bool | getColor (int colId, MWAWColor &color) const |
try to return the color corresponding to colId | |
bool | getPattern (int patId, float &patternPercent) const |
try to return the pattern corresponding to patId | |
bool | getColor (int colId, int patId, MWAWColor &color) const |
try to return the color corresponding to colId and patId | |
bool | isSent (int blockId) |
returns true if the block is already sent ( or does not exists) | |
bool | send (int blockId, bool mainZone=false) |
try to send a block which corresponds to blockid | |
MWAWContentListenerPtr & | getListener () |
returns the actual listener | |
libmwaw::DebugFile & | ascii () |
returns the debug file | |
std::string const & | asciiName () const |
return the ascii file name | |
Static Protected Member Functions | |
static bool | readString (MWAWInputStreamPtr input, std::string &res) |
try to read a string | |
Protected Attributes | |
MWAWParserStatePtr | m_parserState |
the parser state | |
MWAWInputStreamPtr | m_input |
the main input | |
MWProParser & | m_mainParser |
the main parser | |
shared_ptr < MWProStructuresInternal::State > | m_state |
the state | |
libmwaw::DebugFile | m_asciiFile |
the debug file | |
std::string | m_asciiName |
the debug file name | |
Friends | |
class | MWProParser |
class | MWProParserInternal::SubDocument |
struct | MWProStructuresInternal::Cell |
class | MWProStructuresListenerState |
the main class to read the structures part of MacWrite Pro file
MWProStructures::MWProStructures | ( | MWProParser & | mainParser | ) |
constructor
MWProStructures::~MWProStructures | ( | ) | [virtual] |
destructor
libmwaw::DebugFile& MWProStructures::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 ~MWProStructures().
std::string const& MWProStructures::asciiName | ( | ) | const [inline, protected] |
return the ascii file name
Referenced by createZones(), and createZonesV2().
void MWProStructures::buildPageStructures | ( | ) | [protected] |
look for pages structures
Referenced by createZones().
void MWProStructures::buildTableStructures | ( | ) | [protected] |
look for tables structures and if so, prepare data
Referenced by createZones().
bool MWProStructures::createZones | ( | ) | [protected] |
finds the different objects zones
bool MWProStructures::createZonesV2 | ( | ) | [protected] |
finds the different objects zones in a MacWriteII file
Referenced by createZones().
void MWProStructures::flushExtra | ( | ) | [protected] |
flush not send zones
bool MWProStructures::getColor | ( | int | colId, |
MWAWColor & | color | ||
) | const [protected] |
try to return the color corresponding to colId
Referenced by getColor(), readBlock(), and readFont().
bool MWProStructures::getColor | ( | int | colId, |
int | patId, | ||
MWAWColor & | color | ||
) | const [protected] |
try to return the color corresponding to colId and patId
int MWProStructures::getEndBlockSize | ( | ) | [protected] |
returns the size of the block end data
Referenced by readBlock(), and readBlocksList().
int MWProStructures::getFooterId | ( | int | page, |
int & | numSimillar | ||
) | const [protected] |
return the footer blockid ( or 0)
int MWProStructures::getHeaderId | ( | int | page, |
int & | numSimillar | ||
) | const [protected] |
return the header blockid ( or 0)
MWAWContentListenerPtr & MWProStructures::getListener | ( | ) | [protected] |
returns the actual listener
bool MWProStructures::getPattern | ( | int | patId, |
float & | patternPercent | ||
) | const [protected] |
try to return the pattern corresponding to patId
Referenced by getColor().
void MWProStructures::init | ( | ) | [protected] |
inits all internal variables
Referenced by MWProStructures().
bool MWProStructures::isSent | ( | int | blockId | ) | [protected] |
returns true if the block is already sent ( or does not exists)
int MWProStructures::numPages | ( | ) | const [protected] |
returns the number of pages
shared_ptr< MWProStructuresInternal::Block > MWProStructures::readBlock | ( | ) | [protected] |
try to read a block entry
Referenced by readBlocksList().
bool MWProStructures::readBlocksList | ( | ) | [protected] |
try to read the list of block entries
Referenced by createZones().
shared_ptr< MWProStructuresInternal::Block > MWProStructures::readBlockV2 | ( | int | id | ) | [protected] |
try to read a block entry
Referenced by createZonesV2().
bool MWProStructures::readCharStyles | ( | ) | [protected] |
try to read the character styles zone
Referenced by createZones(), and createZonesV2().
bool MWProStructures::readFont | ( | MWProStructuresInternal::Font & | font | ) | [protected] |
try to read a font
Referenced by readCharStyles(), readFontsDef(), and readStyle().
bool MWProStructures::readFontsDef | ( | ) | [protected] |
try to read the list of fonts
Referenced by createZones(), and createZonesV2().
bool MWProStructures::readFontsName | ( | ) | [protected] |
try to read the fonts zone
Referenced by createZones(), and createZonesV2().
bool MWProStructures::readParagraph | ( | MWProStructuresInternal::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().
bool MWProStructures::readParagraphs | ( | ) | [protected] |
try to read a list of paragraph
Referenced by createZones(), and createZonesV2().
bool MWProStructures::readSections | ( | std::vector< MWProStructuresInternal::Section > & | sections | ) | [protected] |
try to read the section info ?
Referenced by createZones().
bool MWProStructures::readSelection | ( | ) | [protected] |
try to read a 16 bytes the zone which follow the char styles zone ( the selection?)
Referenced by createZones().
bool MWProStructures::readString | ( | MWAWInputStreamPtr | input, |
std::string & | res | ||
) | [static, protected] |
try to read a string
Referenced by createZones(), and readBlocksList().
bool MWProStructures::readStructB | ( | ) | [protected] |
try to read a zone which follow the fonts zone(checkme)
Referenced by createZones().
bool MWProStructures::readStyle | ( | int | styleId | ) | [protected] |
try to read a style
Referenced by readStyles().
bool MWProStructures::readStyles | ( | ) | [protected] |
try to read the paragraph styles zone which begins at address 0x200
Referenced by createZones().
bool MWProStructures::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(), MWProStructuresInternal::Cell::sendContent(), and sendMainZone().
bool MWProStructures::sendMainZone | ( | ) | [protected] |
send the main zone
void MWProStructures::setAsciiName | ( | char const * | name | ) | [inline] |
Debugging: change the default ascii file (by default struct )
int MWProStructures::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().
friend class MWProParser [friend] |
friend class MWProParserInternal::SubDocument [friend] |
friend struct MWProStructuresInternal::Cell [friend] |
friend class MWProStructuresListenerState [friend] |
libmwaw::DebugFile MWProStructures::m_asciiFile [protected] |
the debug file
Referenced by ascii().
std::string MWProStructures::m_asciiName [protected] |
the debug file name
Referenced by asciiName(), init(), and setAsciiName().
MWAWInputStreamPtr MWProStructures::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().
MWProParser& MWProStructures::m_mainParser [protected] |
the main parser
Referenced by buildPageStructures(), createZones(), createZonesV2(), readBlocksList(), and send().
MWAWParserStatePtr MWProStructures::m_parserState [protected] |
the parser state
Referenced by flushExtra(), getListener(), readCharStyles(), readFontsDef(), readFontsName(), readStyle(), send(), and version().
shared_ptr<MWProStructuresInternal::State> MWProStructures::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().