This class parses Works version 2000 through 8. More...
#include <WPS8.h>
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< 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, ... 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 | |
RVNGInputStreamPtr & | getInput () |
RVNGInputStreamPtr | getFileInput () |
WPSHeaderPtr & | getHeader () |
int | version () const |
void | setVersion (int vers) |
libwps::DebugFile & | ascii () |
a DebugFile used to write what we recognize when we parse the document | |
NameMultiMap & | getNameEntryMap () |
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< WPSContentListener > | m_listener |
std::shared_ptr< WPS8Graph > | m_graphParser |
the graph parser | |
std::shared_ptr< WPS8Table > | m_tableParser |
the table parser | |
std::shared_ptr< WPS8Text > | m_textParser |
the text parser | |
std::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 |
Additional Inherited Members | |
Public Types inherited from WPSParser | |
typedef std::multimap< std::string, WPSEntry > | NameMultiMap |
a map to retrieve a file entry by name |
This class parses Works version 2000 through 8.
WPS8Parser::WPS8Parser | ( | RVNGInputStreamPtr & | input, |
WPSHeaderPtr & | header ) |
constructor
|
final |
destructor
|
protected |
return true if the pos is in the file, update the file size if need
Referenced by WPS8Text.
|
protected |
|
protected |
|
protected |
|
protected |
retrieve the strsId corresponding to a table ( mainly for debug)
Referenced by WPS8Text.
|
protected |
adds a new page
Referenced by WPS8Text::readText(), and WPS8Text.
|
protected |
returns the number of columns
Referenced by WPS8Text::readText(), and WPS8Text.
|
protected |
returns the page height, ie. paper size less margin (in inches)
Referenced by WPS8Text.
|
protected |
returns the page width, ie. paper size less margin (in inches)
Referenced by WPS8Text.
|
finalvirtual |
|
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.
|
protected |
parses an index entry
Referenced by parseHeaderIndex(), and WPS8Text.
|
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.
|
protected |
reads the DOP zone: the document properties
Contains the page dimension, the background picture, ...
Referenced by createStructures(), and WPS8Text.
|
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.
|
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.
|
staticprotected |
finds the structures of the Ole zone "SPELLING"
Referenced by createOLEStructures(), and WPS8Text.
|
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.
|
protected |
parses the WNPR zone : a zone which seems to contain the printer preferences.
Referenced by createStructures(), and WPS8Text.
|
protected |
sends text corresponding to the strsId to the listener (via WPS8Text)
|
protected |
sends text corresponding to the entry to the listener (via WPS8Text)
Referenced by WPS8ParserInternal::SubDocument::parse(), send(), and WPS8Text.
|
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(), and WPS8Text.
|
protected |
|
protected |
sends a table as a character with given size ( via its WPS8Table )
Referenced by WPS8Text::readText(), and WPS8Text.
|
protected |
creates a subdocument to send a textbox which correspond to the strsid text zone
Referenced by sendPageFrames(), sendTable(), and WPS8Text.
|
protected |
|
protected |
|
friend |
Referenced by WPS8Graph, and WPS8Parser().
|
friend |
|
friend |
Referenced by WPS8Parser(), and WPS8Table.
|
friend |
Referenced by WPS8Parser(), and WPS8Text.
|
protected |
the graph parser
Referenced by createListener(), createOLEStructures(), createStructures(), newPage(), parse(), sendObject(), sendPageFrames(), setListener(), and WPS8Parser().
|
protected |
Referenced by newPage(), parse(), sendPageFrames(), sendTextBox(), setListener(), and WPS8Parser().
|
private |
Referenced by sendTable(), and WPS8Parser().
|
protected |
the internal state
Referenced by checkInFile(), createListener(), createStructures(), getTableSTRSId(), newPage(), numColumns(), pageHeight(), pageWidth(), readDocProperties(), readFRAM(), sendPageFrames(), sendTable(), and WPS8Parser().
|
protected |
the table parser
Referenced by createListener(), createStructures(), parse(), sendTable(), setListener(), and WPS8Parser().
|
protected |
the text parser
Referenced by createListener(), createStructures(), parse(), parseHeaderIndexEntryEnd(), readFRAM(), readFRCD(), send(), send(), sendTextBox(), sendTextInCell(), setListener(), and WPS8Parser().