filters

record.h
1#ifndef TQPRO_RECORD_H
2#define TQPRO_RECORD_H
3
4#include <qpro/tablenames.h>
5#include <qpro/stream.h>
6
7enum QpRecType
8{
9 QpBof = 0,
10 QpEof = 1,
11 QpRecalcMode = 2,
12 QpRecalcOrder = 3,
13 QpEmptyCell = 12,
14 QpIntegerCell = 13,
15 QpFloatingPointCell = 14,
16 QpLabelCell = 15,
17 QpFormulaCell = 16,
18 QpPassword = 75,
19 QpBop = 202,
20 QpPageName = 204,
21 QpUnknown = -1
22};
23
24// -----------------------------------------------------------------------
25
26class QpRec
27{
28public:
29 QpRec(QpRecType pType);
30 ~QpRec();
31
32 TQP_INT16 type();
33
34protected:
35 TQP_INT16 cType;
36};
37
38// -----------------------------------------------------------------------
39
40//class TQP_CELL_REF
41//{
42//public:
43// TQP_CELL_REF(QpIStream& pIn);
44// ~TQP_CELL_REF();
45//
46// TQP_UINT8 Column();
47// TQP_INT16 Row();
48//
49//protected:
50// TQP_UINT8 cColumn;
51// TQP_INT16 cNoteBook;
52// TQP_INT8 cPage;
53// TQP_INT16 cRow;
54//};
55
56// -----------------------------------------------------------------------
57
58class QpRecCell : public QpRec
59{
60public:
61 QpRecCell(QpRecType pType);
62 ~QpRecCell();
63
64 void attributes(TQP_INT16 pAttributes);
65 TQP_INT16 attributes();
66
67// const char* cellRef();
68 void cellRef(char* pText, QpTableNames& pTable, TQP_INT16 pNoteBook, TQP_UINT8 pPage, TQP_UINT8 pColumn, TQP_INT16 pRow);
69 void cellRef(char* pText, QpTableNames& pTable, QpIStream& pFormulaRef);
70
71 void column(TQP_UINT8 pColumn);
72 TQP_UINT8 column();
73
74 void row(TQP_INT16 pRow);
75 TQP_INT16 row();
76
77protected:
78 int loadCellInfo(QpIStream& pIn);
79
80 TQP_INT16 cAttributes;
81 TQP_UINT8 cColumn;
82 TQP_UINT8 cPage;
83 TQP_INT16 cRow;
84 char* cCellRef;
85};
86
87// -----------------------------------------------------------------------
88
89class QpRecBof : public QpRec
90{
91public:
92 QpRecBof(TQP_INT16 pLen, QpIStream& pIn);
93 ~QpRecBof();
94
95 void fileFormat(TQP_INT16 pFileFormat);
96 TQP_INT16 fileFormat();
97
98protected:
99 TQP_INT16 cFileFormat;
100};
101
102// -----------------------------------------------------------------------
103
104class QpRecEof : public QpRec
105{
106public:
107 QpRecEof(TQP_INT16 pLen, QpIStream& pIn);
108 ~QpRecEof();
109};
110
111
112// -----------------------------------------------------------------------
113
114class QpRecRecalcMode : public QpRec
115{
116public:
117 enum MODE{Manual=0, Background=1, Automatic=255};
118
119 QpRecRecalcMode(TQP_INT16 pLen, QpIStream& pIn);
120 ~QpRecRecalcMode();
121
122 void mode(MODE pMode);
123 MODE mode();
124
125protected:
126 MODE cMode;
127};
128
129
130// -----------------------------------------------------------------------
131
132class QpRecRecalcOrder : public QpRec
133{
134public:
135 enum ORDER { Natural=0, Column=1, Row=255 };
136
137 QpRecRecalcOrder(TQP_INT16 pLen, QpIStream& pIn);
138 ~QpRecRecalcOrder();
139
140 void order(ORDER pOrder);
141 ORDER order();
142
143protected:
144 ORDER cOrder;
145};
146
147
148// -----------------------------------------------------------------------
149
150// QpRecDimension
151// -----------------------------------------------------------------------
152
153// QpRecName
154
155// -----------------------------------------------------------------------
156
157class QpRecEmptyCell : public QpRecCell
158{
159public:
160 QpRecEmptyCell(TQP_INT16 pLen, QpIStream& pIn);
161 ~QpRecEmptyCell();
162};
163
164
165// -----------------------------------------------------------------------
166
167class QpRecIntegerCell : public QpRecCell
168{
169public:
170 QpRecIntegerCell(TQP_INT16 pLen, QpIStream& pIn);
171 ~QpRecIntegerCell();
172
173
174 TQP_INT16 integer();
175protected:
176 TQP_INT16 cInt;
177};
178
179// -----------------------------------------------------------------------
180
181class QpRecFloatingPointCell : public QpRecCell
182{
183public:
184 QpRecFloatingPointCell(TQP_INT16 pLen, QpIStream& pIn);
185 ~QpRecFloatingPointCell();
186
187 TQP_INT64 value();
188protected:
189 TQP_INT64 cValue;
190};
191
192// -----------------------------------------------------------------------
193
194class QpRecFormulaCell : public QpRecCell
195{
196public:
197 QpRecFormulaCell(TQP_INT16 pLen, QpIStream& pIn);
198 ~QpRecFormulaCell();
199
200 const char* formula();
201 TQP_INT16 formulaReferences();
202 TQP_INT16 formulaLen();
203
204protected:
205 TQP_INT16 cCellRef;
206 char* cFormula;
207 TQP_INT64 cLastValue;
208 TQP_INT16 cLen;
209 TQP_INT16 cState;
210};
211
212// -----------------------------------------------------------------------
213
214class QpRecLabelCell : public QpRecCell
215{
216public:
217 QpRecLabelCell(TQP_INT16 pLen, QpIStream& pIn);
218 ~QpRecLabelCell();
219
220 char labelPrefix();
221 const char* label();
222
223protected:
224 char cLabelPrefix;
225 char* cLabel;
226};
227
228// -----------------------------------------------------------------------
229
230class QpRecUnknown : public QpRec
231{
232public:
233 QpRecUnknown(TQP_INT16 pType, TQP_INT16 pLen, QpIStream& pIn);
234 ~QpRecUnknown();
235};
236
237// -----------------------------------------------------------------------
238
239class QpRecBop : public QpRec
240{
241public:
242 QpRecBop(TQP_INT16 pLen, QpIStream& pIn);
243 ~QpRecBop();
244
245 TQP_UINT8 pageIndex();
246
247protected:
248 TQP_UINT8 cPageIndex;
249};
250
251// -----------------------------------------------------------------------
252
253class QpRecPageName : public QpRec
254{
255public:
256 QpRecPageName(TQP_INT16 pLen, QpIStream& pIn);
257 ~QpRecPageName();
258
259 const char* pageName();
260
261protected:
262 char* cPageName;
263};
264
265// -----------------------------------------------------------------------
266
267class QpRecPassword : public QpRec
268{
269public:
270 QpRecPassword(TQP_INT16 pLen, QpIStream& pIn);
271 ~QpRecPassword();
272
273 const TQP_UINT8* password();
274
275protected:
276 TQP_UINT8* cPassword;
277};
278
279#endif // TQPRO_RECORD_H
280