CWParser Class Reference

the main class to read a Claris Works file More...

#include <CWParser.hxx>

Inheritance diagram for CWParser:
MWAWParser

Public Member Functions

 CWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor
virtual ~CWParser ()
 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
CWStruct::DSET::Type getZoneType (int zId) const
 try to return the type of a zone
bool exploreZonesGraph ()
 try to find the zone dags structure...
bool exploreZonesGraphRec (int zId, std::set< int > &notDoneList)
 try to find the zone tree graph ( DSF) function
void typeMainZones ()
 try to type the main zones
int typeMainZonesRec (int zId, CWStruct::DSET::Type type, int maxHeight)
 try to type the main zones recursif, returns the father id
bool readZone ()
 read a zone
bool readPrintInfo ()
 read the print info zone
bool readStructZone (char const *zoneName, bool hasEntete)
 try to read a structured zone
bool readStructIntZone (char const *zoneName, bool hasEntete, int fSz, std::vector< int > &res)
 try to read a int structured zone where fSz to the int size: 1(int8), 2(int16), 4(int32)
double getTextHeight () const
 returns the page height, ie. paper size less margin (in inches) less header/footer size
Vec2f getPageLeftTop () const
 returns the page left top point ( in inches)
void newPage (int number)
 adds a new page
bool sendZone (int zoneId, MWAWPosition pos=MWAWPosition())
 send a zone
void sendZoneInFrame (int zoneId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList(), WPXPropertyList frameExtras=WPXPropertyList())
 send a zone in a frame
void forceParsed (int zoneId)
 indicate that a zone is already parsed
void sendFootnote (int zoneId)
 creates a document to send a footnote
MWAWSection getMainSection () const
 returns the columns information
bool getColor (int colId, MWAWColor &col) const
 returns the color corresponding to colId (if possible)
float getPatternPercent (int id) const
 return the pattern percent which corresponds to an id (or -1)
void getHeaderFooterId (int &headerId, int &footerId) const
 returns the header/footer id
bool readDocHeader ()
 reads the document header
bool readEndTable ()
 reads the end table ( appears in v3.0 : file version ? )
shared_ptr< CWStruct::DSETreadDSET (bool &complete)
 reads the zone DSET
bool readDSUM (MWAWEntry const &entry, bool inHeader)
bool readTNAM (MWAWEntry const &entry)
bool readSNAP (MWAWEntry const &entry)
bool readCPRT (MWAWEntry const &entry)
void checkOrdering (std::vector< int16_t > &vec16, std::vector< int32_t > &vec32) const
 small fonction used to check unusual endian ordering of a list of int16_t, int32_t
- 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
< CWParserInternal::State
m_state
 the state
bool m_pageSpanSet
 a flag to know if pageSpan is filled
shared_ptr< CWDatabasem_databaseParser
 the database parser
shared_ptr< CWGraphm_graphParser
 the graph parser
shared_ptr< CWPresentationm_presentationParser
 the spreadsheet parser
shared_ptr< CWSpreadsheetm_spreadsheetParser
 the spreadsheet parser
shared_ptr< CWStyleManagerm_styleManager
 the style manager
shared_ptr< CWTablem_tableParser
 the table parser
shared_ptr< CWTextm_textParser
 the text parser

Friends

class CWParserInternal::SubDocument
class CWDatabase
class CWGraph
class CWPresentation
class CWSpreadsheet
class CWStyleManager
class CWTable
class CWText

Detailed Description

the main class to read a Claris Works file

Constructor & Destructor Documentation

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

constructor

CWParser::~CWParser ( )
virtual

destructor

Member Function Documentation

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

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

void CWParser::checkOrdering ( std::vector< int16_t > &  vec16,
std::vector< int32_t > &  vec32 
) const
protected

small fonction used to check unusual endian ordering of a list of int16_t, int32_t

Referenced by CWStyleManager::readGraphStyles(), and CWGraph::readGroupUnknown().

void CWParser::createDocument ( WPXDocumentInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

bool CWParser::createZones ( )
protected

finds the different objects zones

Referenced by parse().

bool CWParser::exploreZonesGraph ( )
protected

try to find the zone dags structure...

Referenced by createZones().

bool CWParser::exploreZonesGraphRec ( int  zId,
std::set< int > &  notDoneList 
)
protected

try to find the zone tree graph ( DSF) function

Referenced by exploreZonesGraph().

void CWParser::forceParsed ( int  zoneId)
protected

indicate that a zone is already parsed

Referenced by CWPresentation::sendZone(), and CWTable::sendZone().

bool CWParser::getColor ( int  colId,
MWAWColor col 
) const
protected

returns the color corresponding to colId (if possible)

Referenced by CWText::readFont(), and CWStyleManager::readGraphStyles().

void CWParser::getHeaderFooterId ( int &  headerId,
int &  footerId 
) const
protected

returns the header/footer id

Referenced by CWGraph::updateInformation().

MWAWSection CWParser::getMainSection ( ) const
protected

returns the columns information

Referenced by CWText::sendText().

Vec2f CWParser::getPageLeftTop ( ) const
protected

returns the page left top point ( in inches)

Referenced by CWGraph::sendZone().

float CWParser::getPatternPercent ( int  id) const
protected

return the pattern percent which corresponds to an id (or -1)

Referenced by CWStyleManager::readGraphStyles().

double CWParser::getTextHeight ( ) const
protected

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

Referenced by CWGraph::updateInformation().

CWStruct::DSET::Type CWParser::getZoneType ( int  zId) const
protected

try to return the type of a zone

Referenced by CWGraph::sendZone().

void CWParser::init ( )
protected

inits all internal variables

Referenced by CWParser().

void CWParser::newPage ( int  number)
protected

adds a new page

Referenced by CWText::sendText(), and CWPresentation::sendZone().

void CWParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

virtual function used to parse the input

Implements MWAWParser.

bool CWParser::readCPRT ( MWAWEntry const &  entry)
protected

Referenced by readEndTable().

bool CWParser::readDocHeader ( )
protected

reads the document header

Referenced by createZones().

shared_ptr< CWStruct::DSET > CWParser::readDSET ( bool &  complete)
protected

reads the zone DSET

set complete to true if we read all the zone

Referenced by readZone().

bool CWParser::readDSUM ( MWAWEntry const &  entry,
bool  inHeader 
)
protected

Referenced by readDocHeader(), and readEndTable().

bool CWParser::readEndTable ( )
protected

reads the end table ( appears in v3.0 : file version ? )

Referenced by createZones().

bool CWParser::readPrintInfo ( )
protected

read the print info zone

Referenced by readDocHeader().

bool CWParser::readSNAP ( MWAWEntry const &  entry)
protected

Referenced by readEndTable().

bool CWParser::readStructIntZone ( char const *  zoneName,
bool  hasEntete,
int  fSz,
std::vector< int > &  res 
)
protected

try to read a int structured zone where fSz to the int size: 1(int8), 2(int16), 4(int32)

Referenced by CWGraph::readGroupHeader().

bool CWParser::readStructZone ( char const *  zoneName,
bool  hasEntete 
)
protected

try to read a structured zone

Referenced by readDocHeader().

bool CWParser::readTNAM ( MWAWEntry const &  entry)
protected

Referenced by readEndTable().

bool CWParser::readZone ( )
protected

read a zone

Referenced by createZones().

void CWParser::sendFootnote ( int  zoneId)
protected

creates a document to send a footnote

Referenced by CWText::sendText().

bool CWParser::sendZone ( int  zoneId,
MWAWPosition  pos = MWAWPosition() 
)
protected
void CWParser::sendZoneInFrame ( int  zoneId,
MWAWPosition  pos,
WPXPropertyList  extras = WPXPropertyList(),
WPXPropertyList  frameExtras = WPXPropertyList() 
)
protected

send a zone in a frame

Referenced by CWGraph::sendZone().

void CWParser::typeMainZones ( )
protected

try to type the main zones

Referenced by createZones().

int CWParser::typeMainZonesRec ( int  zId,
CWStruct::DSET::Type  type,
int  maxHeight 
)
protected

try to type the main zones recursif, returns the father id

Referenced by typeMainZones().

Friends And Related Function Documentation

friend class CWDatabase
friend

Referenced by init().

friend class CWGraph
friend

Referenced by init().

friend class CWParserInternal::SubDocument
friend
friend class CWPresentation
friend

Referenced by init().

friend class CWSpreadsheet
friend

Referenced by init().

friend class CWStyleManager
friend

Referenced by init().

friend class CWTable
friend

Referenced by init().

friend class CWText
friend

Referenced by init().

Member Data Documentation

shared_ptr<CWDatabase> CWParser::m_databaseParser
protected

the database parser

Referenced by createDocument(), init(), and readDSET().

shared_ptr<CWGraph> CWParser::m_graphParser
protected
bool CWParser::m_pageSpanSet
protected

a flag to know if pageSpan is filled

Referenced by readDocHeader(), and readPrintInfo().

shared_ptr<CWPresentation> CWParser::m_presentationParser
protected

the spreadsheet parser

Referenced by createDocument(), init(), parse(), readDSET(), sendZone(), and typeMainZones().

shared_ptr<CWSpreadsheet> CWParser::m_spreadsheetParser
protected

the spreadsheet parser

Referenced by createDocument(), init(), and readDSET().

shared_ptr<CWStyleManager> CWParser::m_styleManager
protected

the style manager

Referenced by init(), and readEndTable().

shared_ptr<CWTable> CWParser::m_tableParser
protected

the table parser

Referenced by createDocument(), init(), parse(), readDSET(), and sendZone().

shared_ptr<CWText> CWParser::m_textParser
protected

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

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