| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef QUATTRO_DOS_CHART_H |
| 23 |
#define QUATTRO_DOS_CHART_H |
| 24 |
|
| 25 |
#include <ostream> |
| 26 |
#include <map> |
| 27 |
#include <vector> |
| 28 |
|
| 29 |
#include <librevenge-stream/librevenge-stream.h> |
| 30 |
|
| 31 |
#include "libwps_internal.h" |
| 32 |
|
| 33 |
#include "WPSDebug.h" |
| 34 |
#include "WKSContentListener.h" |
| 35 |
|
| 36 |
namespace QuattroDosChartInternal |
| 37 |
{ |
| 38 |
class Chart; |
| 39 |
struct State; |
| 40 |
|
| 41 |
} |
| 42 |
|
| 43 |
class QuattroDosParser; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
class QuattroDosChart |
| 50 |
{ |
| 51 |
public: |
| 52 |
friend class QuattroDosParser; |
| 53 |
friend class QuattroDosChartInternal::Chart; |
| 54 |
|
| 55 |
|
| 56 |
explicit QuattroDosChart(QuattroDosParser &parser); |
| 57 |
|
| 58 |
~QuattroDosChart(); |
| 59 |
|
| 60 |
void setListener(WKSContentListenerPtr &listen) |
| 61 |
{ |
| 62 |
m_listener = listen; |
| 63 |
} |
| 64 |
|
| 65 |
bool readChartSetType(); |
| 66 |
|
| 67 |
bool readChartName(); |
| 68 |
|
| 69 |
bool readChart(); |
| 70 |
|
| 71 |
|
| 72 |
int getNumSpreadsheets() const; |
| 73 |
|
| 74 |
void getChartPositionMap(int sheetId, std::map<Vec2i,Vec2i> &cellMap) const; |
| 75 |
|
| 76 |
bool sendChart(int sheetId, Vec2i const &cell, Vec2f const &chartSize); |
| 77 |
protected: |
| 78 |
|
| 79 |
bool checkFilePosition(long pos); |
| 80 |
|
| 81 |
int version() const; |
| 82 |
|
| 83 |
|
| 84 |
bool sendText(WPSEntry const &entry); |
| 85 |
|
| 86 |
bool updateSpreadsheetNames(QuattroDosChartInternal::Chart &chart); |
| 87 |
private: |
| 88 |
QuattroDosChart(QuattroDosChart const &orig) = delete; |
| 89 |
QuattroDosChart &operator=(QuattroDosChart const &orig) = delete; |
| 90 |
|
| 91 |
libwps::DebugFile &ascii() |
| 92 |
{ |
| 93 |
return m_asciiFile; |
| 94 |
} |
| 95 |
|
| 96 |
RVNGInputStreamPtr m_input; |
| 97 |
std::shared_ptr<WKSContentListener> m_listener; |
| 98 |
|
| 99 |
QuattroDosParser &m_mainParser; |
| 100 |
|
| 101 |
std::shared_ptr<QuattroDosChartInternal::State> m_state; |
| 102 |
|
| 103 |
libwps::DebugFile &m_asciiFile; |
| 104 |
}; |
| 105 |
|
| 106 |
#endif |
| 107 |
|