HMWJParser Class Reference

the main class to read a HanMac Word-J file More...

#include <HMWJParser.hxx>

Inheritance diagram for HMWJParser:
MWAWParser

Public Member Functions

 HMWJParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor
virtual ~HMWJParser ()
 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
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor
int version () const
 returns the works version
void setVersion (int vers)
 sets the works version

Protected Member Functions

void init ()
 inits all internal variables
void createDocument (WPXDocumentInterface *documentInterface)
 creates the listener which will be associated to the document
bool createZones ()
 finds the different objects zones in a Hapanese File
Vec2f getPageLeftTop () const
 returns the page left top point ( in inches)
void newPage (int number)
 adds a new page
bool sendText (long id, long cPos)
 send a text zone
bool sendZone (long zId)
 send a zone
bool getColor (int colId, int patternId, MWAWColor &color) const
 returns the color associated with a pattern
bool checkEntry (MWAWEntry &entry)
 look in entry.begin() to see if a entry exists at this position, if so fills entry.end(), entry.id(), ...
bool readZonesList ()
 try to read the zones list
bool readZone (MWAWEntry &entry)
 try to read a generic zone
bool readClassicHeader (HMWJZoneHeader &header, long endPos=-1)
 try to read a header of classic zone
bool decodeZone (MWAWEntry const &entry, WPXBinaryData &data)
 try to decode a zone
bool readPrintInfo (MWAWEntry const &entry)
 try to read a printinfo zone
bool readHeaderEnd ()
 try to read a unknown zone, just after the header (simillar to HMW Zoneb)
bool readZoneA (MWAWEntry const &entry)
 try to read the zone A ( a big zone containing 5 sub zone ? )
bool readZoneB (MWAWEntry const &entry)
 try to read the zone B
bool isFilePos (long pos)
 check if an entry is in file
- Protected Member Functions inherited from MWAWParser
 MWAWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor (protected)
 MWAWParser (MWAWParserStatePtr state)
 constructor using a state
MWAWParserStatePtr getParserState ()
 returns the parser state
MWAWHeadergetHeader ()
 returns the header
MWAWInputStreamPtrgetInput ()
 returns the actual input
MWAWContentListenerPtrgetListener ()
 returns the listener
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension
MWAWPageSpangetPageSpan ()
 returns the actual page dimension
double getFormLength () const
 returns the form length
double getFormWidth () const
 returns the form width
double getPageLength () const
 returns the page length (form length without margin )
double getPageWidth () const
 returns the page width (form width without margin )
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser
void setListener (MWAWContentListenerPtr &listener)
 sets the listener
void resetListener ()
 resets the listener
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter
void setFontConverter (MWAWFontConverterPtr fontConverter)
 sets the font convertor
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document
void setAsciiName (char const *name)
 Debugging: change the default ascii file.
std::string const & asciiName () const
 return the ascii file name

Protected Attributes

shared_ptr
< HMWJParserInternal::State
m_state
 the state
shared_ptr< HMWJGraphm_graphParser
 the graph parser
shared_ptr< HMWJTextm_textParser
 the text parser

Friends

class HMWJGraph
class HMWJText
class HMWJParserInternal::SubDocument

Detailed Description

the main class to read a HanMac Word-J file

Constructor & Destructor Documentation

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

constructor

HMWJParser::~HMWJParser ( )
virtual

destructor

Member Function Documentation

bool HMWJParser::checkEntry ( MWAWEntry entry)
protected

look in entry.begin() to see if a entry exists at this position, if so fills entry.end(), entry.id(), ...

Referenced by createZones(), and readZonesList().

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

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

void HMWJParser::createDocument ( WPXDocumentInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

bool HMWJParser::createZones ( )
protected

finds the different objects zones in a Hapanese File

Referenced by parse().

bool HMWJParser::decodeZone ( MWAWEntry const &  entry,
WPXBinaryData &  data 
)
protected

try to decode a zone

Referenced by HMWJText::computeNumPages(), and HMWJText::sendText().

bool HMWJParser::getColor ( int  colId,
int  patternId,
MWAWColor color 
) const
protected

returns the color associated with a pattern

Referenced by HMWJText::readFont(), and HMWJText::readParagraph().

Vec2f HMWJParser::getPageLeftTop ( ) const
protected

returns the page left top point ( in inches)

void HMWJParser::init ( )
protected

inits all internal variables

Referenced by HMWJParser().

bool HMWJParser::isFilePos ( long  pos)
protected
void HMWJParser::newPage ( int  number)
protected

adds a new page

Referenced by HMWJText::sendText().

void HMWJParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

virtual function used to parse the input

Implements MWAWParser.

bool HMWJParser::readHeaderEnd ( )
protected

try to read a unknown zone, just after the header (simillar to HMW Zoneb)

Referenced by createZones().

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

try to read a printinfo zone

Referenced by checkHeader().

bool HMWJParser::readZone ( MWAWEntry entry)
protected

try to read a generic zone

Referenced by createZones().

bool HMWJParser::readZoneA ( MWAWEntry const &  entry)
protected

try to read the zone A ( a big zone containing 5 sub zone ? )

Referenced by readZone().

bool HMWJParser::readZoneB ( MWAWEntry const &  entry)
protected

try to read the zone B

Referenced by readZone().

bool HMWJParser::readZonesList ( )
protected

try to read the zones list

Referenced by createZones().

bool HMWJParser::sendText ( long  id,
long  cPos 
)
protected
bool HMWJParser::sendZone ( long  zId)
protected

send a zone

Referenced by HMWJText::sendText().

Friends And Related Function Documentation

friend class HMWJGraph
friend

Referenced by init().

friend class HMWJParserInternal::SubDocument
friend
friend class HMWJText
friend

Referenced by init().

Member Data Documentation

shared_ptr<HMWJGraph> HMWJParser::m_graphParser
protected

the graph parser

Referenced by createDocument(), createZones(), getColor(), init(), parse(), readZone(), and sendZone().

shared_ptr<HMWJParserInternal::State> HMWJParser::m_state
protected
shared_ptr<HMWJText> HMWJParser::m_textParser
protected

the text parser

Referenced by createDocument(), createZones(), init(), parse(), readZone(), and sendText().


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

Generated on Wed May 22 2013 18:12:45 for libmwaw by doxygen 1.8.1.2