the main class to read a GreatWorks text file More...
#include <GWParser.hxx>
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::DebugFile & | rsrcAscii () |
| 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< GWGraph > | m_graphParser |
| the graph parser | |
| shared_ptr< GWText > | m_textParser |
| the text parser | |
Friends | |
| class | GWParserInternal::SubDocument |
| class | GWGraph |
| class | GWText |
the main class to read a GreatWorks text file
| enum GWParser::DocType |
| GWParser::GWParser | ( | MWAWInputStreamPtr | input, |
| MWAWRSRCParserPtr | rsrcParser, | ||
| MWAWHeader * | header | ||
| ) |
constructor
| GWParser::~GWParser | ( | ) | [virtual] |
destructor
| 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] |
| 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] |
| 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, |
| bool | inGraphic | ||
| ) | [protected] |
try to textbox's text
Referenced by GWGraph::sendTextbox().
friend class GWParserInternal::SubDocument [friend] |
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 canSendTextBoxAsGraphic(), checkHeader(), createDocument(), createDrawZones(), createZones(), init(), parse(), sendHF(), and sendTextbox().