This class parses Works version 2000 through 8. More...
#include <WPS8.h>
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< WPSContentListener > | createListener (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< WPSContentListener > | m_listener |
shared_ptr< WPS8Graph > | m_graphParser |
the graph parser | |
shared_ptr< WPS8Table > | m_tableParser |
the table parser | |
shared_ptr< WPS8Text > | m_textParser |
the text parser | |
shared_ptr < WPS8ParserInternal::State > | m_state |
the internal state | |
Friends | |
class | WPS8ParserInternal::SubDocument |
class | WPS8Graph |
class | WPS8Table |
class | WPS8Text |
This class parses Works version 2000 through 8.
WPS8Parser::WPS8Parser | ( | RVNGInputStreamPtr & | input, |
WPSHeaderPtr & | header | ||
) |
constructor
destructor
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.
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 )
size | the size of the object in the document pages |
objectId | the object identificator |
ole | indicated 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().
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().
shared_ptr<WPS8Graph> WPS8Parser::m_graphParser [protected] |
the graph parser
Referenced by createListener(), createOLEStructures(), createStructures(), newPage(), parse(), sendObject(), sendPageFrames(), setListener(), and WPS8Parser().
shared_ptr<WPSContentListener> WPS8Parser::m_listener [protected] |
Referenced by newPage(), parse(), sendPageFrames(), sendTextBox(), and setListener().
shared_ptr<WPS8ParserInternal::State> WPS8Parser::m_state [protected] |
the internal state
Referenced by checkInFile(), createListener(), createStructures(), getTableSTRSId(), newPage(), numColumns(), pageHeight(), pageWidth(), readDocProperties(), readFRAM(), sendPageFrames(), sendTable(), and WPS8Parser().
shared_ptr<WPS8Table> WPS8Parser::m_tableParser [protected] |
the table parser
Referenced by createListener(), createStructures(), parse(), sendTable(), setListener(), and WPS8Parser().
shared_ptr<WPS8Text> WPS8Parser::m_textParser [protected] |
the text parser
Referenced by createListener(), createStructures(), parse(), parseHeaderIndexEntryEnd(), readFRAM(), send(), sendTextBox(), sendTextInCell(), setListener(), and WPS8Parser().