LotusParser Class Reference

This class parses a WK2..WK4 Lotus spreadsheet. More...

#include <Lotus.h>

Inheritance diagram for LotusParser:
WKSParser

Public Member Functions

 LotusParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=0)
 constructor
 ~LotusParser ()
 destructor
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface)
 called by WPSDocument to parse the file
bool checkHeader (WPSHeader *header, bool strict=false)
 checks if the document header is correct (or not)
Public Member Functions inherited from WKSParser
 WKSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
virtual ~WKSParser ()

Protected Member Functions

int version () const
 return the file version
bool getFont (int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
 returns the font corresponding to an id
libwps_tools_win::Font::Type getDefaultFontType () const
 returns the default font type, ie.
bool hasGraphics (int sheetId) const
 return true if the sheet sheetId has some graphic
void sendGraphics (int sheetId)
 send the graphics corresponding to a sheetId
bool getLeftTopPosition (Vec2i const &cell, int spreadsheet, Vec2f &pos) const
 returns the left top position of a cell
bool updateEmbeddedObject (int id, WPSEmbeddedObject &object) const
 try to retrieve the content of a graphic, knowing it local id
bool createZones ()
 try to parse the different zones
bool createListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener
bool parseFormatStream ()
 check for the existence of a format stream, if it exists, parse it
bool checkHeader (shared_ptr< WPSStream > stream, bool mainStream, bool strict)
 checks if the document header is correct (or not)
bool readZones (shared_ptr< WPSStream > stream)
 finds the different zones (spreadsheet, chart, print, ...)
bool readDataZone (shared_ptr< WPSStream > stream)
 parse the different zones 1B
bool readZone (shared_ptr< WPSStream > stream)
 reads a zone
bool readZone1 (shared_ptr< WPSStream > stream)
 reads a zone of type 1: 123 files
bool readSheetZone (shared_ptr< WPSStream > stream)
 reads a zone of type 2: 123 files
bool readZone4 (shared_ptr< WPSStream > stream)
 reads a zone of type 4: 123 files
bool readChartZone (shared_ptr< WPSStream > stream)
 reads a zone of type 5: 123 files
bool readRefZone (shared_ptr< WPSStream > stream)
 reads a zone of type 6: 123 files
bool readZone7 (shared_ptr< WPSStream > stream)
 reads a zone of type 7: 123 files
bool readZone8 (shared_ptr< WPSStream > stream)
 reads a zone of type 8: 123 files
bool readVersionZone (shared_ptr< WPSStream > stream)
 reads a zone of type a: 123 files
bool readZoneV3 (shared_ptr< WPSStream > stream)
 parse a wk123 zone
bool readMacFontName (shared_ptr< WPSStream > stream, long endPos)
 reads a mac font name
bool readFMTStyleName (shared_ptr< WPSStream > stream)
 reads a format style name: b6
bool readLinkZone (shared_ptr< WPSStream > stream)
 reads a link
bool readDocumentInfoMac (shared_ptr< WPSStream > stream, long endPos)
 reads a mac document info zone: zone 1b, then 2af8
bool readChartDefinition (shared_ptr< WPSStream > stream)
 reads a chart definitions
bool readChartName (shared_ptr< WPSStream > stream)
 reads the chart name or title
Protected Member Functions inherited from WKSParser
RVNGInputStreamPtr & getInput ()
void resetInput (RVNGInputStreamPtr newInput)
RVNGInputStreamPtr getFileInput ()
WPSHeaderPtr & getHeader ()
int version () const
void setVersion (int vers)
libwps::DebugFile & ascii ()
 a DebugFile used to write what we recognize when we parse the document

Static Protected Member Functions

static RVNGInputStreamPtr decodeStream (RVNGInputStreamPtr input, long endPos, std::vector< uint8_t > const &key)
 try to decode a stream, if successful, replace the stream'input by the new one
static std::vector< uint8_t > retrievePasswordKeys (std::vector< uint8_t > const &fileKeys)
 try to guess a password knowing its file keys. Returns the keys if it founds a valid password

Protected Attributes

shared_ptr< WKSContentListener > m_listener
shared_ptr< LotusParserInternal::State > m_state
 the listener (if set)
shared_ptr< LotusStyleManager > m_styleManager
 the style manager
shared_ptr< LotusGraph > m_graphParser
 the graph manager
shared_ptr< LotusSpreadsheet > m_spreadsheetParser
 the spreadsheet manager
shared_ptr< WPSOLE1Parser > m_ole1Parser
 the ole1 parser

Friends

class LotusParserInternal::SubDocument
class LotusGraph
class LotusSpreadsheet
class LotusStyleManager

Detailed Description

This class parses a WK2..WK4 Lotus spreadsheet.

Constructor & Destructor Documentation

◆ LotusParser()

LotusParser::LotusParser ( RVNGInputStreamPtr & input,
WPSHeaderPtr & header,
libwps_tools_win::Font::Type encoding = libwps_tools_win::Font::UNKNOWN,
char const * password = 0 )

constructor

Referenced by LotusStyleManager, and libwps::WPSDocument::parse().

◆ ~LotusParser()

LotusParser::~LotusParser ( )

destructor

Member Function Documentation

◆ checkHeader() [1/2]

bool LotusParser::checkHeader ( shared_ptr< WPSStream > stream,
bool mainStream,
bool strict )
protected

checks if the document header is correct (or not)

◆ checkHeader() [2/2]

bool LotusParser::checkHeader ( WPSHeader * header,
bool strict = false )

checks if the document header is correct (or not)

Referenced by checkHeader(), libwps::WPSDocument::isFileFormatSupported(), LotusStyleManager, parse(), and parseFormatStream().

◆ createListener()

bool LotusParser::createListener ( librevenge::RVNGSpreadsheetInterface * interface)
protected

creates the main listener

Referenced by LotusStyleManager, and parse().

◆ createZones()

bool LotusParser::createZones ( )
protected

try to parse the different zones

Referenced by LotusStyleManager, and parse().

◆ decodeStream()

RVNGInputStreamPtr LotusParser::decodeStream ( RVNGInputStreamPtr input,
long endPos,
std::vector< uint8_t > const & key )
staticprotected

try to decode a stream, if successful, replace the stream'input by the new one

Referenced by LotusStyleManager, and readZone().

◆ getDefaultFontType()

◆ getFont()

bool LotusParser::getFont ( int id,
WPSFont & font,
libwps_tools_win::Font::Type & type ) const
protected

◆ getLeftTopPosition()

bool LotusParser::getLeftTopPosition ( Vec2i const & cell,
int spreadsheet,
Vec2f & pos ) const
protected

returns the left top position of a cell

Referenced by LotusStyleManager, and LotusGraph::sendGraphics().

◆ hasGraphics()

bool LotusParser::hasGraphics ( int sheetId) const
protected

return true if the sheet sheetId has some graphic

Referenced by LotusStyleManager.

◆ parse()

void LotusParser::parse ( librevenge::RVNGSpreadsheetInterface * documentInterface)
virtual

called by WPSDocument to parse the file

Implements WKSParser.

Referenced by LotusStyleManager.

◆ parseFormatStream()

bool LotusParser::parseFormatStream ( )
protected

check for the existence of a format stream, if it exists, parse it

Referenced by createZones(), and LotusStyleManager.

◆ readChartDefinition()

bool LotusParser::readChartDefinition ( shared_ptr< WPSStream > stream)
protected

reads a chart definitions

Referenced by LotusStyleManager, and readZone().

◆ readChartName()

bool LotusParser::readChartName ( shared_ptr< WPSStream > stream)
protected

reads the chart name or title

Referenced by LotusStyleManager, and readZone().

◆ readChartZone()

bool LotusParser::readChartZone ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 5: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readDataZone()

bool LotusParser::readDataZone ( shared_ptr< WPSStream > stream)
protected

parse the different zones 1B

Referenced by LotusStyleManager, and readZone().

◆ readDocumentInfoMac()

bool LotusParser::readDocumentInfoMac ( shared_ptr< WPSStream > stream,
long endPos )
protected

reads a mac document info zone: zone 1b, then 2af8

Referenced by LotusStyleManager, and readDataZone().

◆ readFMTStyleName()

bool LotusParser::readFMTStyleName ( shared_ptr< WPSStream > stream)
protected

reads a format style name: b6

Referenced by LotusStyleManager, and readZone().

◆ readLinkZone()

bool LotusParser::readLinkZone ( shared_ptr< WPSStream > stream)
protected

reads a link

Referenced by LotusStyleManager, and readZone().

◆ readMacFontName()

bool LotusParser::readMacFontName ( shared_ptr< WPSStream > stream,
long endPos )
protected

reads a mac font name

Referenced by LotusStyleManager, and readDataZone().

◆ readRefZone()

bool LotusParser::readRefZone ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 6: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readSheetZone()

bool LotusParser::readSheetZone ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 2: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readVersionZone()

bool LotusParser::readVersionZone ( shared_ptr< WPSStream > stream)
protected

reads a zone of type a: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readZone()

bool LotusParser::readZone ( shared_ptr< WPSStream > stream)
protected

reads a zone

Referenced by checkHeader(), LotusStyleManager, and readZones().

◆ readZone1()

bool LotusParser::readZone1 ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 1: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readZone4()

bool LotusParser::readZone4 ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 4: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readZone7()

bool LotusParser::readZone7 ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 7: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readZone8()

bool LotusParser::readZone8 ( shared_ptr< WPSStream > stream)
protected

reads a zone of type 8: 123 files

Referenced by LotusStyleManager, and readZone().

◆ readZones()

bool LotusParser::readZones ( shared_ptr< WPSStream > stream)
protected

finds the different zones (spreadsheet, chart, print, ...)

Referenced by createZones(), LotusStyleManager, and parseFormatStream().

◆ readZoneV3()

bool LotusParser::readZoneV3 ( shared_ptr< WPSStream > stream)
protected

parse a wk123 zone

Referenced by LotusStyleManager, and readZone().

◆ retrievePasswordKeys()

std::vector< uint8_t > LotusParser::retrievePasswordKeys ( std::vector< uint8_t > const & fileKeys)
staticprotected

try to guess a password knowing its file keys. Returns the keys if it founds a valid password

Referenced by LotusStyleManager, and readZone().

◆ sendGraphics()

void LotusParser::sendGraphics ( int sheetId)
protected

send the graphics corresponding to a sheetId

Referenced by LotusStyleManager, and LotusSpreadsheet::sendSpreadsheet().

◆ updateEmbeddedObject()

bool LotusParser::updateEmbeddedObject ( int id,
WPSEmbeddedObject & object ) const
protected

try to retrieve the content of a graphic, knowing it local id

Referenced by LotusStyleManager, and LotusGraph::sendGraphics().

◆ version()

int LotusParser::version ( ) const
protected

◆ LotusGraph

friend class LotusGraph
friend

Referenced by LotusGraph.

◆ LotusParserInternal::SubDocument

friend class LotusParserInternal::SubDocument
friend

◆ LotusSpreadsheet

friend class LotusSpreadsheet
friend

Referenced by LotusSpreadsheet.

◆ LotusStyleManager

friend class LotusStyleManager
friend

Referenced by LotusStyleManager.

Member Data Documentation

◆ m_graphParser

shared_ptr<LotusGraph> LotusParser::m_graphParser
protected

◆ m_listener

shared_ptr<WKSContentListener> LotusParser::m_listener
protected

Referenced by createListener(), LotusParser(), and parse().

◆ m_ole1Parser

shared_ptr<WPSOLE1Parser> LotusParser::m_ole1Parser
protected

the ole1 parser

Referenced by createZones(), LotusParser(), and updateEmbeddedObject().

◆ m_spreadsheetParser

shared_ptr<LotusSpreadsheet> LotusParser::m_spreadsheetParser
protected

◆ m_state

◆ m_styleManager

shared_ptr<LotusStyleManager> LotusParser::m_styleManager
protected

the style manager

Referenced by createZones(), LotusParser(), parse(), readDataZone(), and readZone().


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

Generated on for libwps by doxygen 1.18.0