ClarisWksDocument Class Reference documentation

Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
ClarisWksDocument Class Reference

main document information used to create a ClarisWorks file More...

`#include <ClarisWksDocument.hxx>`

## Public Member Functions
| ClarisWksDocument (MWAWParser &parser)
| constructor More...
| ~ClarisWksDocument ()
| virtual destructor More...
bool | checkHeader (MWAWHeader *header, bool strict=false)
| checks if the document header is correct (or not) More...
bool | createZones ()
| finds the different objects zones More...
int | numPages () const
| returns the document number of page More...
MWAWVec2i | getDocumentPages ()
| returns the number of expected pages ( accross pages x down page) More...
librevenge::RVNGPropertyList const & | getDocumentMetaData () const
| returns the document meta data More...
double | getTextHeight () const
| returns the page height, ie. paper size less margin (in inches) less header/footer size More...
MWAWVec2f | getPageLeftTop () const
| returns the page left top point ( in inches) More...
void | updatePageSpanList (std::vector< MWAWPageSpan > &spanList)
| updates the page span list More...
void | updatePageSpanList (std::vector< MWAWPageSpan > &spanList, MWAWPageSpan &master)
| updates the page span list (and returns a master page) More...
MWAWSection | getMainSection () const
| returns the main document section More...
std::shared_ptr< ClarisWksStruct::DSET > | getZone (int zId) const
| return the zone corresponding to an id ( low level) More...
void | updateChildPositions ()
| try to update the child page of each zone More...
void | newPage (int page, bool softBreak=false)
| send a page break More...
std::vector< int > const & | getMainZonesList () const
| returns the list of the main zones More...
void | forceParsed (int zoneId)
| indicates that a zone is parser More...
bool | canSendZoneAsGraphic (int number) const
| check if we can send a zone as a graphic More...
bool | sendZone (int zoneId, MWAWListenerPtr listener=MWAWListenerPtr(), MWAWPosition pos=MWAWPosition())
| try to send a zone More...
bool | sendDatabasePictZone (int pictId, MWAWListenerPtr listener=MWAWListenerPtr(), MWAWPosition pos=MWAWPosition())
| try to send a database picture More...
void | sendFootnote (int zoneId)
| ask the main parser to create a document to send a footnote More...
MWAWParser & | getMainParser ()
| returns the main parser More...
std::shared_ptr< ClarisWksStyleManager > | getStyleManager ()
| returns the style manager More...
std::shared_ptr< ClarisWksDatabase > | getDatabaseParser ()
| returns the database parser More...
std::shared_ptr< ClarisWksGraph > | getGraphParser ()
| returns the graph parser More...
std::shared_ptr< ClarisWksPresentation > | getPresentationParser ()
| returns the presentation parser More...
std::shared_ptr< ClarisWksSpreadsheet > | getSpreadsheetParser ()
| returns the spreadsheet parser More...
std::shared_ptr< ClarisWksTable > | getTableParser ()
| returns the table parser More...
std::shared_ptr< ClarisWksText > | getTextParser ()
| returns the text parser More...
bool | readZone ()
| read a zone More...
bool | readDocHeader ()
| reads the document header More...
bool | readDocInfo ()
| reads the document info part ( end of the header) More...
bool | readPrintInfo ()
| read the print info zone More...
bool | readEndTable (long &eof)
| reads the end table ( appears in v3.0 : file version ? ) More...
bool | readCPRT (MWAWEntry const &entry)
bool | readMARKList (MWAWEntry const &entry)
bool | readURL (long endPos)
bool | readBookmark (long endPos)
bool | readDocumentMark (long endPos)
bool | readEndMark (long endPos)
bool | readDSUM (MWAWEntry const &entry, bool inHeader)
bool | readSNAP (MWAWEntry const &entry)
bool | readTNAM (MWAWEntry const &entry)
std::shared_ptr< ClarisWksStruct::DSET > | readDSET (bool &complete)
| reads the zone DSET More...
void | typeMainZones ()
| try to type the main zones More...
int | typeMainZonesRec (int zId, ClarisWksStruct::DSET::Position type, int maxHeight)
| try to type the main zones recursif, returns the father id More...
bool | exploreZonesGraph ()
| try to find the zone dags structure... More...
bool | exploreZonesGraphRec (int zId, std::set< int > &notDoneList)
| try to find the zone tree graph ( DSF) function More...
void | cleanZonesGraph ()
| remove uneeded edge (mainly header/footer edges in main graph) More...
bool | readStructCellZone (char const *zoneName, bool hasEntete, std::vector< MWAWVec2i > &res)
| try to read a structured zone list of cells More...
bool | readStringList (char const *zoneName, bool hasEntete, std::vector< std::string > &res)
bool | readDataLinkList ()
| try to read a structured zone list of picture definition: v5-v6 More...
bool | readZoneA ()
| try to read a unknown zone which appear to be filled at least in some v2 database file More...
void | checkOrdering (std::vector< int16_t > &vec16, std::vector< int32_t > &vec32) const
| small fonction used to check unusual endian ordering of a list of int16_t, int32_t More...

## Public Attributes
std::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...
typedef void(MWAWParser::* | SendFootnote) (int zoneId)
| callback used to send a footnote More...

## Protected Member Functions
MWAWPageSpan | getFinalPageSpan () const
| returns the final page span to use for the document More...

## Protected Attributes
std::shared_ptr< ClarisWksDocumentInternal::State > | m_state
| the state More...
MWAWParser * | m_parser
| the main parser More...
std::shared_ptr< ClarisWksStyleManager > | m_styleManager
| the style manager More...
std::shared_ptr< ClarisWksDatabase > | m_databaseParser
| the database parser More...
std::shared_ptr< ClarisWksGraph > | m_graphParser
| the graph parser More...
std::shared_ptr< ClarisWksPresentation > | m_presentationParser
| the spreadsheet parser More...
std::shared_ptr< ClarisWksSpreadsheet > | m_spreadsheetParser
| the spreadsheet parser More...
std::shared_ptr< ClarisWksTable > | m_tableParser
| the table parser More...
std::shared_ptr< ClarisWksText > | m_textParser
| the text parser More...
NewPage | m_newPage
| the new page callback More...
SendFootnote | m_sendFootnote
| the send footnote callback More...

## Private Member Functions
| ClarisWksDocument (ClarisWksDocument const &orig)=delete
ClarisWksDocument | operator= (ClarisWksDocument const &orig)=delete

## Friends
class | ClarisWksParser
class | ClarisWksBMParser
class | ClarisWksPRParser
class | ClarisWksSSParser
class | ClarisWksDocumentInternal::SubDocument

## Detailed Description

main document information used to create a ClarisWorks file

## Member Typedef Documentation

## ◆ NewPage

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

callback used to send a page break

## ◆ SendFootnote

typedef void(MWAWParser::* ClarisWksDocument::SendFootnote) (int zoneId)
| protected

callback used to send a footnote

## Constructor & Destructor Documentation

## ◆ ClarisWksDocument() [1/2]

ClarisWksDocument::ClarisWksDocument | ( | MWAWParser & | parser | ) |
| explicit

constructor

## ◆ ~ClarisWksDocument()

ClarisWksDocument::~ClarisWksDocument | ( |  | ) |

virtual destructor

## ◆ ClarisWksDocument() [2/2]

ClarisWksDocument::ClarisWksDocument | ( | ClarisWksDocument const & | orig | ) |
| privatedelete

## Member Function Documentation

## ◆ canSendZoneAsGraphic()

bool ClarisWksDocument::canSendZoneAsGraphic | ( | int | number | ) | const

check if we can send a zone as a graphic

Referenced by ClarisWksGraph::canSendAsGraphic(), ClarisWksGraph::sendGroup(), and ClarisWksGraph::sendGroupChild().

## ◆ checkHeader()

bool ClarisWksDocument::checkHeader | ( | MWAWHeader * | header,
|  | bool | strict = `false`
| ) |  |

checks if the document header is correct (or not)

## ◆ checkOrdering()

void ClarisWksDocument::checkOrdering | ( | std::vector< int16_t > & | vec16,
|  | std::vector< int32_t > & | vec32
| ) |  | const

small fonction used to check unusual endian ordering of a list of int16_t, int32_t

Referenced by ClarisWksStyleManager::readGraphStyles(), and ClarisWksGraph::readGroupUnknown().

## ◆ cleanZonesGraph()

void ClarisWksDocument::cleanZonesGraph | ( |  | ) |

remove uneeded edge (mainly header/footer edges in main graph)

Referenced by createZones().

## ◆ createZones()

bool ClarisWksDocument::createZones | ( |  | ) |

finds the different objects zones

## ◆ exploreZonesGraph()

bool ClarisWksDocument::exploreZonesGraph | ( |  | ) |

try to find the zone dags structure...

Referenced by createZones().

## ◆ exploreZonesGraphRec()

bool ClarisWksDocument::exploreZonesGraphRec | ( | int | zId,
|  | std::set< int > & | notDoneList
| ) |  |

try to find the zone tree graph ( DSF) function

Referenced by exploreZonesGraph().

## ◆ forceParsed()

void ClarisWksDocument::forceParsed | ( | int | zoneId | ) |

indicates that a zone is parser

Referenced by ClarisWksTable::sendZone(), and ClarisWksPresentation::sendZone().

## ◆ getDatabaseParser()

std::shared_ptr<ClarisWksDatabase> ClarisWksDocument::getDatabaseParser | ( |  | ) |
| inline

returns the database parser

Referenced by readDSET(), and sendZone().

## ◆ getDocumentMetaData()

librevenge::RVNGPropertyList const & ClarisWksDocument::getDocumentMetaData | ( |  | ) | const

returns the document meta data

## ◆ getDocumentPages()

MWAWVec2i ClarisWksDocument::getDocumentPages | ( |  | ) |

returns the number of expected pages ( accross pages x down page)

Referenced by updateChildPositions().

## ◆ getFinalPageSpan()

MWAWPageSpan ClarisWksDocument::getFinalPageSpan | ( |  | ) | const
| protected

returns the final page span to use for the document

Referenced by updatePageSpanList().

## ◆ getGraphParser()

std::shared_ptr<ClarisWksGraph> ClarisWksDocument::getGraphParser | ( |  | ) |
| inline

returns the graph parser

Referenced by readDocHeader(), readDSET(), sendDatabasePictZone(), and sendZone().

## ◆ getMainParser()

MWAWParser& ClarisWksDocument::getMainParser | ( |  | ) |
| inline

returns the main parser

## ◆ getMainSection()

MWAWSection ClarisWksDocument::getMainSection | ( |  | ) | const

returns the main document section

Referenced by ClarisWksText::sendText().

## ◆ getMainZonesList()

std::vector< int > const & ClarisWksDocument::getMainZonesList | ( |  | ) | const

returns the list of the main zones

Referenced by createZones().

## ◆ getPageLeftTop()

MWAWVec2f ClarisWksDocument::getPageLeftTop | ( |  | ) | const

returns the page left top point ( in inches)

Referenced by ClarisWksGraph::sendGroup(), and ClarisWksGraph::sendPageChild().

## ◆ getPresentationParser()

std::shared_ptr<ClarisWksPresentation> ClarisWksDocument::getPresentationParser | ( |  | ) |
| inline

returns the presentation parser

Referenced by readDSET(), sendZone(), and typeMainZones().

## ◆ getSpreadsheetParser()

std::shared_ptr<ClarisWksSpreadsheet> ClarisWksDocument::getSpreadsheetParser | ( |  | ) |
| inline

returns the spreadsheet parser

Referenced by readDSET(), and sendZone().

## ◆ getStyleManager()

std::shared_ptr<ClarisWksStyleManager> ClarisWksDocument::getStyleManager | ( |  | ) |
| inline

returns the style manager

Referenced by readDocHeader(), ClarisWksText::readFonts(), ClarisWksGraph::readGroupDef(), ClarisWksText::readParagraphs(), ClarisWksDbaseContent::readRecordDB(), ClarisWksDbaseContent::readRecordSS(), ClarisWksDbaseContent::readRecordSSV1(), ClarisWksTable::readTableBorders(), ClarisWksTable::readTableCells(), and ClarisWksText::sendText().

## ◆ getTableParser()

std::shared_ptr<ClarisWksTable> ClarisWksDocument::getTableParser | ( |  | ) |
| inline

returns the table parser

Referenced by readDSET(), and sendZone().

## ◆ getTextHeight()

double ClarisWksDocument::getTextHeight | ( |  | ) | const

returns the page height, ie. paper size less margin (in inches) less header/footer size

Referenced by updateChildPositions().

## ◆ getTextParser()

std::shared_ptr<ClarisWksText> ClarisWksDocument::getTextParser | ( |  | ) |
| inline

returns the text parser

Referenced by readDocHeader(), readDSET(), ClarisWksStyleManager::readGenStyle(), and sendZone().

## ◆ getZone()

std::shared_ptr< ClarisWksStruct::DSET > ClarisWksDocument::getZone | ( | int | zId | ) | const

return the zone corresponding to an id ( low level)

Referenced by canSendZoneAsGraphic(), cleanZonesGraph(), ClarisWksPresentation::disconnectMasterFromContents(), exploreZonesGraphRec(), ClarisWksGraph::findMasterPage(), forceParsed(), ClarisWksGraph::sendGroup(), ClarisWksGraph::sendGroupChild(), ClarisWksGraph::sendMaster(), ClarisWksGraph::sendPageChild(), ClarisWksPresentation::sendZone(), sendZone(), typeMainZones(), typeMainZonesRec(), ClarisWksGraph::updateGroup(), and ClarisWksPresentation::updateSlideTypes().

## ◆ newPage()

void ClarisWksDocument::newPage | ( | int | page,
|  | bool | softBreak = `false`
| ) |  |

send a page break

Referenced by ClarisWksText::sendText().

## ◆ numPages()

int ClarisWksDocument::numPages | ( |  | ) | const

returns the document number of page

Referenced by ClarisWksText::updatePageSpanList(), and updatePageSpanList().

## ◆ operator=()

ClarisWksDocument ClarisWksDocument::operator= | ( | ClarisWksDocument const & | orig | ) |
| privatedelete

## ◆ readBookmark()

bool ClarisWksDocument::readBookmark | ( | long | endPos | ) |

Referenced by readMARKList().

## ◆ readCPRT()

bool ClarisWksDocument::readCPRT | ( | MWAWEntry const & | entry | ) |

Referenced by readEndTable().

## ◆ readDataLinkList()

bool ClarisWksDocument::readDataLinkList | ( |  | ) |

try to read a structured zone list of picture definition: v5-v6

Referenced by readDocHeader().

## ◆ readDocHeader()

bool ClarisWksDocument::readDocHeader | ( |  | ) |

reads the document header

Referenced by createZones().

## ◆ readDocInfo()

bool ClarisWksDocument::readDocInfo | ( |  | ) |

reads the document info part ( end of the header)

Referenced by createZones().

## ◆ readDocumentMark()

bool ClarisWksDocument::readDocumentMark | ( | long | endPos | ) |

Referenced by readMARKList().

## ◆ readDSET()

std::shared_ptr< ClarisWksStruct::DSET > ClarisWksDocument::readDSET | ( | bool & | complete | ) |

reads the zone DSET

Note
  set complete to true if we read all the zone

Referenced by readZone().

## ◆ readDSUM()

bool ClarisWksDocument::readDSUM | ( | MWAWEntry const & | entry,
|  | bool | inHeader
| ) |  |

Referenced by readDocHeader(), and readEndTable().

## ◆ readEndMark()

bool ClarisWksDocument::readEndMark | ( | long | endPos | ) |

Referenced by readBookmark(), readDocumentMark(), and readURL().

## ◆ readEndTable()

bool ClarisWksDocument::readEndTable | ( | long & | eof | ) |

reads the end table ( appears in v3.0 : file version ? )

Referenced by createZones().

## ◆ readMARKList()

bool ClarisWksDocument::readMARKList | ( | MWAWEntry const & | entry | ) |

Referenced by readEndTable().

## ◆ readPrintInfo()

bool ClarisWksDocument::readPrintInfo | ( |  | ) |

read the print info zone

Referenced by readDocHeader().

## ◆ readSNAP()

bool ClarisWksDocument::readSNAP | ( | MWAWEntry const & | entry | ) |

Referenced by readEndTable().

## ◆ readStringList()

bool ClarisWksDocument::readStringList | ( | char const * | zoneName,
|  | bool | hasEntete,
|  | std::vector< std::string > & | res
| ) |  |

Referenced by ClarisWksGraph::readChartData().

## ◆ readStructCellZone()

bool ClarisWksDocument::readStructCellZone | ( | char const * | zoneName,
|  | bool | hasEntete,
|  | std::vector< MWAWVec2i > & | res
| ) |  |

try to read a structured zone list of cells

## ◆ readTNAM()

bool ClarisWksDocument::readTNAM | ( | MWAWEntry const & | entry | ) |

Referenced by readEndTable().

## ◆ readURL()

bool ClarisWksDocument::readURL | ( | long | endPos | ) |

Referenced by readMARKList().

## ◆ readZone()

bool ClarisWksDocument::readZone | ( |  | ) |

read a zone

Referenced by createZones().

## ◆ readZoneA()

bool ClarisWksDocument::readZoneA | ( |  | ) |

try to read a unknown zone which appear to be filled at least in some v2 database file

Referenced by readDocHeader().

## ◆ sendDatabasePictZone()

bool ClarisWksDocument::sendDatabasePictZone | ( | int | pictId,
|  | MWAWListenerPtr | listener = `MWAWListenerPtr()`,
|  | MWAWPosition | pos = `MWAWPosition()`
| ) |  |

try to send a database picture

Referenced by ClarisWksDatabase::sendDatabase().

## ◆ sendFootnote()

void ClarisWksDocument::sendFootnote | ( | int | zoneId | ) |

ask the main parser to create a document to send a footnote

Referenced by ClarisWksText::sendText().

## ◆ sendZone()

bool ClarisWksDocument::sendZone | ( | int | zoneId,
|  | MWAWListenerPtr | listener = `MWAWListenerPtr()`,
|  | MWAWPosition | pos = `MWAWPosition()`
| ) |  |

try to send a zone

Referenced by ClarisWksTable::askMainToSendZone(), ClarisWksPresentation::askToSend(), ClarisWksGraph::askToSend(), ClarisWksDocumentInternal::SubDocument::parse(), ClarisWksTextInternal::SubDocument::parse(), ClarisWksGraph::sendGroup(), ClarisWksGraph::sendGroupChild(), ClarisWksPresentation::sendMaster(), ClarisWksText::sendText(), and ClarisWksPresentation::sendZone().

## ◆ typeMainZones()

void ClarisWksDocument::typeMainZones | ( |  | ) |

try to type the main zones

Referenced by createZones().

## ◆ typeMainZonesRec()

int ClarisWksDocument::typeMainZonesRec | ( | int | zId,
|  | ClarisWksStruct::DSET::Position | type,
|  | int | maxHeight
| ) |  |

try to type the main zones recursif, returns the father id

Referenced by typeMainZones().

## ◆ updateChildPositions()

void ClarisWksDocument::updateChildPositions | ( |  | ) |

try to update the child page of each zone

Referenced by createZones().

## ◆ updatePageSpanList() [1/2]

void ClarisWksDocument::updatePageSpanList | ( | std::vector< MWAWPageSpan > & | spanList | ) |

updates the page span list

## ◆ updatePageSpanList() [2/2]

void ClarisWksDocument::updatePageSpanList | ( | std::vector< MWAWPageSpan > & | spanList,
|  | MWAWPageSpan & | master
| ) |  |

updates the page span list (and returns a master page)

## Friends And Related Function Documentation

## ◆ ClarisWksBMParser

friend class ClarisWksBMParser
| friend

## ◆ ClarisWksDocumentInternal::SubDocument

friend class ClarisWksDocumentInternal::SubDocument
| friend

## ◆ ClarisWksParser

friend class ClarisWksParser
| friend

## ◆ ClarisWksPRParser

friend class ClarisWksPRParser
| friend

## ◆ ClarisWksSSParser

friend class ClarisWksSSParser
| friend

## Member Data Documentation

## ◆ m_databaseParser

std::shared_ptr<ClarisWksDatabase> ClarisWksDocument::m_databaseParser
| protected

the database parser

Referenced by canSendZoneAsGraphic(), ClarisWksDocument(), getDatabaseParser(), and numPages().

## ◆ m_graphParser

std::shared_ptr<ClarisWksGraph> ClarisWksDocument::m_graphParser
| protected

the graph parser

Referenced by canSendZoneAsGraphic(), ClarisWksDocument(), cleanZonesGraph(), getGraphParser(), numPages(), and updateChildPositions().

## ◆ m_newPage

NewPage ClarisWksDocument::m_newPage
| protected

the new page callback

Referenced by newPage().

## ◆ m_parser

MWAWParser* ClarisWksDocument::m_parser
| protected

the main parser

Referenced by getDocumentPages(), getMainParser(), newPage(), readDocHeader(), readPrintInfo(), sendFootnote(), and updateChildPositions().

## ◆ m_parserState

std::shared_ptr<MWAWParserState> ClarisWksDocument::m_parserState

the parser state

Referenced by checkHeader(), checkOrdering(), ClarisWksDocument(), cleanZonesGraph(), createZones(), getDocumentPages(), getFinalPageSpan(), getMainSection(), getPageLeftTop(), getTextHeight(), readBookmark(), readCPRT(), readDataLinkList(), readDocHeader(), readDocInfo(), readDocumentMark(), readDSET(), readDSUM(), readEndMark(), readEndTable(), readMARKList(), readPrintInfo(), readSNAP(), readStringList(), readStructCellZone(), readTNAM(), readURL(), readZone(), readZoneA(), sendZone(), typeMainZones(), updateChildPositions(), and updatePageSpanList().

## ◆ m_presentationParser

std::shared_ptr<ClarisWksPresentation> ClarisWksDocument::m_presentationParser
| protected

the spreadsheet parser

Referenced by ClarisWksDocument(), cleanZonesGraph(), getPresentationParser(), numPages(), and updatePageSpanList().

## ◆ m_sendFootnote

SendFootnote ClarisWksDocument::m_sendFootnote
| protected

the send footnote callback

Referenced by sendFootnote().

## ◆ m_spreadsheetParser

std::shared_ptr<ClarisWksSpreadsheet> ClarisWksDocument::m_spreadsheetParser
| protected

the spreadsheet parser

Referenced by canSendZoneAsGraphic(), ClarisWksDocument(), getSpreadsheetParser(), and numPages().

## ◆ m_state

std::shared_ptr<ClarisWksDocumentInternal::State> ClarisWksDocument::m_state
| protected

the state

Referenced by canSendZoneAsGraphic(), checkHeader(), cleanZonesGraph(), createZones(), exploreZonesGraph(), exploreZonesGraphRec(), getDocumentMetaData(), getDocumentPages(), getMainSection(), getMainZonesList(), getPageLeftTop(), getTextHeight(), getZone(), numPages(), readDataLinkList(), readDocHeader(), readDocInfo(), readDSET(), readDSUM(), readPrintInfo(), sendDatabasePictZone(), sendZone(), typeMainZones(), updateChildPositions(), and updatePageSpanList().

## ◆ m_styleManager

std::shared_ptr<ClarisWksStyleManager> ClarisWksDocument::m_styleManager
| protected

the style manager

Referenced by ClarisWksDocument(), getStyleManager(), readDocHeader(), readEndTable(), and readZone().

## ◆ m_tableParser

std::shared_ptr<ClarisWksTable> ClarisWksDocument::m_tableParser
| protected

the table parser

Referenced by ClarisWksDocument(), getTableParser(), and numPages().

## ◆ m_textParser

std::shared_ptr<ClarisWksText> ClarisWksDocument::m_textParser
| protected

the text parser

Referenced by canSendZoneAsGraphic(), ClarisWksDocument(), getTextParser(), numPages(), and updatePageSpanList().

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

- ClarisWksDocument.hxx
- ClarisWksDocument.cxx