WPS8Parser Class Referencefinal

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

#include <WPS8.h>

Inheritance diagram for WPS8Parser:
WPSParser

Public Member Functions

 WPS8Parser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 constructor
 ~WPS8Parser () final
 destructor
void parse (librevenge::RVNGTextInterface *documentInterface) final
 called by WPSDocument to parse the file
Public Member Functions inherited from WPSParser
 WPSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
virtual ~WPSParser ()

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 (std::shared_ptr< WPSContentListener > const &listener)
 set the listener
std::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, ... and have some borders
bool readFRCD (WPSEntry const &entry)
 reads the FRCD zone: ie a zone which can contains mailmerge data ?
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.
Protected Member Functions inherited from WPSParser
RVNGInputStreamPtrgetInput ()
RVNGInputStreamPtr getFileInput ()
WPSHeaderPtrgetHeader ()
int version () const
void setVersion (int vers)
libwps::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document
NameMultiMapgetNameEntryMap ()
NameMultiMap const & getNameEntryMap () const

Static Protected Member Functions

static bool readSPELLING (RVNGInputStreamPtr input, std::string const &oleName)
 finds the structures of the Ole zone "SPELLING"

Protected Attributes

std::shared_ptr< WPSContentListenerm_listener
std::shared_ptr< WPS8Graphm_graphParser
 the graph parser
std::shared_ptr< WPS8Tablem_tableParser
 the table parser
std::shared_ptr< WPS8Textm_textParser
 the text parser
std::shared_ptr< WPS8ParserInternal::Statem_state
 the internal state

Private Attributes

std::deque< int > m_sendingTables

Friends

class WPS8ParserInternal::SubDocument
class WPS8Graph
class WPS8Table
class WPS8Text

Additional Inherited Members

Public Types inherited from WPSParser
typedef std::multimap< std::string, WPSEntryNameMultiMap
 a map to retrieve a file entry by name

Detailed Description

This class parses Works version 2000 through 8.

Constructor & Destructor Documentation

◆ WPS8Parser()

WPS8Parser::WPS8Parser ( RVNGInputStreamPtr & input,
WPSHeaderPtr & header )

constructor

◆ ~WPS8Parser()

WPS8Parser::~WPS8Parser ( )
final

destructor

Member Function Documentation

◆ checkInFile()

bool WPS8Parser::checkInFile ( long pos)
protected

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

Referenced by WPS8Text.

◆ createListener()

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

creates the main listener

Referenced by parse(), and WPS8Text.

◆ createOLEStructures()

bool WPS8Parser::createOLEStructures ( )
protected

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

Referenced by parse(), and WPS8Text.

◆ createStructures()

bool WPS8Parser::createStructures ( )
protected

tries to parse the main zone, ...

Referenced by parse(), and WPS8Text.

◆ getTableSTRSId()

int WPS8Parser::getTableSTRSId ( int tableId) const
protected

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

Referenced by WPS8Text.

◆ newPage()

void WPS8Parser::newPage ( int number)
protected

adds a new page

Referenced by WPS8Text::readText(), and WPS8Text.

◆ numColumns()

int WPS8Parser::numColumns ( ) const
protected

returns the number of columns

Referenced by WPS8Text::readText(), and WPS8Text.

◆ pageHeight()

float WPS8Parser::pageHeight ( ) const
protected

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

Referenced by WPS8Text.

◆ pageWidth()

float WPS8Parser::pageWidth ( ) const
protected

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

Referenced by WPS8Text.

◆ parse()

void WPS8Parser::parse ( librevenge::RVNGTextInterface * documentInterface)
finalvirtual

called by WPSDocument to parse the file

Implements WPSParser.

Referenced by WPS8Text.

◆ parseHeaderIndex()

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(), and WPS8Text.

◆ parseHeaderIndexEntry()

bool WPS8Parser::parseHeaderIndexEntry ( )
protected

parses an index entry

Referenced by parseHeaderIndex(), and WPS8Text.

◆ parseHeaderIndexEntryEnd()

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(), and WPS8Text.

◆ readDocProperties()

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(), and WPS8Text.

◆ readFRAM()

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

reads the FRAM zone: ie a zone which can contains textbox, picture, ... and have some borders

Frame zone: ie a zone which can contains text, picture, ... and have some border.

Referenced by createStructures(), and WPS8Text.

◆ readFRCD()

bool WPS8Parser::readFRCD ( WPSEntry const & entry)
protected

reads the FRCD zone: ie a zone which can contains mailmerge data ?

try to read a frame XXX database

Referenced by createStructures(), and WPS8Text.

◆ readSPELLING()

bool WPS8Parser::readSPELLING ( RVNGInputStreamPtr input,
std::string const & oleName )
staticprotected

finds the structures of the Ole zone "SPELLING"

Referenced by createOLEStructures(), and WPS8Text.

◆ readSYID()

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(), and WPS8Text.

◆ readWNPR()

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(), and WPS8Text.

◆ send() [1/2]

void WPS8Parser::send ( int strsId)
protected

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

◆ send() [2/2]

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 WPS8Text.

◆ sendObject()

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(), and WPS8Text.

◆ sendPageFrames()

void WPS8Parser::sendPageFrames ( )
protected

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

Referenced by parse(), and WPS8Text.

◆ sendTable()

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(), and WPS8Text.

◆ sendTextBox()

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(), sendTable(), and WPS8Text.

◆ sendTextInCell()

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

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

Referenced by WPS8Text.

◆ setListener()

void WPS8Parser::setListener ( std::shared_ptr< WPSContentListener > const & listener)
protected

set the listener

Referenced by parse(), and WPS8Text.

◆ WPS8Graph

friend class WPS8Graph
friend

Referenced by WPS8Graph, and WPS8Parser().

◆ WPS8ParserInternal::SubDocument

friend class WPS8ParserInternal::SubDocument
friend

◆ WPS8Table

friend class WPS8Table
friend

Referenced by WPS8Parser(), and WPS8Table.

◆ WPS8Text

friend class WPS8Text
friend

Referenced by WPS8Parser(), and WPS8Text.

Member Data Documentation

◆ m_graphParser

std::shared_ptr<WPS8Graph> WPS8Parser::m_graphParser
protected

◆ m_listener

std::shared_ptr<WPSContentListener> WPS8Parser::m_listener
protected

◆ m_sendingTables

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

Referenced by sendTable(), and WPS8Parser().

◆ m_state

◆ m_tableParser

std::shared_ptr<WPS8Table> WPS8Parser::m_tableParser
protected

◆ m_textParser

std::shared_ptr<WPS8Text> WPS8Parser::m_textParser
protected

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

Generated on Sat Jul 19 2025 05:24:40 for libwps by doxygen 1.14.0