GWParser Class Reference

the main class to read a GreatWorks text file More...

#include <GWParser.hxx>

Inheritance diagram for GWParser:
MWAWParser

Public Types

enum  DocType { DRAW, TEXT, UNKNOWN }
 an enum used to defined the document type More...
 

Public Member Functions

 GWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor More...
 
virtual ~GWParser ()
 destructor More...
 
bool checkHeader (MWAWHeader *header, bool strict=false)
 checks if the document header is correct (or not) More...
 
void parse (WPXDocumentInterface *documentInterface)
 virtual function used to parse the input More...
 
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor More...
 
int version () const
 returns the works version More...
 
void setVersion (int vers)
 sets the works version More...
 

Protected Member Functions

void init ()
 inits all internal variables More...
 
void createDocument (WPXDocumentInterface *documentInterface)
 creates the listener which will be associated to the document More...
 
Vec2f getPageLeftTop () const
 returns the page left top point ( in inches) More...
 
void newPage (int number)
 adds a new page More...
 
MWAWSection getMainSection () const
 return the main section More...
 
bool sendHF (int id)
 try to send the i^th header/footer More...
 
bool canSendTextBoxAsGraphic (MWAWEntry const &entry)
 check if a textbox can be send in a graphic zone, ie. does not contains any graphic More...
 
bool sendTextbox (MWAWEntry const &entry, bool inGraphic)
 try to textbox's text More...
 
bool sendPicture (MWAWEntry const &entry, MWAWPosition pos)
 try to send a picture More...
 
DocType getDocumentType () const
 
bool createZones ()
 finds the different objects zones More...
 
bool createDrawZones ()
 finds the different objects zones ( for a draw file) More...
 
bool readRSRCZones ()
 read the resource fork zone More...
 
bool readPrintInfo (MWAWEntry const &entry)
 read a PrintInfo block ( PRNT resource block ) More...
 
bool readWPSN (MWAWEntry const &entry)
 read the windows positions ( WPSN resource block ) More...
 
bool readDocInfo ()
 read the DocInfo block ( many unknown data ) More...
 
bool readARRs (MWAWEntry const &entry)
 read a unknown zone ( ARRs resource block: v2 ) More...
 
bool readDaHS (MWAWEntry const &entry)
 read a unknown zone ( DaHS resource block: v2 ) More...
 
bool readGrDS (MWAWEntry const &entry)
 read a unknown zone ( GrDS resource block: v2 ) More...
 
bool readNxEd (MWAWEntry const &entry)
 read a unknown zone ( NxED resource block: v2 ) More...
 
MWAWInputStreamPtr rsrcInput ()
 return the input input More...
 
libmwaw::DebugFilersrcAscii ()
 a DebugFile used to write what we recognize when we parse the document in rsrc More...
 
- Protected Member Functions inherited from MWAWParser
 MWAWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWParser (MWAWParserStatePtr state)
 constructor using a state More...
 
MWAWParserStatePtr getParserState ()
 returns the parser state More...
 
MWAWHeadergetHeader ()
 returns the header More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener More...
 
MWAWContentListenerPtrgetListener ()
 returns the listener More...
 
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension More...
 
MWAWPageSpangetPageSpan ()
 returns the actual page dimension More...
 
double getFormLength () const
 returns the form length More...
 
double getFormWidth () const
 returns the form width More...
 
double getPageLength () const
 returns the page length (form length without margin ) More...
 
double getPageWidth () const
 returns the page width (form width without margin ) More...
 
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser More...
 
void setListener (MWAWContentListenerPtr &listener)
 sets the listener More...
 
void resetListener ()
 resets the listener More...
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter More...
 
void setFontConverter (MWAWFontConverterPtr fontConverter)
 sets the font convertor More...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 
void setAsciiName (char const *name)
 Debugging: change the default ascii file. More...
 
std::string const & asciiName () const
 return the ascii file name More...
 

Protected Attributes

shared_ptr
< GWParserInternal::State
m_state
 the state More...
 
shared_ptr< GWGraphm_graphParser
 the graph parser More...
 
shared_ptr< GWTextm_textParser
 the text parser More...
 

Friends

class GWParserInternal::SubDocument
 
class GWGraph
 
class GWText
 

Detailed Description

the main class to read a GreatWorks text file

Member Enumeration Documentation

an enum used to defined the document type

Enumerator
DRAW 
TEXT 
UNKNOWN 

Constructor & Destructor Documentation

GWParser::GWParser ( MWAWInputStreamPtr  input,
MWAWRSRCParserPtr  rsrcParser,
MWAWHeader header 
)

constructor

GWParser::~GWParser ( )
virtual

destructor

Member Function Documentation

bool GWParser::canSendTextBoxAsGraphic ( MWAWEntry const &  entry)
protected

check if a textbox can be send in a graphic zone, ie. does not contains any graphic

Referenced by GWGraph::canCreateGraphic(), GWGraph::sendGroupChild(), and GWGraph::sendTextbox().

bool GWParser::checkHeader ( MWAWHeader header,
bool  strict = false 
)
virtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

void GWParser::createDocument ( WPXDocumentInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

bool GWParser::createDrawZones ( )
protected

finds the different objects zones ( for a draw file)

Referenced by createZones().

bool GWParser::createZones ( )
protected

finds the different objects zones

Referenced by parse().

MWAWSection GWParser::getMainSection ( ) const
protected

return the main section

Referenced by GWText::sendZone().

Vec2f GWParser::getPageLeftTop ( ) const
protected

returns the page left top point ( in inches)

Referenced by GWGraph::sendFrame().

void GWParser::init ( )
protected

inits all internal variables

Referenced by GWParser().

void GWParser::newPage ( int  number)
protected

adds a new page

Referenced by GWText::sendZone().

void GWParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

virtual function used to parse the input

Implements MWAWParser.

bool GWParser::readARRs ( MWAWEntry const &  entry)
protected

read a unknown zone ( ARRs resource block: v2 )

Referenced by readRSRCZones().

bool GWParser::readDaHS ( MWAWEntry const &  entry)
protected

read a unknown zone ( DaHS resource block: v2 )

Referenced by readRSRCZones().

bool GWParser::readDocInfo ( )
protected

read the DocInfo block ( many unknown data )

Referenced by createZones().

bool GWParser::readGrDS ( MWAWEntry const &  entry)
protected

read a unknown zone ( GrDS resource block: v2 )

Referenced by readRSRCZones().

bool GWParser::readNxEd ( MWAWEntry const &  entry)
protected

read a unknown zone ( NxED resource block: v2 )

Referenced by readRSRCZones().

bool GWParser::readPrintInfo ( MWAWEntry const &  entry)
protected

read a PrintInfo block ( PRNT resource block )

Referenced by readRSRCZones().

bool GWParser::readRSRCZones ( )
protected

read the resource fork zone

Referenced by createZones().

bool GWParser::readWPSN ( MWAWEntry const &  entry)
protected

read the windows positions ( WPSN resource block )

Referenced by readRSRCZones().

libmwaw::DebugFile & GWParser::rsrcAscii ( )
protected

a DebugFile used to write what we recognize when we parse the document in rsrc

Referenced by readARRs(), readDaHS(), readGrDS(), readNxEd(), GWGraph::readPalettes(), GWGraph::readPatterns(), readPrintInfo(), and readWPSN().

MWAWInputStreamPtr GWParser::rsrcInput ( )
protected
bool GWParser::sendHF ( int  id)
protected

try to send the i^th header/footer

bool GWParser::sendPicture ( MWAWEntry const &  entry,
MWAWPosition  pos 
)
protected

try to send a picture

Referenced by GWText::sendZone().

bool GWParser::sendTextbox ( MWAWEntry const &  entry,
bool  inGraphic 
)
protected

try to textbox's text

Referenced by GWGraph::sendTextbox().

Friends And Related Function Documentation

friend class GWGraph
friend

Referenced by init().

friend class GWParserInternal::SubDocument
friend
friend class GWText
friend

Referenced by init().

Member Data Documentation

shared_ptr<GWGraph> GWParser::m_graphParser
protected
shared_ptr<GWText> GWParser::m_textParser
protected

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

Generated on Tue Mar 10 2015 17:32:09 for libmwaw by doxygen 1.8.5