WPS8Graph Class Reference

the main class to read/store pictures in a Pc MS Works document v5-8 More...

`#include <WPS8Graph.h>`

## Public Member Functions

| WPS8Graph (WPS8Parser &parser)
| constructor More...
| ~WPS8Graph ()
| destructor More...
void | setListener (WPS8ContentListenerPtr &listen)
| sets the listener More...
void | computePositions () const
| computes the final position of all found figures. More...
int | numPages () const
| returns the number page where we find a picture. In practice, 0/1 More...
bool | sendObject (WPSPosition const &pos, int id, bool ole)
| sends an object More...
bool | sendIBGF (WPSPosition const &pos, int ibgfId)
| sends data corresponding to a ibgf entry on a given pos position More...
void | sendObjects (int page, int pageToIgnore=-2)
| send all the objects of a given page: More...

## Protected Member Functions

int | version () const
| returns the file version More...
void | sendBorder (int borderId)
| sends the border frames. More...
void | storeObjects (std::vector< WPXBinaryData > const &objects, std::vector< int > const &ids, std::vector< WPSPosition > const &positions)
| adds a list of objects with given ids in the ole lists More...
bool | readStructures (WPXInputStreamPtr input)
| finds all entries which correspond to some pictures, parses them and stores data More...
bool | readPICT (WPXInputStreamPtr input, WPSEntry const &entry)
| reads a PICT/MEF4 entry : reads uncompressed picture of sx*sy of rgb More...
bool | readIBGF (WPXInputStreamPtr input, WPSEntry const &entry)
| reads a IBGF zone: an entry to a background picture More...
bool | readBDR (WPXInputStreamPtr input, WPSEntry const &entry)
| parsed BDR/WBDR zone: a complex border formed with 8 pictures More...
bool | readMetaFile (WPXInputStreamPtr input, long endPos, WPXBinaryData &pict)
| reads METAFILE/CODE More...
libwps::DebugFile & | ascii ()
| returns the debug file More...

## Protected Attributes

WPS8ContentListenerPtr | m_listener
| the listener More...
WPS8Parser & | m_mainParser
| the main parser More...
shared_ptr < WPS8GraphInternal::State > | m_state
| the state More...
libwps::DebugFile & | m_asciiFile
| the ascii file More...

## Private Member Functions

| WPS8Graph (WPS8Graph const &orig)
WPS8Graph & | operator= (WPS8Graph const &orig)

## Friends

class | WPS8Parser

## Detailed Description

the main class to read/store pictures in a Pc MS Works document v5-8

This class must be associated with a WPS8Parser. It contains code to read the BDR/WBDR, PICT/MEF4, IBGF entries and to store the pictures which are found in the other ole parts.

Note
  As the pictures seems always be given with characters positions, many functions which exists to maintain the same structures that exist in the other WPS*MNGraph classes do almost nothing.

## Constructor & Destructor Documentation

WPS8Graph::WPS8Graph | ( | WPS8Parser & | parser | ) |

constructor

WPS8Graph::~WPS8Graph | ( |  | ) |

destructor

WPS8Graph::WPS8Graph | ( | WPS8Graph const & | orig | ) |

private

## Member Function Documentation

libwps::DebugFile& WPS8Graph::ascii | ( |  | ) |

inline protected

returns the debug file

Referenced by readBDR(), readIBGF(), readMetaFile(), and readPICT().

void WPS8Graph::computePositions | ( |  | ) | const

computes the final position of all found figures.

In reality, as all the pictures seemed to be given with characters positions, it does nothing

int WPS8Graph::numPages | ( |  | ) | const

returns the number page where we find a picture. In practice, 0/1

WPS8Graph& WPS8Graph::operator= | ( | WPS8Graph const & | orig | ) |

private

bool WPS8Graph::readBDR | ( | WPXInputStreamPtr | input,
|  | WPSEntry const & | entry
| ) |  |

protected

parsed BDR/WBDR zone: a complex border formed with 8 pictures

Referenced by readStructures().

bool WPS8Graph::readIBGF | ( | WPXInputStreamPtr | input,
|  | WPSEntry const & | entry
| ) |  |

protected

reads a IBGF zone: an entry to a background picture

This small entry seems to contain only an identificator which pointed to a PICT Zone

Referenced by readStructures().

bool WPS8Graph::readMetaFile | ( | WPXInputStreamPtr | input,
|  | long | endPos,
|  | WPXBinaryData & | pict
| ) |  |

protected

reads METAFILE/CODE

METAFILE/CODE see http://www.fileformat.info/format/wmf/egff.htm FIXME: we must also recognize the enhanced metafile format: EMF, if we want to read text which are created after 2007.

Warning
  we must probably also recognize the enhanced metafile format: EMF

Referenced by readBDR(), and readPICT().

bool WPS8Graph::readPICT | ( | WPXInputStreamPtr | input,
|  | WPSEntry const & | entry
| ) |  |

protected

reads a PICT/MEF4 entry : reads uncompressed picture of sx*sy of rgb

This kind of entry seems mainly used to store a background picture

Referenced by readStructures().

bool WPS8Graph::readStructures | ( | WPXInputStreamPtr | input | ) |

protected

finds all entries which correspond to some pictures, parses them and stores data

void WPS8Graph::sendBorder | ( | int | borderId | ) |

protected

sends the border frames.

Actually, sends the eight consecutive pictures which form a border on 3 consecutive lines

Referenced by sendObjects().

bool WPS8Graph::sendIBGF | ( | WPSPosition const & | pos,
|  | int | ibgfId
| ) |  |

sends data corresponding to a ibgf entry on a given pos position

bool WPS8Graph::sendObject | ( | WPSPosition const & | pos,
|  | int | id,
|  | bool | ole
| ) |  |

sends an object

Parameters

  pos | the object position in the document
  id | the object identificator
  ole | indicated if we look for objects coming from a ole zone or objects coming from a Pict zone

Referenced by sendIBGF().

void WPS8Graph::sendObjects | ( | int | page,
|  | int | pageToIgnore = `-2`
| ) |  |

send all the objects of a given page:

Parameters

  page | if page < 0, sends all the pictures which have not been used,
  pageToIgnore | pictures on this pages are not send

As all the pictures seemed to be given with characters positions, this function only does something if page < 0.

void WPS8Graph::setListener | ( | WPS8ContentListenerPtr & | listen | ) |

inline

sets the listener

void WPS8Graph::storeObjects | ( | std::vector< WPXBinaryData > const & | objects,
|  | std::vector< int > const & | ids,
|  | std::vector< WPSPosition > const & | positions
| ) |  |

protected

adds a list of objects with given ids in the ole lists

int WPS8Graph::version | ( |  | ) | const

protected

returns the file version

## Friends And Related Function Documentation

friend class WPS8Parser

friend

## Member Data Documentation

libwps::DebugFile& WPS8Graph::m_asciiFile

protected

the ascii file

Referenced by ascii().

WPS8ContentListenerPtr WPS8Graph::m_listener

protected

the listener

Referenced by sendBorder(), sendObject(), sendObjects(), and setListener().

WPS8Parser& WPS8Graph::m_mainParser

protected

the main parser

Referenced by readStructures(), and version().

shared_ptr<WPS8GraphInternal::State> WPS8Graph::m_state

mutable protected

the state

Referenced by computePositions(), numPages(), readBDR(), readIBGF(), readPICT(), sendBorder(), sendIBGF(), sendObject(), sendObjects(), storeObjects(), version(), and WPS8Graph().

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

- WPS8Graph.h
- WPS8Graph.cpp