RagTimeParser Class Referencefinal

the main class to read a RagTime v2-3 file More...

#include <RagTimeParser.hxx>

Inheritance diagram for RagTimeParser:
MWAWTextParser MWAWParser

Public Member Functions

 RagTimeParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor More...
 
 ~RagTimeParser () final
 destructor More...
 
bool checkHeader (MWAWHeader *header, bool strict=false) final
 checks if the document header is correct (or not) More...
 
void parse (librevenge::RVNGTextInterface *documentInterface) final
 virtual function used to parse the input More...
 
- Public Member Functions inherited from MWAWTextParser
 ~MWAWTextParser () override
 destructor More...
 
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor More...
 
int version () const
 returns the works version More...
 
MWAWParserStatePtr getParserState ()
 returns the parser state More...
 
MWAWHeadergetHeader ()
 returns the header More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWListenerPtr getMainListener ()
 returns the main listener More...
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener More...
 
MWAWPresentationListenerPtrgetPresentationListener ()
 returns the presentation listener More...
 
MWAWSpreadsheetListenerPtrgetSpreadsheetListener ()
 returns the spreadsheet listener More...
 
MWAWTextListenerPtrgetTextListener ()
 returns the text listener More...
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter More...
 
MWAWFontManagerPtrgetFontManager ()
 returns the font manager More...
 
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension More...
 
MWAWPageSpangetPageSpan ()
 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...
 
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser More...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 

Protected Member Functions

void init ()
 inits all internal variables More...
 
bool getColor (int colId, MWAWColor &color, int listId=-1) const
 returns the ith color ( if possible) More...
 
bool getDateTimeFormat (int dtId, std::string &dtFormat) const
 returns the ith date format or "" More...
 
int getZoneDataFieldSize (int zId) const
 returns the size of a zone data field More...
 
int getNewZoneId ()
 returns a new unique zone id More...
 
int getFontId (int localId) const
 returns a mac font id corresponding to a local id More...
 
bool getCharStyle (int charId, MWAWFont &font) const
 returns font style corresponding to a char style id More...
 
bool readTextZone (MWAWEntry &entry, int width, MWAWColor const &fontColor=MWAWColor::black())
 try to read a text zone (knowing the zone width in point and the font color) More...
 
void createDocument (librevenge::RVNGTextInterface *documentInterface)
 creates the listener which will be associated to the document More...
 
bool sendZones ()
 try to send the different zones More...
 
void newPage (int number)
 adds a new page More...
 
bool createZones ()
 finds the different objects zones More...
 
bool findDataZones ()
 try to create the main data zones list More...
 
bool readDataZoneHeader (int id, long endPos)
 try to read a data zone header More...
 
bool findPagesZones ()
 try to sort the zone on each page More...
 
bool findRsrcZones ()
 try to create the resource zones list More...
 
bool sendPageZone (int page)
 try to send the different zones of a page More...
 
bool send (int zId)
 try to send a zone More...
 
bool sendText (int zId, MWAWListenerPtr listener)
 try to send the text zone (interface of RagTimeText) More...
 
bool sendPicture (int zId, MWAWPosition const &pos)
 sends the picture More...
 
bool sendBitmap (RagTimeParserInternal::Picture const &pict, MWAWPosition const &pos)
 sends a bitmap More...
 
bool sendBasicPicture (int zId, MWAWPosition const &pos)
 sends a basic shape More...
 
void flushExtra ()
 flush unsent zone (debugging function) More...
 
bool readPageZone (MWAWEntry &entry)
 try to read page zone ( unknown content of size 40). More...
 
bool readPictZone (MWAWEntry &entry)
 try to read pictZone ( a big zone) More...
 
bool readPictZoneV2 (MWAWEntry &entry)
 try to read pictZone ( a big zone):v2 More...
 
bool readColorMapV2 (MWAWEntry &entry)
 try to read the color map:v2 More...
 
bool readColorsMap ()
 try to read the color map:v3 More...
 
bool readPrintInfo (MWAWEntry &entry, bool inRSRCFork=false)
 read a printInfo block (a PREC rsrc) More...
 
bool readLinks (MWAWEntry &entry)
 try to read the File Link zone: FLink More...
 
bool readFormatsMap ()
 try to read the format map:v3 More...
 
bool readMacroFormats (MWAWEntry &entry)
 try to read the macro format zone: RTml zones More...
 
bool readColorTable (MWAWEntry &entry)
 try to read the color table zone: CHTa zones More...
 
bool readZone6 (MWAWEntry &entry)
 try to read zone6 ( a big zone) More...
 
bool readRsrcBeDc (MWAWEntry &entry)
 try to read the BeDc zone ( zone of size 52, one by file with id=0); More...
 
bool readRsrcStructured (MWAWEntry &entry)
 try to read a structured zone More...
 
bool readRsrcBtch (MWAWEntry &entry)
 try to read the Btch zone (zone with id=0) More...
 
bool readRsrcCalc (MWAWEntry &entry)
 try to read the Calc zone (zone with id=0) More...
 
bool readRsrcfppr (MWAWEntry &entry)
 try to read the fppr zone (zone with id=0) More...
 
bool readRsrcSele (MWAWEntry &entry)
 try to read the Sele zone (zone with id=0), maybe related to selection More...
 
bool readRsrcFHwl (MWAWEntry &entry)
 try to read the FHwl zone ( one by file with id=0), maybe width length? More...
 
- Protected Member Functions inherited from MWAWTextParser
 MWAWTextParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWTextParser (MWAWParserStatePtr const &state)
 constructor using a state More...
 
- Protected Member Functions inherited from MWAWParser
 MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWParser (MWAWParserStatePtr const &state)
 constructor using a state More...
 
void setVersion (int vers)
 sets the document's version More...
 
void setGraphicListener (MWAWGraphicListenerPtr &listener)
 sets the graphic listener More...
 
void resetGraphicListener ()
 resets the listener More...
 
void setPresentationListener (MWAWPresentationListenerPtr &listener)
 sets the presentation listener More...
 
void resetPresentationListener ()
 resets the listener More...
 
void setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener)
 sets the spreadsheet listener More...
 
void resetSpreadsheetListener ()
 resets the listener More...
 
void setTextListener (MWAWTextListenerPtr &listener)
 sets the text listener More...
 
void resetTextListener ()
 resets the listener 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

std::shared_ptr< RagTimeParserInternal::Statem_state
 the state More...
 
std::shared_ptr< RagTimeSpreadsheetm_spreadsheetParser
 the spreadsheet parser More...
 
std::shared_ptr< RagTimeTextm_textParser
 the text parser More...
 

Friends

class RagTimeParserInternal::SubDocument
 
class RagTimeText
 
class RagTimeSpreadsheet
 

Detailed Description

the main class to read a RagTime v2-3 file

Constructor & Destructor Documentation

◆ RagTimeParser()

RagTimeParser::RagTimeParser ( MWAWInputStreamPtr const &  input,
MWAWRSRCParserPtr const &  rsrcParser,
MWAWHeader header 
)

constructor

◆ ~RagTimeParser()

RagTimeParser::~RagTimeParser ( )
final

destructor

Member Function Documentation

◆ checkHeader()

bool RagTimeParser::checkHeader ( MWAWHeader header,
bool  strict = false 
)
finalvirtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

◆ createDocument()

void RagTimeParser::createDocument ( librevenge::RVNGTextInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

◆ createZones()

bool RagTimeParser::createZones ( )
protected

finds the different objects zones

Referenced by parse().

◆ findDataZones()

bool RagTimeParser::findDataZones ( )
protected

try to create the main data zones list

Referenced by createZones().

◆ findPagesZones()

bool RagTimeParser::findPagesZones ( )
protected

try to sort the zone on each page

Referenced by createZones().

◆ findRsrcZones()

bool RagTimeParser::findRsrcZones ( )
protected

try to create the resource zones list

Referenced by findDataZones().

◆ flushExtra()

void RagTimeParser::flushExtra ( )
protected

flush unsent zone (debugging function)

Referenced by parse().

◆ getCharStyle()

bool RagTimeParser::getCharStyle ( int  charId,
MWAWFont font 
) const
protected

returns font style corresponding to a char style id

Referenced by RagTimeSpreadsheet::readResource().

◆ getColor()

bool RagTimeParser::getColor ( int  colId,
MWAWColor color,
int  listId = -1 
) const
protected

returns the ith color ( if possible)

Referenced by readColorTable(), readDataZoneHeader(), RagTimeText::readFonts(), and RagTimeSpreadsheet::readResource().

◆ getDateTimeFormat()

bool RagTimeParser::getDateTimeFormat ( int  dtId,
std::string &  dtFormat 
) const
protected

returns the ith date format or ""

Referenced by RagTimeText::readTokens().

◆ getFontId()

int RagTimeParser::getFontId ( int  localId) const
protected

returns a mac font id corresponding to a local id

Referenced by RagTimeSpreadsheet::readSpreadsheetCellV2().

◆ getNewZoneId()

int RagTimeParser::getNewZoneId ( )
protected

returns a new unique zone id

Referenced by RagTimeSpreadsheet::readSpreadsheetCellContent().

◆ getZoneDataFieldSize()

int RagTimeParser::getZoneDataFieldSize ( int  zId) const
protected

returns the size of a zone data field

Referenced by readPictZone(), RagTimeSpreadsheet::readSpreadsheet(), and RagTimeText::readTextZone().

◆ init()

void RagTimeParser::init ( )
protected

inits all internal variables

Referenced by RagTimeParser().

◆ newPage()

void RagTimeParser::newPage ( int  number)
protected

adds a new page

◆ parse()

void RagTimeParser::parse ( librevenge::RVNGTextInterface *  documentInterface)
finalvirtual

virtual function used to parse the input

Implements MWAWTextParser.

◆ readColorMapV2()

bool RagTimeParser::readColorMapV2 ( MWAWEntry entry)
protected

try to read the color map:v2

Referenced by findDataZones().

◆ readColorsMap()

bool RagTimeParser::readColorsMap ( )
protected

try to read the color map:v3

Referenced by findDataZones().

◆ readColorTable()

bool RagTimeParser::readColorTable ( MWAWEntry entry)
protected

try to read the color table zone: CHTa zones

Referenced by readColorsMap().

◆ readDataZoneHeader()

bool RagTimeParser::readDataZoneHeader ( int  id,
long  endPos 
)
protected

try to read a data zone header

Referenced by findDataZones().

◆ readFormatsMap()

bool RagTimeParser::readFormatsMap ( )
protected

try to read the format map:v3

Referenced by createZones().

◆ readLinks()

bool RagTimeParser::readLinks ( MWAWEntry entry)
protected

try to read the File Link zone: FLink

Referenced by createZones().

◆ readMacroFormats()

bool RagTimeParser::readMacroFormats ( MWAWEntry entry)
protected

try to read the macro format zone: RTml zones

Referenced by createZones().

◆ readPageZone()

bool RagTimeParser::readPageZone ( MWAWEntry entry)
protected

try to read page zone ( unknown content of size 40).

A zone which seems to appear between each page data

Referenced by createZones().

◆ readPictZone()

bool RagTimeParser::readPictZone ( MWAWEntry entry)
protected

try to read pictZone ( a big zone)

Referenced by createZones().

◆ readPictZoneV2()

bool RagTimeParser::readPictZoneV2 ( MWAWEntry entry)
protected

try to read pictZone ( a big zone):v2

Referenced by createZones().

◆ readPrintInfo()

bool RagTimeParser::readPrintInfo ( MWAWEntry entry,
bool  inRSRCFork = false 
)
protected

read a printInfo block (a PREC rsrc)

Referenced by createZones().

◆ readRsrcBeDc()

bool RagTimeParser::readRsrcBeDc ( MWAWEntry entry)
protected

try to read the BeDc zone ( zone of size 52, one by file with id=0);

Referenced by createZones().

◆ readRsrcBtch()

bool RagTimeParser::readRsrcBtch ( MWAWEntry entry)
protected

try to read the Btch zone (zone with id=0)

Referenced by createZones().

◆ readRsrcCalc()

bool RagTimeParser::readRsrcCalc ( MWAWEntry entry)
protected

try to read the Calc zone (zone with id=0)

Referenced by createZones().

◆ readRsrcFHwl()

bool RagTimeParser::readRsrcFHwl ( MWAWEntry entry)
protected

try to read the FHwl zone ( one by file with id=0), maybe width length?

Referenced by createZones().

◆ readRsrcfppr()

bool RagTimeParser::readRsrcfppr ( MWAWEntry entry)
protected

try to read the fppr zone (zone with id=0)

Referenced by createZones().

◆ readRsrcSele()

bool RagTimeParser::readRsrcSele ( MWAWEntry entry)
protected

try to read the Sele zone (zone with id=0), maybe related to selection

◆ readRsrcStructured()

bool RagTimeParser::readRsrcStructured ( MWAWEntry entry)
protected

try to read a structured zone

Referenced by createZones().

◆ readTextZone()

bool RagTimeParser::readTextZone ( MWAWEntry entry,
int  width,
MWAWColor const &  fontColor = MWAWColor::black() 
)
protected

try to read a text zone (knowing the zone width in point and the font color)

Referenced by RagTimeSpreadsheet::send().

◆ readZone6()

bool RagTimeParser::readZone6 ( MWAWEntry entry)
protected

try to read zone6 ( a big zone)

Referenced by createZones().

◆ send()

bool RagTimeParser::send ( int  zId)
protected

try to send a zone

Referenced by sendPageZone().

◆ sendBasicPicture()

bool RagTimeParser::sendBasicPicture ( int  zId,
MWAWPosition const &  pos 
)
protected

sends a basic shape

Referenced by flushExtra(), and send().

◆ sendBitmap()

bool RagTimeParser::sendBitmap ( RagTimeParserInternal::Picture const &  pict,
MWAWPosition const &  pos 
)
protected

sends a bitmap

Referenced by sendPicture().

◆ sendPageZone()

bool RagTimeParser::sendPageZone ( int  page)
protected

try to send the different zones of a page

Referenced by sendZones().

◆ sendPicture()

bool RagTimeParser::sendPicture ( int  zId,
MWAWPosition const &  pos 
)
protected

sends the picture

Referenced by flushExtra(), and send().

◆ sendText()

bool RagTimeParser::sendText ( int  zId,
MWAWListenerPtr  listener 
)
protected

try to send the text zone (interface of RagTimeText)

Referenced by RagTimeSpreadsheet::send().

◆ sendZones()

bool RagTimeParser::sendZones ( )
protected

try to send the different zones

Referenced by parse().

Friends And Related Function Documentation

◆ RagTimeParserInternal::SubDocument

◆ RagTimeSpreadsheet

friend class RagTimeSpreadsheet
friend

Referenced by init().

◆ RagTimeText

friend class RagTimeText
friend

Referenced by init().

Member Data Documentation

◆ m_spreadsheetParser

std::shared_ptr<RagTimeSpreadsheet> RagTimeParser::m_spreadsheetParser
protected

the spreadsheet parser

Referenced by createZones(), getDateTimeFormat(), init(), parse(), readFormatsMap(), and send().

◆ m_state

◆ m_textParser

std::shared_ptr<RagTimeText> RagTimeParser::m_textParser
protected

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

Generated on Fri Sep 18 2020 18:14:52 for libmwaw by doxygen 1.8.20