| 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_SPREADSHEET_H |
| 23 |
#define QUATTRO_DOS_SPREADSHEET_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 QuattroDosSpreadsheetInternal |
| 37 |
{ |
| 38 |
class Cell; |
| 39 |
class SpreadSheet; |
| 40 |
struct State; |
| 41 |
} |
| 42 |
|
| 43 |
class QuattroDosParser; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
class QuattroDosSpreadsheet |
| 50 |
{ |
| 51 |
public: |
| 52 |
friend class QuattroDosParser; |
| 53 |
|
| 54 |
|
| 55 |
explicit QuattroDosSpreadsheet(QuattroDosParser &parser); |
| 56 |
|
| 57 |
~QuattroDosSpreadsheet(); |
| 58 |
|
| 59 |
void setListener(WKSContentListenerPtr &listen) |
| 60 |
{ |
| 61 |
m_listener = listen; |
| 62 |
} |
| 63 |
|
| 64 |
protected: |
| 65 |
|
| 66 |
bool checkFilePosition(long pos); |
| 67 |
|
| 68 |
int version() const; |
| 69 |
|
| 70 |
|
| 71 |
int getNumSpreadsheets() const; |
| 72 |
|
| 73 |
librevenge::RVNGString getSheetName(int id) const; |
| 74 |
|
| 75 |
void sendSpreadsheet(int sId, std::map<Vec2i,Vec2i> const &chartCellMap); |
| 76 |
|
| 77 |
|
| 78 |
void sendCellContent(QuattroDosSpreadsheetInternal::Cell const &cell, int sheetId, |
| 79 |
int cellChartSheetId=-1, Vec2f const &chartSize=Vec2f()); |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
bool readSpreadsheetOpen(); |
| 85 |
|
| 86 |
bool readSpreadsheetClose(); |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
bool readCell(); |
| 95 |
|
| 96 |
bool readCellFormulaResult(); |
| 97 |
|
| 98 |
bool readSheetSize(); |
| 99 |
|
| 100 |
bool readSpreadsheetName(); |
| 101 |
|
| 102 |
bool readColumnSize(); |
| 103 |
|
| 104 |
bool readRowSize(); |
| 105 |
|
| 106 |
bool readHiddenColumns(); |
| 107 |
|
| 108 |
|
| 109 |
bool readCellProperty(); |
| 110 |
|
| 111 |
bool readCellStyle(); |
| 112 |
|
| 113 |
bool readUserStyle(); |
| 114 |
|
| 115 |
|
| 116 |
bool readCell(Vec2i actPos, WKSContentListener::FormulaInstruction &instr, bool hasSheetId=false, int sheetId=0); |
| 117 |
|
| 118 |
bool readFormula(long endPos, Vec2i const &pos, int sheetId, |
| 119 |
std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error); |
| 120 |
|
| 121 |
private: |
| 122 |
QuattroDosSpreadsheet(QuattroDosSpreadsheet const &orig) = delete; |
| 123 |
QuattroDosSpreadsheet &operator=(QuattroDosSpreadsheet const &orig) = delete; |
| 124 |
|
| 125 |
libwps::DebugFile &ascii() |
| 126 |
{ |
| 127 |
return m_asciiFile; |
| 128 |
} |
| 129 |
|
| 130 |
RVNGInputStreamPtr m_input; |
| 131 |
std::shared_ptr<WKSContentListener> m_listener; |
| 132 |
|
| 133 |
QuattroDosParser &m_mainParser; |
| 134 |
|
| 135 |
std::shared_ptr<QuattroDosSpreadsheetInternal::State> m_state; |
| 136 |
|
| 137 |
libwps::DebugFile &m_asciiFile; |
| 138 |
}; |
| 139 |
|
| 140 |
#endif |
| 141 |
|