MsWksGraph Class Reference documentation

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
MsWksGraph Class Reference

the main class to read the graphic of a Microsoft Works file More...

`#include <MsWksGraph.hxx>`

## Classes
struct | SendData
| small struct used which picture need to be send More...
struct | Style
| Internal: the graphic style of MsWksGraph. More...

## Public Member Functions
| MsWksGraph (MsWksDocument &document)
| constructor
virtual | ~MsWksGraph ()
| destructor
void | setPageLeftTop (MWAWVec2f const &leftTop)
| define the page left top dimension in point
int | version () const
| returns the file version
int | numPages (int zoneId) const
| returns the number of pages
void | send (int id, MWAWPosition const &pos)
| send a zone (textbox, ...).
void | sendAll (int zoneId, bool mainZone)
| send all the picture corresponding to a zone
void | sendObjects (SendData const &what)
| sends all the object of a page, frame, ...
void | computePositions (int zoneId, std::vector< int > const &linesHeight, std::vector< int > const &pagesHeight)
| try to update positions knowing pages and lines height

## Protected Member Functions
void | flushExtra ()
| sends the data which have not yet been sent to the listener
bool | readPictHeader (MsWksGraphInternal::Zone &pict)
| read the picture header
bool | readGradient (Style &style)
| read the gradient structure ( v4)
int | getEntryPictureV1 (int zoneId, MWAWEntry &zone, bool autoSend=true)
| checks if the next zone is a v1 picture and returns a zone id ( or -1).
int | getEntryPicture (int zoneId, MWAWEntry &zone, bool autoSend=true, int order=-1000)
| checks if the next zone is a v2 picture and returns a zone id ( or -1)
bool | readRB (MWAWInputStreamPtr input, MWAWEntry const &entry, int kind)
| reads the RBDR or a RBIL zone: a zone which seems to regroup all pages pictures in v3-v4 document
bool | readPictureV4 (MWAWInputStreamPtr input, MWAWEntry const &entry)
| reads a Pict zone: a zone which seems to code in v4 : header/footer picture
bool | readText (MsWksGraphInternal::TextBox &textBox)
| try to read a text zone
void | sendTextBox (int zId, MWAWListenerPtr listener)
| try to send a text box zone v1-3
void | checkTextBoxLinks (MsWksGraphInternal::RBZone &rbZone)
| check the text box link v4
bool | getZoneGraphicStyle (int zoneId, MWAWGraphicStyle &style) const
| returns the graphic style of the zone defined by zoneId
bool | getZonePosition (int zoneId, MWAWPosition::AnchorTo anchor, MWAWPosition &pos) const
| returns the position of the zone defined by zoneId
void | sendFrameText (MWAWEntry const &entry, std::string const &frame)
| ask m_mainParser to send a frame text(v4)
void | sendTable (int id)
| try to a table zone
void | sendChart (int zoneId)
| try to send a chart
std::shared_ptr< MsWksGraphInternal::GroupZone > | readGroup (MsWksGraphInternal::Zone &group)
| try to read the group data
void | sendGroup (int zoneId, MWAWPosition const &pos)
| try to send a group
void | sendGroupChild (int zoneId, MWAWPosition const &pos)
| try to send a group elements by elemenys
bool | canCreateGraphic (MsWksGraphInternal::GroupZone const &group) const
| returns true if we can create a graphic for the whole group
void | sendGroup (MsWksGraphInternal::GroupZone const &group, MWAWGraphicListenerPtr &listener) const
| send the group as a graphic zone
bool | readFont (MWAWFont &font)
| reads the textbox font

## Protected Attributes
MWAWParserStatePtr | m_parserState
| the parser state
std::shared_ptr< MsWksGraphInternal::State > | m_state
| the state
MWAWParser * | m_mainParser
| the main parser;
MsWksDocument & | m_document
| the main document
std::shared_ptr< MsWksTable > | m_tableParser
| the table manager

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

## Friends
class | MsWksDocument
class | MsWksTable
class | MsWksParser
class | MsWks4Zone
class | MsWksDBParser
class | MsWksDRParser
class | MsWksSSParser
class | MsWksGraphInternal::SubDocument

## Detailed Description

the main class to read the graphic of a Microsoft Works file

## Constructor & Destructor Documentation

## ◆ MsWksGraph() [1/2]

MsWksGraph::MsWksGraph | ( | MsWksDocument & | document | ) |
| explicit

constructor

## ◆ ~MsWksGraph()

MsWksGraph::~MsWksGraph | ( |  | ) |
| virtual

destructor

## ◆ MsWksGraph() [2/2]

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

## Member Function Documentation

## ◆ canCreateGraphic()

bool MsWksGraph::canCreateGraphic | ( | MsWksGraphInternal::GroupZone const & | group | ) | const
| protected

returns true if we can create a graphic for the whole group

Referenced by canCreateGraphic(), sendGroup(), and sendGroupChild().

## ◆ checkTextBoxLinks()

void MsWksGraph::checkTextBoxLinks | ( | MsWksGraphInternal::RBZone & | rbZone | ) |
| protected

check the text box link v4

Referenced by readRB().

## ◆ computePositions()

void MsWksGraph::computePositions | ( | int | zoneId,
|  | std::vector< int > const & | linesHeight,
|  | std::vector< int > const & | pagesHeight
| ) |  |

try to update positions knowing pages and lines height

## ◆ flushExtra()

void MsWksGraph::flushExtra | ( |  | ) |
| protected

sends the data which have not yet been sent to the listener

## ◆ getEntryPicture()

int MsWksGraph::getEntryPicture | ( | int | zoneId,
|  | MWAWEntry & | zone,
|  | bool | autoSend = `true`,
|  | int | order = `-1000`
| ) |  |
| protected

checks if the next zone is a v2 picture and returns a zone id ( or -1)

Referenced by MsWksTable::readChart(), readGroup(), and readRB().

## ◆ getEntryPictureV1()

int MsWksGraph::getEntryPictureV1 | ( | int | zoneId,
|  | MWAWEntry & | zone,
|  | bool | autoSend = `true`
| ) |  |
| protected

checks if the next zone is a v1 picture and returns a zone id ( or -1).

## ◆ getZoneGraphicStyle()

bool MsWksGraph::getZoneGraphicStyle | ( | int | zoneId,
|  | MWAWGraphicStyle & | style
| ) |  | const
| protected

returns the graphic style of the zone defined by zoneId

## ◆ getZonePosition()

bool MsWksGraph::getZonePosition | ( | int | zoneId,
|  | MWAWPosition::AnchorTo | anchor,
|  | MWAWPosition & | pos
| ) |  | const
| protected

returns the position of the zone defined by zoneId

Referenced by MsWksTable::sendChart().

## ◆ numPages()

int MsWksGraph::numPages | ( | int | zoneId | ) | const

returns the number of pages

## ◆ operator=()

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

## ◆ readFont()

bool MsWksGraph::readFont | ( | MWAWFont & | font | ) |
| protected

reads the textbox font

Referenced by readText().

## ◆ readGradient()

bool MsWksGraph::readGradient | ( | MsWksGraph::Style & | style | ) |
| protected

read the gradient structure ( v4)

Referenced by readPictHeader().

## ◆ readGroup()

std::shared_ptr< MsWksGraphInternal::GroupZone > MsWksGraph::readGroup | ( | MsWksGraphInternal::Zone & | group | ) |
| protected

try to read the group data

Referenced by getEntryPicture().

## ◆ readPictHeader()

bool MsWksGraph::readPictHeader | ( | MsWksGraphInternal::Zone & | pict | ) |
| protected

read the picture header

Referenced by getEntryPicture().

## ◆ readPictureV4()

bool MsWksGraph::readPictureV4 | ( | MWAWInputStreamPtr | input,
|  | MWAWEntry const & | entry
| ) |  |
| protected

reads a Pict zone: a zone which seems to code in v4 : header/footer picture

## ◆ readRB()

bool MsWksGraph::readRB | ( | MWAWInputStreamPtr | input,
|  | MWAWEntry const & | entry,
|  | int | kind
| ) |  |
| protected

reads the RBDR or a RBIL zone: a zone which seems to regroup all pages pictures in v3-v4 document

kind=0: uses entry to define the position kind=1: entry size then data kind=2: marker, entry size then data

## ◆ readText()

bool MsWksGraph::readText | ( | MsWksGraphInternal::TextBox & | textBox | ) |
| protected

try to read a text zone

Referenced by getEntryPicture().

## ◆ send()

void MsWksGraph::send | ( | int | id,
|  | MWAWPosition const & | pos
| ) |  |

send a zone (textbox, ...).

Note
  if pos.size() is not defined, this function will retrieve the position, .. using the corresponding zone's data

Referenced by flushExtra(), sendAll(), MsWksTable::sendChart(), sendGroupChild(), and sendObjects().

## ◆ sendAll()

void MsWksGraph::sendAll | ( | int | zoneId,
|  | bool | mainZone
| ) |  |

send all the picture corresponding to a zone

## ◆ sendChart()

void MsWksGraph::sendChart | ( | int | zoneId | ) |
| protected

try to send a chart

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

## ◆ sendFrameText()

void MsWksGraph::sendFrameText | ( | MWAWEntry const & | entry,
|  | std::string const & | frame
| ) |  |
| protected

ask m_mainParser to send a frame text(v4)

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

## ◆ sendGroup() [1/2]

void MsWksGraph::sendGroup | ( | int | zoneId,
|  | MWAWPosition const & | pos
| ) |  |
| protected

try to send a group

Referenced by send(), sendGroup(), and sendGroupChild().

## ◆ sendGroup() [2/2]

void MsWksGraph::sendGroup | ( | MsWksGraphInternal::GroupZone const & | group,
|  | MWAWGraphicListenerPtr & | listener
| ) |  | const
| protected

send the group as a graphic zone

## ◆ sendGroupChild()

void MsWksGraph::sendGroupChild | ( | int | zoneId,
|  | MWAWPosition const & | pos
| ) |  |
| protected

try to send a group elements by elemenys

Referenced by MsWksGraphInternal::SubDocument::parse(), and sendGroup().

## ◆ sendObjects()

void MsWksGraph::sendObjects | ( | MsWksGraph::SendData const & | what | ) |

sends all the object of a page, frame, ...

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

## ◆ sendTable()

void MsWksGraph::sendTable | ( | int | id | ) |
| protected

try to a table zone

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

## ◆ sendTextBox()

void MsWksGraph::sendTextBox | ( | int | zId,
|  | MWAWListenerPtr | listener
| ) |  |
| protected

try to send a text box zone v1-3

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

## ◆ setPageLeftTop()

void MsWksGraph::setPageLeftTop | ( | MWAWVec2f const & | leftTop | ) |

define the page left top dimension in point

## ◆ version()

int MsWksGraph::version | ( |  | ) | const

returns the file version

Referenced by getEntryPicture(), readFont(), readGroup(), readPictHeader(), and readRB().

## Friends And Related Function Documentation

## ◆ MsWks4Zone

friend class MsWks4Zone
| friend

## ◆ MsWksDBParser

friend class MsWksDBParser
| friend

## ◆ MsWksDocument

friend class MsWksDocument
| friend

## ◆ MsWksDRParser

friend class MsWksDRParser
| friend

## ◆ MsWksGraphInternal::SubDocument

friend class MsWksGraphInternal::SubDocument
| friend

## ◆ MsWksParser

friend class MsWksParser
| friend

## ◆ MsWksSSParser

friend class MsWksSSParser
| friend

## ◆ MsWksTable

friend class MsWksTable
| friend

Referenced by MsWksGraph().

## Member Data Documentation

## ◆ m_document

MsWksDocument& MsWksGraph::m_document
| protected

the main document

Referenced by getEntryPicture(), getEntryPictureV1(), MsWksGraph(), readFont(), readGradient(), readGroup(), readPictHeader(), readPictureV4(), readRB(), readText(), send(), sendFrameText(), sendGroup(), sendGroupChild(), and sendObjects().

## ◆ m_mainParser

MWAWParser* MsWksGraph::m_mainParser
| protected

the main parser;

Referenced by MsWksGraph().

## ◆ m_parserState

MWAWParserStatePtr MsWksGraph::m_parserState
| protected

the parser state

Referenced by canCreateGraphic(), computePositions(), MsWksGraph(), readPictHeader(), readText(), send(), sendGroup(), sendGroupChild(), sendObjects(), and version().

## ◆ m_state

std::shared_ptr<MsWksGraphInternal::State> MsWksGraph::m_state
| protected

the state

Referenced by canCreateGraphic(), checkTextBoxLinks(), computePositions(), flushExtra(), getEntryPicture(), getEntryPictureV1(), getZoneGraphicStyle(), getZonePosition(), numPages(), readPictHeader(), readPictureV4(), readRB(), send(), sendAll(), sendGroup(), sendGroupChild(), sendObjects(), sendTextBox(), setPageLeftTop(), and version().

## ◆ m_tableParser

std::shared_ptr<MsWksTable> MsWksGraph::m_tableParser
| protected

the table manager

Referenced by getEntryPicture(), MsWksGraph(), send(), sendChart(), and sendTable().

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

- MsWksGraph.hxx
- MsWksGraph.cxx