WPS8Parser Class Reference

This class parses Works version 2000 through 8. More...

#include <WPS8.h>

Inheritance diagram for WPS8Parser:
WPSParser

List of all members.

Public Member Functions

 WPS8Parser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 constructor
 ~WPS8Parser ()
 destructor
void parse (librevenge::RVNGTextInterface *documentInterface)
 called by WPSDocument to parse the file

Protected Member Functions

bool checkInFile (long pos)
 return true if the pos is in the file, update the file size if need
void newPage (int number)
 adds a new page
void setListener (shared_ptr< WPSContentListener > listener)
 set the listener
shared_ptr< WPSContentListenercreateListener (librevenge::RVNGTextInterface *interface)
 creates the main listener
bool createStructures ()
 tries to parse the main zone, ...
bool createOLEStructures ()
 tries to parse the different OLE zones ( except the main zone )
float pageHeight () const
 returns the page height, ie. paper size less margin (in inches)
float pageWidth () const
 returns the page width, ie. paper size less margin (in inches)
int numColumns () const
 returns the number of columns
void sendPageFrames ()
 send the frames which corresponds to a given page to the listener
void sendTextBox (WPSPosition const &pos, int strsid, librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList())
 creates a subdocument to send a textbox which correspond to the strsid text zone
void send (WPSEntry const &entry)
 sends text corresponding to the entry to the listener (via WPS8Text)
void send (int strsId)
 sends text corresponding to the strsId to the listener (via WPS8Text)
void sendTextInCell (int strsId, int cellId)
 send the text of a cell to a listener (via WPS8Text)
bool sendTable (Vec2f const &size, int objectId)
 sends a table as a character with given size ( via its WPS8Table )
int getTableSTRSId (int tableId) const
 retrieve the strsId corresponding to a table ( mainly for debug)
bool sendObject (Vec2f const &size, int objectId, bool ole)
 sends an object as a character with given size (via its WPS8Graph )
bool parseHeaderIndexEntry ()
 parses an index entry
bool parseHeaderIndexEntryEnd (long endPos, WPSEntry &hie, std::string &mess)
 function which is called, if some data remains after the basic content of an entry: by default does nothing
bool parseHeaderIndex ()
 tries to find the beginning of the list of indices, then try to find all entries in this list.
bool readDocProperties (WPSEntry const &entry, WPSPageSpan &page)
 reads the DOP zone: the document properties
bool readFRAM (WPSEntry const &entry)
 reads the FRAM zone: ie a zone which can contains textbox, picture, ...
bool readSYID (WPSEntry const &entry, std::vector< int > &listId)
 parses a SYID zone
bool readWNPR (WPSEntry const &entry)
 parses the WNPR zone : a zone which seems to contain the printer preferences.
bool readSPELLING (RVNGInputStreamPtr input, std::string const &oleName)
 finds the structures of the Ole zone "SPELLING"

Protected Attributes

shared_ptr< WPSContentListenerm_listener
shared_ptr< WPS8Graphm_graphParser
 the graph parser
shared_ptr< WPS8Tablem_tableParser
 the table parser
shared_ptr< WPS8Textm_textParser
 the text parser
shared_ptr
< WPS8ParserInternal::State
m_state
 the internal state

Private Attributes

std::deque< int > m_sendingTables

Friends

class WPS8ParserInternal::SubDocument
class WPS8Graph
class WPS8Table
class WPS8Text

Detailed Description

This class parses Works version 2000 through 8.


Constructor & Destructor Documentation

constructor

destructor


Member Function Documentation

bool WPS8Parser::checkInFile ( long  pos) [protected]

return true if the pos is in the file, update the file size if need

shared_ptr< WPSContentListener > WPS8Parser::createListener ( librevenge::RVNGTextInterface *  interface) [protected]

creates the main listener

Referenced by parse().

bool WPS8Parser::createOLEStructures ( ) [protected]

tries to parse the different OLE zones ( except the main zone )

Referenced by parse().

bool WPS8Parser::createStructures ( ) [protected]

tries to parse the main zone, ...

Referenced by parse().

int WPS8Parser::getTableSTRSId ( int  tableId) const [protected]

retrieve the strsId corresponding to a table ( mainly for debug)

Referenced by WPS8Table::flushExtra().

void WPS8Parser::newPage ( int  number) [protected]

adds a new page

Referenced by WPS8Text::readText().

int WPS8Parser::numColumns ( ) const [protected]

returns the number of columns

Referenced by WPS8Text::readText().

float WPS8Parser::pageHeight ( ) const [protected]

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

float WPS8Parser::pageWidth ( ) const [protected]

returns the page width, ie. paper size less margin (in inches)

void WPS8Parser::parse ( librevenge::RVNGTextInterface *  documentInterface) [virtual]

called by WPSDocument to parse the file

Implements WPSParser.

bool WPS8Parser::parseHeaderIndex ( ) [protected]

tries to find the beginning of the list of indices, then try to find all entries in this list.

In the header, parse the index to the different sections of the CONTENTS stream.

Stores result in nameTable, offsetTable

Referenced by createStructures().

bool WPS8Parser::parseHeaderIndexEntry ( ) [protected]

parses an index entry

Referenced by parseHeaderIndex().

bool WPS8Parser::parseHeaderIndexEntryEnd ( long  endPos,
WPSEntry hie,
std::string &  mess 
) [protected]

function which is called, if some data remains after the basic content of an entry: by default does nothing

Referenced by parseHeaderIndexEntry().

bool WPS8Parser::readDocProperties ( WPSEntry const &  entry,
WPSPageSpan page 
) [protected]

reads the DOP zone: the document properties

Contains the page dimension, the background picture, ...

Referenced by createStructures().

bool WPS8Parser::readFRAM ( WPSEntry const &  entry) [protected]

reads the FRAM zone: ie a zone which can contains textbox, picture, ...

Frame zone: ie a zone which can contains text, picture, ...

and have some borders

and have some border

Referenced by createStructures().

bool WPS8Parser::readSPELLING ( RVNGInputStreamPtr  input,
std::string const &  oleName 
) [protected]

finds the structures of the Ole zone "SPELLING"

Referenced by createOLEStructures().

bool WPS8Parser::readSYID ( WPSEntry const &  entry,
std::vector< int > &  listId 
) [protected]

parses a SYID zone

an unknown zone which seems to have the same number of entries than the text zones (STRS)

Referenced by createStructures().

bool WPS8Parser::readWNPR ( WPSEntry const &  entry) [protected]

parses the WNPR zone : a zone which seems to contain the printer preferences.

Warning:
: read data are not used

Referenced by createStructures().

void WPS8Parser::send ( WPSEntry const &  entry) [protected]

sends text corresponding to the entry to the listener (via WPS8Text)

Referenced by WPS8ParserInternal::SubDocument::parse(), send(), and WPS8Table::sendTable().

void WPS8Parser::send ( int  strsId) [protected]

sends text corresponding to the strsId to the listener (via WPS8Text)

bool WPS8Parser::sendObject ( Vec2f const &  size,
int  objectId,
bool  ole 
) [protected]

sends an object as a character with given size (via its WPS8Graph )

Parameters:
sizethe size of the object in the document pages
objectIdthe object identificator
oleindicated if we look for objects coming from a ole zone or objects coming from a Pict zone

Referenced by WPS8Text::readText().

void WPS8Parser::sendPageFrames ( ) [protected]

send the frames which corresponds to a given page to the listener

Referenced by parse().

bool WPS8Parser::sendTable ( Vec2f const &  size,
int  objectId 
) [protected]

sends a table as a character with given size ( via its WPS8Table )

Referenced by WPS8Text::readText().

void WPS8Parser::sendTextBox ( WPSPosition const &  pos,
int  strsid,
librevenge::RVNGPropertyList  frameExtras = librevenge::RVNGPropertyList() 
) [protected]

creates a subdocument to send a textbox which correspond to the strsid text zone

Referenced by sendPageFrames(), WPS8Table::sendTable(), and sendTable().

void WPS8Parser::sendTextInCell ( int  strsId,
int  cellId 
) [protected]

send the text of a cell to a listener (via WPS8Text)

Referenced by WPS8Table::sendTextInCell().

void WPS8Parser::setListener ( shared_ptr< WPSContentListener listener) [protected]

set the listener

Referenced by parse().


Friends And Related Function Documentation

friend class WPS8Graph [friend]

Referenced by WPS8Parser().

friend class WPS8ParserInternal::SubDocument [friend]
friend class WPS8Table [friend]

Referenced by WPS8Parser().

friend class WPS8Text [friend]

Referenced by WPS8Parser().


Member Data Documentation

std::deque<int> WPS8Parser::m_sendingTables [private]

Referenced by sendTable().

shared_ptr<WPS8Table> WPS8Parser::m_tableParser [protected]

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