MsWksDocument Class Reference

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

#include <MsWksDocument.hxx>

List of all members.

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

Static Public Member Functions

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

Public Attributes

shared_ptr< MWAWParserStatem_parserState
 the parser state

Protected Types

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

Protected Member Functions

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

Protected Attributes

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

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

constructor

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)

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)

returns the document's kind

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

returns the main parser

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

returns the text parser (for v1-v3 document)

Referenced by readDocumentInfo(), and readGroupHeaderFooter().

returns the text parser (for v4 document)

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

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

read the print info zone (v1-v3)

Referenced by readDocumentInfo().

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

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 MsWksDocumentInternal::SubDocument [friend]
friend class MsWksDRParser [friend]
friend class MsWksParser [friend]
friend class MsWksSSParser [friend]

Member Data Documentation

the debug file of the actual input

Referenced by ascii(), and initAsciiFile().

the input which can be an OLE in MSWorks 4 file

Referenced by getInput(), and initAsciiFile().

the new page callback

Referenced by newPage().

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

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

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: