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... | |
MWAWInputStreamPtr & | getInput () |
returns the actual input More... | |
MWAWParser & | getMainParser () |
returns the main parser More... | |
shared_ptr< MsWksGraph > | getGraphParser () |
returns the graph parser More... | |
shared_ptr< MsWks3Text > | getTextParser3 () |
returns the text parser (for v1-v3 document) More... | |
shared_ptr< MsWks4Text > | getTextParser4 () |
returns the text parser (for v4 document) More... | |
libmwaw::DebugFile & | ascii () |
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< MWAWParserState > | m_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... | |
MWAWParser * | m_parser |
the main parser More... | |
MsWksDocument * | m_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< MsWksGraph > | m_graphParser |
the graph document More... | |
shared_ptr< MsWks3Text > | m_textParser3 |
the text document (for v1-3 document) More... | |
shared_ptr< MsWks4Text > | m_textParser4 |
the text document (for v4 document) More... | |
NewPage | m_newPage |
the new page callback More... | |
Private Member Functions | |
MsWksDocument (MsWksDocument const &orig) | |
MsWksDocument & | operator= (MsWksDocument const &orig) |
Friends | |
class | MsWksDocumentInternal::SubDocument |
class | MsWksParser |
class | MsWks4Zone |
class | MsWksDBParser |
class | MsWksDRParser |
class | MsWksSSParser |
the main class to read/store generic data of a MsWorks document v1-v3
|
protected |
callback used to send a page break
MsWksDocument::MsWksDocument | ( | MWAWInputStreamPtr | input, |
MWAWParser & | parser | ||
) |
constructor
|
virtual |
destructor
|
private |
|
inline |
a DebugFile used to write what we recognize when we parse the document
Referenced by checkHeader3(), MsWksGraph::getEntryPicture(), MsWksGraph::getEntryPictureV1(), MsWksTable::readChart(), readDocumentInfo(), MsWks4Text::readFDP(), MsWks4Text::readFontNames(), readGroupHeaderFooter(), MsWks3Text::readParagraph(), MsWks4Text::readParagraph(), MsWksGraph::readPictureV4(), MsWks4Text::readPLC(), readPrintInfo(), MsWksGraph::readRB(), MsWksTable::readTable(), MsWks4Text::readText(), MsWksGraph::readText(), MsWksGraph::send(), MsWks3Text::sendText(), and MsWks4Text::toknDataParser().
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
|
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().
|
inline |
returns the graph parser
float MsWksDocument::getHeaderFooterHeight | ( | bool | header | ) | const |
returns the header/footer height (found by readGroupHeaderFooter)
|
inline |
returns the actual input
Referenced by checkHeader3(), MsWks3Text::createZones(), MsWksGraph::getEntryPicture(), MsWksGraph::getEntryPictureV1(), getPageSpanList(), readCellInFormula(), MsWksTable::readChart(), readDBNumber(), readDBString(), readDocumentInfo(), MsWks3Text::readFont(), MsWksGraph::readFont(), readFormula(), MsWksGraph::readGradient(), MsWksGraph::readGroup(), readGroupHeaderFooter(), MsWks3Text::readHeaderFooterString(), MsWks3Text::readParagraph(), MsWksGraph::readPictHeader(), readPrintInfo(), MsWksTable::readTable(), MsWksGraph::readText(), readZone(), MsWks3Text::readZoneHeader(), MsWksGraph::send(), MsWksTable::sendChart(), sendFootnote(), MsWksGraph::sendGroup(), MsWksGraph::sendGroupChild(), MsWksGraph::sendObjects(), MsWks3Text::sendText(), and MsWks3Text::updateNotes().
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)
|
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
|
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)
|
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().
|
private |
|
protected |
reads a cell
Referenced by readFormula().
|
protected |
try to read a number
Referenced by readFormula().
|
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().
|
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 | ||
) |
send a textbox
Referenced by MsWksDocumentInternal::SubDocument::parse(), MsWksGraph::sendFrameText(), and sendTextbox().
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().
|
friend |
Referenced by createOLEZones().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
the debug file of the actual input
Referenced by ascii(), and initAsciiFile().
|
protected |
the graph document
Referenced by getGraphParser(), getPageSpanList(), MsWksDocument(), readZone(), sendRBIL(), and sendZone().
|
protected |
the input which can be an OLE in MSWorks 4 file
Referenced by getInput(), and initAsciiFile().
|
protected |
the parent document (if this is not the main document)
Referenced by newPage(), sendFootnote(), sendOLE(), and sendTextbox().
|
protected |
the main parser
Referenced by createOLEZones(), getMainParser(), and newPage().
shared_ptr<MWAWParserState> MsWksDocument::m_parserState |
the parser state
Referenced by createOLEZones(), getPageSpanList(), readDocumentInfo(), readFormula(), readPrintInfo(), sendFootnote(), sendFootnoteContent(), sendOLE(), sendTextbox(), setVersion(), and version().
|
protected |
the state
Referenced by checkHeader3(), createOLEZones(), getEntryMap(), getHeaderFooterHeight(), getKind(), getLengthOfFileHeader3(), getNewZoneId(), getPageSpanList(), getTypeZoneMap(), getUnparsedOLEZones(), getZone(), hasFooter(), hasHeader(), MsWksDocument(), readGroupHeaderFooter(), sendFootnoteContent(), sendOLE(), sendTextbox(), and setKind().
|
protected |
the text document (for v1-3 document)
Referenced by getPageSpanList(), getTextParser3(), and sendText().
|
protected |
the text document (for v4 document)
Referenced by getPageSpanList(), and getTextParser4().