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 More...
 
virtual ~HMWJParser ()
 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...
 
bool createZones ()
 finds the different objects zones in a Hapanese File More...
 
float pageHeight () const
 returns the page height, ie. paper size less margin (in inches) More...
 
float pageWidth () const
 returns the page width, ie. paper size less margin (in inches) More...
 
Vec2f getPageLeftTop () const
 returns the page left top point ( in inches) More...
 
void newPage (int number)
 adds a new page More...
 
bool sendText (long id, long cPos)
 send a text zone More...
 
bool sendZone (long zId)
 send a zone More...
 
bool getColor (int colId, int patternId, MWAWColor &color) const
 returns the color associated with a pattern More...
 
bool checkEntry (MWAWEntry &entry)
 look in entry.begin() to see if a entry exists at this position, if so fills entry.end(), entry.id(), ... More...
 
bool readZonesList ()
 try to read the zones list More...
 
bool readZone (MWAWEntry &entry)
 try to read a generic zone More...
 
bool readClassicHeader (HMWJZoneHeader &header, long endPos=-1)
 try to read a header of classic zone More...
 
bool decodeZone (MWAWEntry const &entry, WPXBinaryData &data)
 try to decode a zone More...
 
bool readPrintInfo (MWAWEntry const &entry)
 try to read a printinfo zone More...
 
bool readHeaderEnd ()
 try to read a unknown zone, just after the header (simillar to HMW Zoneb) More...
 
bool readZoneWithHeader (MWAWEntry const &entry)
 try to read a unknown zones with header data More...
 
bool readZoneA (MWAWEntry const &entry)
 try to read the zone A ( a big zone containing 5 sub zone ? ) More...
 
bool readZoneB (MWAWEntry const &entry)
 try to read the zone B More...
 
bool isFilePos (long pos)
 check if an entry is in file 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...
 
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser More...
 
MWAWContentListenerPtrgetListener ()
 returns the listener 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
< HMWJParserInternal::State
m_state
 the state More...
 
MWAWPageSpan m_pageSpan
 the actual document size More...
 
shared_ptr< HMWJGraphm_graphParser
 the graph parser More...
 
shared_ptr< HMWJTextm_textParser
 the text parser More...
 

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 
)

checks if the document header is correct (or not)

Referenced by MWAWDocumentInternal::checkBasicMacHeader(), and 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::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().

float HMWJParser::pageHeight ( ) const
protected

returns the page height, ie. paper size less margin (in inches)

float HMWJParser::pageWidth ( ) const
protected

returns the page width, ie. paper size less margin (in inches)

void HMWJParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

virtual function used to parse the input

Implements MWAWParser.

Referenced by MWAWDocument::parse().

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::readZoneWithHeader ( MWAWEntry const &  entry)
protected

try to read a unknown zones with header data

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

MWAWPageSpan HMWJParser::m_pageSpan
protected

the actual document size

Referenced by createDocument(), getPageLeftTop(), init(), pageHeight(), pageWidth(), and readPrintInfo().

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 Tue Apr 30 2013 06:31:17 for libmwaw by doxygen 1.8.3.1