GWParser Class Reference

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

#include <GWParser.hxx>

Inheritance diagram for GWParser:
MWAWParser

List of all members.

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
virtual ~GWParser ()
 destructor
bool checkHeader (MWAWHeader *header, bool strict=false)
 checks if the document header is correct (or not)
void parse (WPXDocumentInterface *documentInterface)
 virtual function used to parse the input

Protected Member Functions

void init ()
 inits all internal variables
void createDocument (WPXDocumentInterface *documentInterface)
 creates the listener which will be associated to the document
Vec2f getPageLeftTop () const
 returns the page left top point ( in inches)
void newPage (int number)
 adds a new page
MWAWSection getMainSection () const
 return the main section
bool sendHF (int id)
 try to send the i^th header/footer
bool canSendTextBoxAsGraphic (MWAWEntry const &entry)
 check if a textbox can be send in a graphic zone, ie. does not contains any graphic
bool sendTextbox (MWAWEntry const &entry, bool inGraphic)
 try to textbox's text
bool sendPicture (MWAWEntry const &entry, MWAWPosition pos)
 try to send a picture
DocType getDocumentType () const
bool createZones ()
 finds the different objects zones
bool createDrawZones ()
 finds the different objects zones ( for a draw file)
bool readRSRCZones ()
 read the resource fork zone
bool readPrintInfo (MWAWEntry const &entry)
 read a PrintInfo block ( PRNT resource block )
bool readWPSN (MWAWEntry const &entry)
 read the windows positions ( WPSN resource block )
bool readDocInfo ()
 read the DocInfo block ( many unknown data )
bool readARRs (MWAWEntry const &entry)
 read a unknown zone ( ARRs resource block: v2 )
bool readDaHS (MWAWEntry const &entry)
 read a unknown zone ( DaHS resource block: v2 )
bool readGrDS (MWAWEntry const &entry)
 read a unknown zone ( GrDS resource block: v2 )
bool readNxEd (MWAWEntry const &entry)
 read a unknown zone ( NxED resource block: v2 )
MWAWInputStreamPtr rsrcInput ()
 return the input input
libmwaw::DebugFilersrcAscii ()
 a DebugFile used to write what we recognize when we parse the document in rsrc

Protected Attributes

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

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().

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().

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


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