MsWksDocument Class Reference

the main class to read/store generic data of a MsWorks document v1-v3 More...

#include <MsWksDocument.hxx>

Classes

struct  Zone
 a zone of a MsWksDocument ( main, header, footer ) More...
 

Public Types

enum  ZoneType { Z_MAIN, Z_HEADER, Z_FOOTER, Z_NONE }
 the different type of zone (v1-v3) More...
 

Public Member Functions

 MsWksDocument (MWAWInputStreamPtr input, MWAWParser &parser)
 constructor More...
 
virtual ~MsWksDocument ()
 destructor More...
 
int version () const
 returns the document's version More...
 
void setVersion (int vers)
 sets the document's version More...
 
MWAWDocument::Kind getKind () const
 returns the document's kind More...
 
void setKind (MWAWDocument::Kind kind)
 sets the document's kind More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWParsergetMainParser ()
 returns the main parser More...
 
shared_ptr< MsWksGraphgetGraphParser ()
 returns the graph parser More...
 
shared_ptr< MsWks3TextgetTextParser3 ()
 returns the text parser (for v1-v3 document) More...
 
shared_ptr< MsWks4TextgetTextParser4 ()
 returns the text parser (for v4 document) More...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 
bool checkHeader3 (MWAWHeader *header, bool strict=false)
 checks if the file header corresponds to a v1-v3 document (or not) More...
 
long getLengthOfFileHeader3 () const
 returns the length of the file header of a v1-v3 document (if know) More...
 
bool readPrintInfo ()
 read the print info zone (v1-v3) More...
 
bool readDocumentInfo (long sz=-1)
 try to read the documentinfo ( v1-v3) More...
 
bool readZone (Zone &zone)
 try to read a generic zone More...
 
bool readGroupHeaderFooter (bool header, int check)
 try to read a header/footer group More...
 
bool createOLEZones (MWAWInputStreamPtr input)
 finds the different OLE zones More...
 
std::vector< std::string > const & getUnparsedOLEZones () const
 returns the list of unparsed OLE zones More...
 
bool hasHeader () const
 returns true if the document has some header ( found by checkHeader3) More...
 
bool hasFooter () const
 returns true if the document has some footer ( found by checkHeader3) More...
 
float getHeaderFooterHeight (bool header) const
 returns the header/footer height (found by readGroupHeaderFooter) More...
 
void getPageSpanList (std::vector< MWAWPageSpan > &pagesList, int &numPages)
 get the page span list and the number of page for a v1-v3 document More...
 
std::multimap< int, Zone > & getTypeZoneMap ()
 returns the document entry map of a v1-v3 document More...
 
Zone getZone (ZoneType type) const
 returns the zone corresponding to a zoneType (v1-v3 document) More...
 
int getNewZoneId () const
 returns a free zone'id More...
 
std::multimap< std::string,
MWAWEntry > & 
getEntryMap ()
 returns the document entry map of a v4 document More...
 
void sendZone (int zoneType)
 try to send a zone (v1-v3 document) More...
 
void newPage (int page, bool softBreak=false)
 tries to create a new page More...
 
void sendFootnoteContent (int noteId)
 try to send a footnote content (v4 document) More...
 
void sendFootnote (int id)
 tries to send a footnote More...
 
void sendText (int id)
 try to send a text zone (v1-v3 document) More...
 
void sendOLE (int id, MWAWPosition const &pos, MWAWGraphicStyle const &style)
 send an OLE zone More...
 
void sendRBIL (int id, MWAWVec2i const &sz)
 send a rbil zone More...
 
void sendTextbox (MWAWEntry const &entry, std::string const &frame)
 send a textbox More...
 

Static Public Member Functions

static bool getColor (int id, MWAWColor &col, int vers)
 returns the color which correspond to an index More...
 
static std::vector< MWAWColor >
const & 
getPalette (int vers)
 returns a list of color corresponding to a version More...
 

Public Attributes

shared_ptr< MWAWParserStatem_parserState
 the parser state More...
 

Protected Types

typedef void(MWAWParser::* NewPage )(int page, bool softBreak)
 callback used to send a page break More...
 

Protected Member Functions

bool readCellInFormula (MWAWCellContent::FormulaInstruction &instr, bool is2D)
 reads a cell More...
 
bool readDBString (long endPos, std::string &res)
 try to read a string More...
 
bool readDBNumber (long endPos, double &res, bool &isNan, std::string &str)
 try to read a number More...
 
bool readFormula (long endPos, MWAWCellContent &content, std::string &extra)
 
void initAsciiFile (std::string const &name)
 inits the ascii file More...
 

Protected Attributes

shared_ptr
< MsWksDocumentInternal::State
m_state
 the state More...
 
MWAWParserm_parser
 the main parser More...
 
MsWksDocumentm_parentDocument
 the parent document (if this is not the main document) More...
 
MWAWInputStreamPtr m_input
 the input which can be an OLE in MSWorks 4 file More...
 
libmwaw::DebugFile m_asciiFile
 the debug file of the actual input More...
 
shared_ptr< MsWksGraphm_graphParser
 the graph document More...
 
shared_ptr< MsWks3Textm_textParser3
 the text document (for v1-3 document) More...
 
shared_ptr< MsWks4Textm_textParser4
 the text document (for v4 document) More...
 
NewPage m_newPage
 the new page callback More...
 

Private Member Functions

 MsWksDocument (MsWksDocument const &orig)
 
MsWksDocumentoperator= (MsWksDocument const &orig)
 

Friends

class MsWksDocumentInternal::SubDocument
 
class MsWksParser
 
class MsWks4Zone
 
class MsWksDBParser
 
class MsWksDRParser
 
class MsWksSSParser
 

Detailed Description

the main class to read/store generic data of a MsWorks document v1-v3

Member Typedef Documentation

typedef void(MWAWParser::* MsWksDocument::NewPage)(int page, bool softBreak)
protected

callback used to send a page break

Member Enumeration Documentation

the different type of zone (v1-v3)

Enumerator
Z_MAIN 
Z_HEADER 
Z_FOOTER 
Z_NONE 

Constructor & Destructor Documentation

MsWksDocument::MsWksDocument ( MWAWInputStreamPtr  input,
MWAWParser parser 
)

constructor

MsWksDocument::~MsWksDocument ( )
virtual

destructor

MsWksDocument::MsWksDocument ( MsWksDocument const &  orig)
private

Member Function Documentation

bool MsWksDocument::checkHeader3 ( MWAWHeader header,
bool  strict = false 
)

checks if the file header corresponds to a v1-v3 document (or not)

bool MsWksDocument::createOLEZones ( MWAWInputStreamPtr  input)

finds the different OLE zones

bool MsWksDocument::getColor ( int  id,
MWAWColor col,
int  vers 
)
static

returns the color which correspond to an index

Referenced by MsWks3Text::readFont(), MsWksGraph::readPictHeader(), and MsWksTable::readTable().

std::multimap< std::string, MWAWEntry > & MsWksDocument::getEntryMap ( )

returns the document entry map of a v4 document

Referenced by MsWks4Text::findFDPStructures(), MsWks4Text::findFDPStructuresByHand(), and MsWks4Text::readStructures().

shared_ptr<MsWksGraph> MsWksDocument::getGraphParser ( )
inline

returns the graph parser

float MsWksDocument::getHeaderFooterHeight ( bool  header) const

returns the header/footer height (found by readGroupHeaderFooter)

MWAWDocument::Kind MsWksDocument::getKind ( ) const

returns the document's kind

long MsWksDocument::getLengthOfFileHeader3 ( ) const

returns the length of the file header of a v1-v3 document (if know)

MWAWParser& MsWksDocument::getMainParser ( )
inline

returns the main parser

int MsWksDocument::getNewZoneId ( ) const

returns a free zone'id

void MsWksDocument::getPageSpanList ( std::vector< MWAWPageSpan > &  pagesList,
int &  numPages 
)

get the page span list and the number of page for a v1-v3 document

std::vector< MWAWColor > const & MsWksDocument::getPalette ( int  vers)
static

returns a list of color corresponding to a version

Referenced by getColor(), and MsWksGraph::send().

shared_ptr< MsWks3Text > MsWksDocument::getTextParser3 ( )

returns the text parser (for v1-v3 document)

Referenced by readDocumentInfo(), and readGroupHeaderFooter().

shared_ptr< MsWks4Text > MsWksDocument::getTextParser4 ( )

returns the text parser (for v4 document)

std::multimap< int, MsWksDocument::Zone > & MsWksDocument::getTypeZoneMap ( )

returns the document entry map of a v1-v3 document

Referenced by readGroupHeaderFooter().

std::vector< std::string > const & MsWksDocument::getUnparsedOLEZones ( ) const

returns the list of unparsed OLE zones

MsWksDocument::Zone MsWksDocument::getZone ( MsWksDocument::ZoneType  type) const

returns the zone corresponding to a zoneType (v1-v3 document)

Referenced by getPageSpanList(), and sendZone().

bool MsWksDocument::hasFooter ( ) const

returns true if the document has some footer ( found by checkHeader3)

bool MsWksDocument::hasHeader ( ) const

returns true if the document has some header ( found by checkHeader3)

void MsWksDocument::initAsciiFile ( std::string const &  name)
protected

inits the ascii file

void MsWksDocument::newPage ( int  page,
bool  softBreak = false 
)

tries to create a new page

Referenced by newPage(), MsWks4Text::readText(), and MsWks3Text::send().

MsWksDocument& MsWksDocument::operator= ( MsWksDocument const &  orig)
private
bool MsWksDocument::readCellInFormula ( MWAWCellContent::FormulaInstruction instr,
bool  is2D 
)
protected

reads a cell

Referenced by readFormula().

bool MsWksDocument::readDBNumber ( long  endPos,
double &  res,
bool &  isNan,
std::string &  str 
)
protected

try to read a number

Referenced by readFormula().

bool MsWksDocument::readDBString ( long  endPos,
std::string &  res 
)
protected

try to read a string

Referenced by readDBNumber().

bool MsWksDocument::readDocumentInfo ( long  sz = -1)

try to read the documentinfo ( v1-v3)

Referenced by readZone().

bool MsWksDocument::readFormula ( long  endPos,
MWAWCellContent content,
std::string &  extra 
)
protected
bool MsWksDocument::readGroupHeaderFooter ( bool  header,
int  check 
)

try to read a header/footer group

bool MsWksDocument::readPrintInfo ( )

read the print info zone (v1-v3)

Referenced by readDocumentInfo().

bool MsWksDocument::readZone ( MsWksDocument::Zone zone)

try to read a generic zone

Referenced by readGroupHeaderFooter().

void MsWksDocument::sendFootnote ( int  id)

tries to send a footnote

Referenced by MsWks4Text::readText(), and sendFootnote().

void MsWksDocument::sendFootnoteContent ( int  noteId)

try to send a footnote content (v4 document)

Referenced by MsWksDocumentInternal::SubDocument::parse().

void MsWksDocument::sendOLE ( int  id,
MWAWPosition const &  pos,
MWAWGraphicStyle const &  style 
)

send an OLE zone

Referenced by MsWksGraph::send(), and sendOLE().

void MsWksDocument::sendRBIL ( int  id,
MWAWVec2i const &  sz 
)

send a rbil zone

Referenced by MsWks4Text::readText().

void MsWksDocument::sendText ( int  id)

try to send a text zone (v1-v3 document)

Referenced by MsWksDocumentInternal::SubDocument::parse(), and sendZone().

void MsWksDocument::sendTextbox ( MWAWEntry const &  entry,
std::string const &  frame 
)
void MsWksDocument::sendZone ( int  zoneType)

try to send a zone (v1-v3 document)

Referenced by MsWksDocumentInternal::SubDocument::parse().

void MsWksDocument::setKind ( MWAWDocument::Kind  kind)

sets the document's kind

void MsWksDocument::setVersion ( int  vers)

sets the document's version

Referenced by checkHeader3().

int MsWksDocument::version ( ) const

returns the document's version

Referenced by checkHeader3(), readDocumentInfo(), and readGroupHeaderFooter().

Friends And Related Function Documentation

friend class MsWks4Zone
friend

Referenced by createOLEZones().

friend class MsWksDBParser
friend
friend class MsWksDRParser
friend
friend class MsWksParser
friend
friend class MsWksSSParser
friend

Member Data Documentation

libmwaw::DebugFile MsWksDocument::m_asciiFile
protected

the debug file of the actual input

Referenced by ascii(), and initAsciiFile().

shared_ptr<MsWksGraph> MsWksDocument::m_graphParser
protected
MWAWInputStreamPtr MsWksDocument::m_input
protected

the input which can be an OLE in MSWorks 4 file

Referenced by getInput(), and initAsciiFile().

NewPage MsWksDocument::m_newPage
protected

the new page callback

Referenced by newPage().

MsWksDocument* MsWksDocument::m_parentDocument
protected

the parent document (if this is not the main document)

Referenced by newPage(), sendFootnote(), sendOLE(), and sendTextbox().

MWAWParser* MsWksDocument::m_parser
protected

the main parser

Referenced by createOLEZones(), getMainParser(), and newPage().

shared_ptr<MsWks3Text> MsWksDocument::m_textParser3
protected

the text document (for v1-3 document)

Referenced by getPageSpanList(), getTextParser3(), and sendText().

shared_ptr<MsWks4Text> MsWksDocument::m_textParser4
protected

the text document (for v4 document)

Referenced by getPageSpanList(), and getTextParser4().


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

Generated on Thu Jul 9 2015 20:26:38 for libmwaw by doxygen 1.8.8