GWParser Class Reference

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

`#include <GWParser.hxx>`

Inheritance diagram for GWParser:

## 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 | sendTextbox (MWAWEntry const &entry)
| 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::DebugFile & | rsrcAscii ()
| 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...
MWAWHeader * | getHeader ()
| returns the header More...
MWAWInputStreamPtr & | getInput ()
| returns the actual input More...
MWAWContentListenerPtr & | getListener ()
| returns the listener More...
MWAWPageSpan const & | getPageSpan () const
| returns the actual page dimension More...
MWAWPageSpan & | getPageSpan ()
| 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...
MWAWRSRCParserPtr & | getRSRCParser ()
| returns the rsrc parser More...
void | setListener (MWAWContentListenerPtr &listener)
| sets the listener More...
void | resetListener ()
| resets the listener More...
MWAWFontConverterPtr & | getFontConverter ()
| returns the font converter More...
void | setFontConverter (MWAWFontConverterPtr fontConverter)
| sets the font convertor More...
libmwaw::DebugFile & | ascii ()
| 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< GWGraph > | m_graphParser
| the graph parser More...
shared_ptr< GWText > | m_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

enum GWParser::DocType

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

GWParser::DocType GWParser::getDocumentType | ( |  | ) | const

protected

Referenced by createZones(), GWGraph::findGraphicZone(), GWGraph::isGraphicZone(), GWGraph::isPageFrames(), GWGraph::readGraphicZone(), GWGraph::readPageFrames(), GWGraph::sendFrame(), and GWGraph::sendPageFrames().

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

return the input input

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

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

the graph parser

Referenced by createDocument(), createDrawZones(), createZones(), init(), parse(), readRSRCZones(), and sendPicture().

shared_ptr<GWParserInternal::State> GWParser::m_state

protected

the state

Referenced by checkHeader(), createDocument(), createZones(), getDocumentType(), getMainSection(), getPageLeftTop(), init(), newPage(), and readDocInfo().

shared_ptr<GWText> GWParser::m_textParser

protected

the text parser

Referenced by checkHeader(), createDocument(), createDrawZones(), createZones(), init(), parse(), sendHF(), and sendTextbox().

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

- GWParser.hxx
- GWParser.cxx