| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef LOTUS_CHART_H |
| 23 |
#define LOTUS_CHART_H |
| 24 |
|
| 25 |
#include <ostream> |
| 26 |
#include <string> |
| 27 |
#include <map> |
| 28 |
#include <vector> |
| 29 |
|
| 30 |
#include <librevenge-stream/librevenge-stream.h> |
| 31 |
|
| 32 |
#include "libwps_internal.h" |
| 33 |
|
| 34 |
#include "WPSDebug.h" |
| 35 |
#include "WKSChart.h" |
| 36 |
#include "WKSContentListener.h" |
| 37 |
|
| 38 |
#include "Lotus.h" |
| 39 |
|
| 40 |
namespace LotusChartInternal |
| 41 |
{ |
| 42 |
class Chart; |
| 43 |
struct State; |
| 44 |
} |
| 45 |
|
| 46 |
class LotusStyleManager; |
| 47 |
class WPSGraphicStyle; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
class LotusChart |
| 54 |
{ |
| 55 |
public: |
| 56 |
friend class LotusParser; |
| 57 |
friend class LotusChartInternal::Chart; |
| 58 |
|
| 59 |
|
| 60 |
explicit LotusChart(LotusParser &parser); |
| 61 |
|
| 62 |
void cleanState(); |
| 63 |
|
| 64 |
void updateState(); |
| 65 |
|
| 66 |
~LotusChart(); |
| 67 |
|
| 68 |
void setListener(WKSContentListenerPtr &listen) |
| 69 |
{ |
| 70 |
m_listener = listen; |
| 71 |
} |
| 72 |
|
| 73 |
protected: |
| 74 |
|
| 75 |
int version() const; |
| 76 |
|
| 77 |
|
| 78 |
int getNumCharts() const; |
| 79 |
|
| 80 |
std::map<std::string,int> getNameToChartIdMap() const; |
| 81 |
|
| 82 |
void updateChart(LotusChartInternal::Chart &chart, int id); |
| 83 |
|
| 84 |
bool sendCharts(); |
| 85 |
|
| 86 |
bool sendChart(int cId, WPSPosition const &pos, WPSGraphicStyle const &style); |
| 87 |
|
| 88 |
bool sendText(std::shared_ptr<WPSStream> stream, WPSEntry const &entry); |
| 89 |
|
| 90 |
|
| 91 |
bool readChart(std::shared_ptr<WPSStream> stream); |
| 92 |
|
| 93 |
bool readChartName(std::shared_ptr<WPSStream> stream); |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
bool readMacHeader(std::shared_ptr<WPSStream> stream, long endPos, int &chartId); |
| 99 |
|
| 100 |
bool readMacPlacement(std::shared_ptr<WPSStream> stream, long endPos); |
| 101 |
|
| 102 |
bool readMacLegend(std::shared_ptr<WPSStream> stream, long endPos); |
| 103 |
|
| 104 |
bool readMacPlotArea(std::shared_ptr<WPSStream> stream, long endPos); |
| 105 |
|
| 106 |
bool readMacAxis(std::shared_ptr<WPSStream> stream, long endPos); |
| 107 |
|
| 108 |
bool readMacSerie(std::shared_ptr<WPSStream> stream, long endPos); |
| 109 |
|
| 110 |
bool readMacFloor(std::shared_ptr<WPSStream> stream, long endPos); |
| 111 |
|
| 112 |
bool readMacPosition(std::shared_ptr<WPSStream> stream, long endPos); |
| 113 |
|
| 114 |
|
| 115 |
bool readPlotArea(std::shared_ptr<WPSStream> stream, long endPos); |
| 116 |
|
| 117 |
bool readSerie(std::shared_ptr<WPSStream> stream, long endPos); |
| 118 |
|
| 119 |
bool readSerieName(std::shared_ptr<WPSStream> stream, long endPos); |
| 120 |
|
| 121 |
static bool readSerieWidth(std::shared_ptr<WPSStream> stream, long endPos); |
| 122 |
|
| 123 |
static bool readFontsStyle(std::shared_ptr<WPSStream> stream, long endPos); |
| 124 |
|
| 125 |
bool readFramesStyle(std::shared_ptr<WPSStream> stream, long endPos); |
| 126 |
|
| 127 |
|
| 128 |
bool convert(LotusParser::Link const &link, WKSChart::Position(&positions)[2]) const; |
| 129 |
private: |
| 130 |
LotusChart(LotusChart const &orig) = delete; |
| 131 |
LotusChart &operator=(LotusChart const &orig) = delete; |
| 132 |
std::shared_ptr<WKSContentListener> m_listener; |
| 133 |
|
| 134 |
LotusParser &m_mainParser; |
| 135 |
|
| 136 |
std::shared_ptr<LotusStyleManager> m_styleManager; |
| 137 |
|
| 138 |
std::shared_ptr<LotusChartInternal::State> m_state; |
| 139 |
}; |
| 140 |
|
| 141 |
#endif |
| 142 |
|