| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef WKS4_SPREADSHEET_H |
| 23 |
#define WKS4_SPREADSHEET_H |
| 24 |
|
| 25 |
#include <ostream> |
| 26 |
#include <vector> |
| 27 |
|
| 28 |
#include <librevenge-stream/librevenge-stream.h> |
| 29 |
|
| 30 |
#include "libwps_internal.h" |
| 31 |
|
| 32 |
#include "WPSDebug.h" |
| 33 |
#include "WKSContentListener.h" |
| 34 |
|
| 35 |
namespace WKS4SpreadsheetInternal |
| 36 |
{ |
| 37 |
class Cell; |
| 38 |
class SpreadSheet; |
| 39 |
struct State; |
| 40 |
} |
| 41 |
|
| 42 |
class WKS4Parser; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
class WKS4Spreadsheet |
| 49 |
{ |
| 50 |
public: |
| 51 |
friend class WKS4Parser; |
| 52 |
|
| 53 |
|
| 54 |
explicit WKS4Spreadsheet(WKS4Parser &parser); |
| 55 |
|
| 56 |
~WKS4Spreadsheet(); |
| 57 |
|
| 58 |
void setListener(WKSContentListenerPtr &listen) |
| 59 |
{ |
| 60 |
m_listener = listen; |
| 61 |
} |
| 62 |
|
| 63 |
protected: |
| 64 |
|
| 65 |
bool checkFilePosition(long pos); |
| 66 |
|
| 67 |
int version() const; |
| 68 |
|
| 69 |
void resetInput(RVNGInputStreamPtr const &input); |
| 70 |
|
| 71 |
|
| 72 |
int getNumSpreadsheets() const; |
| 73 |
|
| 74 |
void sendSpreadsheet(int sId); |
| 75 |
|
| 76 |
librevenge::RVNGString getSheetName(int id) const; |
| 77 |
|
| 78 |
|
| 79 |
void sendCellContent(WKS4SpreadsheetInternal::Cell const &cell); |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
bool readReportOpen(); |
| 85 |
|
| 86 |
bool readReportClose(); |
| 87 |
|
| 88 |
|
| 89 |
bool readFilterOpen(); |
| 90 |
|
| 91 |
bool readFilterClose(); |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
bool readCell(); |
| 100 |
|
| 101 |
bool readCellFormulaResult(); |
| 102 |
|
| 103 |
bool readSheetSize(); |
| 104 |
|
| 105 |
bool readColumnSize(); |
| 106 |
|
| 107 |
bool readHiddenColumns(); |
| 108 |
|
| 109 |
|
| 110 |
bool readMsWorksDOSFieldProperty(); |
| 111 |
|
| 112 |
bool readMsWorksDOSCellProperty(); |
| 113 |
|
| 114 |
bool readMsWorksDOSCellExtraProperty(); |
| 115 |
|
| 116 |
bool readMsWorksDOSPageBreak(); |
| 117 |
|
| 118 |
|
| 119 |
bool readMsWorksColumnSize(); |
| 120 |
|
| 121 |
bool readMsWorksRowSize(); |
| 122 |
|
| 123 |
bool readMsWorksPageBreak(); |
| 124 |
|
| 125 |
bool readMsWorksStyle(); |
| 126 |
|
| 127 |
|
| 128 |
bool readCell(Vec2i actPos, WKSContentListener::FormulaInstruction &instr); |
| 129 |
|
| 130 |
bool readFormula(long endPos, Vec2i const &pos, |
| 131 |
std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error); |
| 132 |
|
| 133 |
private: |
| 134 |
WKS4Spreadsheet(WKS4Spreadsheet const &orig) = delete; |
| 135 |
WKS4Spreadsheet &operator=(WKS4Spreadsheet const &orig) = delete; |
| 136 |
|
| 137 |
libwps::DebugFile &ascii() |
| 138 |
{ |
| 139 |
return m_asciiFile; |
| 140 |
} |
| 141 |
|
| 142 |
RVNGInputStreamPtr m_input; |
| 143 |
std::shared_ptr<WKSContentListener> m_listener; |
| 144 |
|
| 145 |
WKS4Parser &m_mainParser; |
| 146 |
|
| 147 |
std::shared_ptr<WKS4SpreadsheetInternal::State> m_state; |
| 148 |
|
| 149 |
libwps::DebugFile &m_asciiFile; |
| 150 |
}; |
| 151 |
|
| 152 |
#endif |
| 153 |
|