LotusChart Class Reference

This class parses Microsoft Works chart file. More...

#include <LotusChart.h>

Public Member Functions

 LotusChart (LotusParser &parser)
 constructor More...
 
void cleanState ()
 clean internal state More...
 
void updateState ()
 update internal state (must be called one time before sending data) More...
 
 ~LotusChart ()
 destructor More...
 
void setListener (WKSContentListenerPtr &listen)
 sets the listener More...
 

Protected Member Functions

int version () const
 return the file version More...
 
int getNumCharts () const
 return the number of chart More...
 
std::map< std::string, int > getNameToChartIdMap () const
 returns a map chart name to chart id map More...
 
void updateChart (LotusChartInternal::Chart &chart, int id)
 update a chart, so that it can be send More...
 
bool sendCharts ()
 try to send the charts(for Windows .wk3 file) More...
 
bool sendChart (int cId, WPSPosition const &pos, WPSGraphicStyle const &style)
 try to send a chart More...
 
bool sendText (std::shared_ptr< WPSStream > stream, WPSEntry const &entry)
 try to send the text More...
 
bool readChart (std::shared_ptr< WPSStream > stream)
 reads a structure which define a chart: 11 More...
 
bool readChartName (std::shared_ptr< WPSStream > stream)
 reads the chart name or title: 12 More...
 
bool readMacHeader (std::shared_ptr< WPSStream > stream, long endPos, int &chartId)
 reads a chart data: 2710 (wk3mac) More...
 
bool readMacPlacement (std::shared_ptr< WPSStream > stream, long endPos)
 reads a placement position(wk3mac): 2774 More...
 
bool readMacLegend (std::shared_ptr< WPSStream > stream, long endPos)
 reads a legend position(wk3mac): 277e More...
 
bool readMacPlotArea (std::shared_ptr< WPSStream > stream, long endPos)
 reads a plot area position(wk3mac): 2788 More...
 
bool readMacAxis (std::shared_ptr< WPSStream > stream, long endPos)
 reads an axis style(wk3mac): 27d8 More...
 
bool readMacSerie (std::shared_ptr< WPSStream > stream, long endPos)
 reads a serie style(wk3mac): 27e2 More...
 
bool readMacFloor (std::shared_ptr< WPSStream > stream, long endPos)
 reads a 3D floor style(wk3mac): 2846 More...
 
bool readMacPosition (std::shared_ptr< WPSStream > stream, long endPos)
 reads a manual position(wk3mac): 2904 More...
 
bool readPlotArea (std::shared_ptr< WPSStream > stream, long endPos)
 reads a plot area style: 2a30 (unsure) More...
 
bool readSerie (std::shared_ptr< WPSStream > stream, long endPos)
 reads a serie style: 2a31 More...
 
bool readSerieName (std::shared_ptr< WPSStream > stream, long endPos)
 reads a serie name: 2a32 (serie 6-...) More...
 
bool readSerieWidth (std::shared_ptr< WPSStream > stream, long endPos)
 reads a serie width style: 2a33 More...
 
bool readFontsStyle (std::shared_ptr< WPSStream > stream, long endPos)
 reads a list of font style: 2a34 More...
 
bool readFramesStyle (std::shared_ptr< WPSStream > stream, long endPos)
 reads a some frame styles: 2a35 More...
 
bool convert (LotusParser::Link const &link, WKSChart::Position(&positions)[2]) const
 convert a link zone in a chart position(if possible) More...
 

Private Member Functions

 LotusChart (LotusChart const &orig)=delete
 
LotusChartoperator= (LotusChart const &orig)=delete
 

Private Attributes

std::shared_ptr< WKSContentListenerm_listener
 
LotusParserm_mainParser
 the listener (if set) More...
 
std::shared_ptr< LotusStyleManagerm_styleManager
 the style manager More...
 
std::shared_ptr< LotusChartInternal::Statem_state
 the internal state More...
 

Friends

class LotusParser
 
class LotusChartInternal::Chart
 

Detailed Description

This class parses Microsoft Works chart file.

Constructor & Destructor Documentation

◆ LotusChart() [1/2]

LotusChart::LotusChart ( LotusParser parser)
explicit

constructor

◆ ~LotusChart()

LotusChart::~LotusChart ( )

destructor

◆ LotusChart() [2/2]

LotusChart::LotusChart ( LotusChart const &  orig)
privatedelete

Member Function Documentation

◆ cleanState()

void LotusChart::cleanState ( )

clean internal state

◆ convert()

bool LotusChart::convert ( LotusParser::Link const &  link,
WKSChart::Position(&)  positions[2] 
) const
protected

convert a link zone in a chart position(if possible)

Referenced by updateChart().

◆ getNameToChartIdMap()

std::map< std::string, int > LotusChart::getNameToChartIdMap ( ) const
protected

returns a map chart name to chart id map

◆ getNumCharts()

int LotusChart::getNumCharts ( ) const
protected

return the number of chart

◆ operator=()

LotusChart& LotusChart::operator= ( LotusChart const &  orig)
privatedelete

◆ readChart()

bool LotusChart::readChart ( std::shared_ptr< WPSStream stream)
protected

reads a structure which define a chart: 11

◆ readChartName()

bool LotusChart::readChartName ( std::shared_ptr< WPSStream stream)
protected

reads the chart name or title: 12

◆ readFontsStyle()

bool LotusChart::readFontsStyle ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a list of font style: 2a34

◆ readFramesStyle()

bool LotusChart::readFramesStyle ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a some frame styles: 2a35

◆ readMacAxis()

bool LotusChart::readMacAxis ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads an axis style(wk3mac): 27d8

◆ readMacFloor()

bool LotusChart::readMacFloor ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a 3D floor style(wk3mac): 2846

◆ readMacHeader()

bool LotusChart::readMacHeader ( std::shared_ptr< WPSStream stream,
long  endPos,
int &  chartId 
)
protected

reads a chart data: 2710 (wk3mac)

◆ readMacLegend()

bool LotusChart::readMacLegend ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a legend position(wk3mac): 277e

◆ readMacPlacement()

bool LotusChart::readMacPlacement ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a placement position(wk3mac): 2774

◆ readMacPlotArea()

bool LotusChart::readMacPlotArea ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a plot area position(wk3mac): 2788

◆ readMacPosition()

bool LotusChart::readMacPosition ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a manual position(wk3mac): 2904

◆ readMacSerie()

bool LotusChart::readMacSerie ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a serie style(wk3mac): 27e2

◆ readPlotArea()

bool LotusChart::readPlotArea ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a plot area style: 2a30 (unsure)

◆ readSerie()

bool LotusChart::readSerie ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a serie style: 2a31

◆ readSerieName()

bool LotusChart::readSerieName ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a serie name: 2a32 (serie 6-...)

◆ readSerieWidth()

bool LotusChart::readSerieWidth ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a serie width style: 2a33

◆ sendChart()

bool LotusChart::sendChart ( int  cId,
WPSPosition const &  pos,
WPSGraphicStyle const &  style 
)
protected

try to send a chart

Referenced by sendCharts().

◆ sendCharts()

bool LotusChart::sendCharts ( )
protected

try to send the charts(for Windows .wk3 file)

◆ sendText()

bool LotusChart::sendText ( std::shared_ptr< WPSStream stream,
WPSEntry const &  entry 
)
protected

try to send the text

Referenced by LotusChartInternal::Chart::sendContent().

◆ setListener()

void LotusChart::setListener ( WKSContentListenerPtr listen)
inline

sets the listener

◆ updateChart()

void LotusChart::updateChart ( LotusChartInternal::Chart chart,
int  id 
)
protected

update a chart, so that it can be send

Referenced by updateState().

◆ updateState()

void LotusChart::updateState ( )

update internal state (must be called one time before sending data)

◆ version()

int LotusChart::version ( ) const
protected

return the file version

Referenced by readSerie(), updateChart(), and updateState().

Friends And Related Function Documentation

◆ LotusChartInternal::Chart

friend class LotusChartInternal::Chart
friend

◆ LotusParser

friend class LotusParser
friend

Member Data Documentation

◆ m_listener

std::shared_ptr<WKSContentListener> LotusChart::m_listener
private

◆ m_mainParser

LotusParser& LotusChart::m_mainParser
private

the listener (if set)

the main parser

Referenced by convert(), readChart(), readChartName(), readSerieName(), sendText(), updateChart(), and version().

◆ m_state

◆ m_styleManager

std::shared_ptr<LotusStyleManager> LotusChart::m_styleManager
private

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

Generated on Fri May 27 2022 03:07:00 for libwps by doxygen 1.8.14