RagTimeParser Class Reference documentation

RagTimeParser Class Referencefinal

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

`#include <RagTimeParser.hxx>`

Inheritance diagram for RagTimeParser:

## Public Member Functions
| RagTimeParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor
| ~RagTimeParser () final
| destructor
bool | checkHeader (MWAWHeader *header, bool strict=false) final
| checks if the document header is correct (or not)
void | parse (librevenge::RVNGTextInterface *documentInterface) final
| virtual function used to parse the input
Public Member Functions inherited from MWAWTextParser
| ~MWAWTextParser () override
| destructor
Public Member Functions inherited from MWAWParser
virtual | ~MWAWParser ()
| virtual destructor
int | version () const
| returns the works version
MWAWParserStatePtr | getParserState ()
| returns the parser state
MWAWHeader * | getHeader ()
| returns the header
MWAWInputStreamPtr & | getInput ()
| returns the actual input
MWAWListenerPtr | getMainListener ()
| returns the main listener
MWAWGraphicListenerPtr & | getGraphicListener ()
| returns the graphic listener
MWAWPresentationListenerPtr & | getPresentationListener ()
| returns the presentation listener
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener ()
| returns the spreadsheet listener
MWAWTextListenerPtr & | getTextListener ()
| returns the text listener
MWAWFontConverterPtr & | getFontConverter ()
| returns the font converter
MWAWFontManagerPtr & | getFontManager ()
| returns the font manager
MWAWPageSpan const & | getPageSpan () const
| returns the actual page dimension
MWAWPageSpan & | getPageSpan ()
| 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 )
MWAWRSRCParserPtr & | getRSRCParser ()
| returns the rsrc parser
libmwaw::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document

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

## Protected Attributes
std::shared_ptr< RagTimeParserInternal::State > | m_state
| the state
std::shared_ptr< RagTimeSpreadsheet > | m_spreadsheetParser
| the spreadsheet parser
std::shared_ptr< RagTimeText > | m_textParser
| the text parser

## 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(), and RagTimeSpreadsheet.

## ◆ createDocument()

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

creates the listener which will be associated to the document

Referenced by parse(), and RagTimeSpreadsheet.

## ◆ createZones()

bool RagTimeParser::createZones | ( |  | ) |
| protected

finds the different objects zones

Referenced by parse(), and RagTimeSpreadsheet.

## ◆ findDataZones()

bool RagTimeParser::findDataZones | ( |  | ) |
| protected

try to create the main data zones list

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ findPagesZones()

bool RagTimeParser::findPagesZones | ( |  | ) |
| protected

try to sort the zone on each page

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ findRsrcZones()

bool RagTimeParser::findRsrcZones | ( |  | ) |
| protected

try to create the resource zones list

Referenced by findDataZones(), and RagTimeSpreadsheet.

## ◆ flushExtra()

void RagTimeParser::flushExtra | ( |  | ) |
| protected

flush unsent zone (debugging function)

Referenced by parse(), and RagTimeSpreadsheet.

## ◆ getCharStyle()

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

returns font style corresponding to a char style id

Referenced by RagTimeSpreadsheet.

## ◆ getColor()

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

returns the ith color ( if possible)

Referenced by RagTimeSpreadsheet, readColorTable(), and readDataZoneHeader().

## ◆ getDateTimeFormat()

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

returns the ith date format or ""

Referenced by RagTimeSpreadsheet.

## ◆ getFontId()

int RagTimeParser::getFontId | ( | int | localId | ) | const
| protected

returns a mac font id corresponding to a local id

Referenced by RagTimeSpreadsheet.

## ◆ getNewZoneId()

int RagTimeParser::getNewZoneId | ( |  | ) |
| protected

returns a new unique zone id

Referenced by RagTimeSpreadsheet.

## ◆ getZoneDataFieldSize()

int RagTimeParser::getZoneDataFieldSize | ( | int | zId | ) | const
| protected

returns the size of a zone data field

Referenced by RagTimeSpreadsheet, and readPictZone().

## ◆ init()

void RagTimeParser::init | ( |  | ) |
| protected

inits all internal variables

Referenced by RagTimeParser(), and RagTimeSpreadsheet.

## ◆ newPage()

void RagTimeParser::newPage | ( | int | number | ) |
| protected

adds a new page

Referenced by RagTimeSpreadsheet.

## ◆ parse()

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

virtual function used to parse the input

Implements MWAWTextParser.

Referenced by RagTimeSpreadsheet.

## ◆ readColorMapV2()

bool RagTimeParser::readColorMapV2 | ( | MWAWEntry & | entry | ) |
| protected

try to read the color map:v2

Referenced by findDataZones(), and RagTimeSpreadsheet.

## ◆ readColorsMap()

bool RagTimeParser::readColorsMap | ( |  | ) |
| protected

try to read the color map:v3

Referenced by findDataZones(), and RagTimeSpreadsheet.

## ◆ readColorTable()

bool RagTimeParser::readColorTable | ( | MWAWEntry & | entry | ) |
| protected

try to read the color table zone: CHTa zones

Referenced by RagTimeSpreadsheet, and readColorsMap().

## ◆ readDataZoneHeader()

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

try to read a data zone header

Referenced by findDataZones(), and RagTimeSpreadsheet.

## ◆ readFormatsMap()

bool RagTimeParser::readFormatsMap | ( |  | ) |
| protected

try to read the format map:v3

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readLinks()

bool RagTimeParser::readLinks | ( | MWAWEntry & | entry | ) |
| protected

try to read the File Link zone: FLink

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readMacroFormats()

bool RagTimeParser::readMacroFormats | ( | MWAWEntry & | entry | ) |
| protected

try to read the macro format zone: RTml zones

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ 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(), and RagTimeSpreadsheet.

## ◆ readPictZone()

bool RagTimeParser::readPictZone | ( | MWAWEntry & | entry | ) |
| protected

try to read pictZone ( a big zone)

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readPictZoneV2()

bool RagTimeParser::readPictZoneV2 | ( | MWAWEntry & | entry | ) |
| protected

try to read pictZone ( a big zone):v2

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readPrintInfo()

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

read a printInfo block (a PREC rsrc)

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ 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(), and RagTimeSpreadsheet.

## ◆ readRsrcBtch()

bool RagTimeParser::readRsrcBtch | ( | MWAWEntry & | entry | ) |
| protected

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

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readRsrcCalc()

bool RagTimeParser::readRsrcCalc | ( | MWAWEntry & | entry | ) |
| protected

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

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ 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(), and RagTimeSpreadsheet.

## ◆ readRsrcfppr()

bool RagTimeParser::readRsrcfppr | ( | MWAWEntry & | entry | ) |
| protected

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

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ readRsrcSele()

bool RagTimeParser::readRsrcSele | ( | MWAWEntry & | entry | ) |
| protected

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

Referenced by RagTimeSpreadsheet.

## ◆ readRsrcStructured()

bool RagTimeParser::readRsrcStructured | ( | MWAWEntry & | entry | ) |
| protected

try to read a structured zone

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ 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.

## ◆ readZone6()

bool RagTimeParser::readZone6 | ( | MWAWEntry & | entry | ) |
| protected

try to read zone6 ( a big zone)

Referenced by createZones(), and RagTimeSpreadsheet.

## ◆ send()

bool RagTimeParser::send | ( | int | zId | ) |
| protected

try to send a zone

Referenced by RagTimeSpreadsheet, and sendPageZone().

## ◆ sendBasicPicture()

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

sends a basic shape

Referenced by flushExtra(), RagTimeSpreadsheet, and send().

## ◆ sendBitmap()

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

sends a bitmap

Referenced by RagTimeSpreadsheet, and sendPicture().

## ◆ sendPageZone()

bool RagTimeParser::sendPageZone | ( | int | page | ) |
| protected

try to send the different zones of a page

Referenced by RagTimeSpreadsheet, and sendZones().

## ◆ sendPicture()

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

sends the picture

Referenced by flushExtra(), RagTimeSpreadsheet, and send().

## ◆ sendText()

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

try to send the text zone (interface of RagTimeText)

Referenced by RagTimeSpreadsheet.

## ◆ sendZones()

bool RagTimeParser::sendZones | ( |  | ) |
| protected

try to send the different zones

Referenced by parse(), and RagTimeSpreadsheet.

## Friends And Related Symbol Documentation

## ◆ RagTimeParserInternal::SubDocument

friend class RagTimeParserInternal::SubDocument
| friend

## ◆ RagTimeSpreadsheet

friend class RagTimeSpreadsheet
| friend

Referenced by init(), and RagTimeSpreadsheet.

## ◆ RagTimeText

friend class RagTimeText
| friend

Referenced by init(), and RagTimeText.

## Member Data Documentation

## ◆ m_spreadsheetParser

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

the spreadsheet parser

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

## ◆ m_state

std::shared_ptr<RagTimeParserInternal::State> RagTimeParser::m_state
| protected

the state

Referenced by checkHeader(), createDocument(), createZones(), findDataZones(), findPagesZones(), findRsrcZones(), flushExtra(), getColor(), getNewZoneId(), getZoneDataFieldSize(), init(), newPage(), RagTimeParser(), readColorMapV2(), readColorsMap(), readColorTable(), readDataZoneHeader(), readFormatsMap(), readPictZone(), readPictZoneV2(), send(), sendBasicPicture(), sendPageZone(), sendPicture(), and sendZones().

## ◆ m_textParser

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

the text parser

Referenced by createZones(), getCharStyle(), getFontId(), init(), parse(), RagTimeParser(), readTextZone(), and sendText().

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

- RagTimeParser.hxx
- RagTimeParser.cxx