filters

record.h

00001 #ifndef QPRO_RECORD_H
00002 #define QPRO_RECORD_H
00003 
00004 #include <qpro/tablenames.h>
00005 #include <qpro/stream.h>
00006 
00007 enum QpRecType
00008 {
00009    QpBof               = 0,
00010    QpEof               = 1,
00011    QpRecalcMode        = 2,
00012    QpRecalcOrder       = 3,
00013    QpEmptyCell         = 12,
00014    QpIntegerCell       = 13,
00015    QpFloatingPointCell = 14,
00016    QpLabelCell         = 15,
00017    QpFormulaCell       = 16,
00018    QpPassword          = 75,
00019    QpBop               = 202,
00020    QpPageName          = 204,
00021    QpUnknown           = -1
00022 };
00023 
00024 // -----------------------------------------------------------------------
00025 
00026 class QpRec
00027 {
00028 public:
00029    QpRec(QpRecType pType);
00030    ~QpRec();
00031 
00032    QP_INT16 type();
00033 
00034 protected:
00035    QP_INT16 cType;
00036 };
00037 
00038 // -----------------------------------------------------------------------
00039 
00040 //class QP_CELL_REF
00041 //{
00042 //public:
00043 //   QP_CELL_REF(QpIStream& pIn);
00044 //   ~QP_CELL_REF();
00045 // 
00046 //   QP_UINT8 Column();
00047 //   QP_INT16 Row();
00048 // 
00049 //protected:
00050 //   QP_UINT8 cColumn;
00051 //   QP_INT16 cNoteBook;
00052 //   QP_INT8  cPage;
00053 //   QP_INT16 cRow;
00054 //};
00055 
00056 // -----------------------------------------------------------------------
00057 
00058 class QpRecCell : public QpRec
00059 {
00060 public:
00061    QpRecCell(QpRecType pType);
00062    ~QpRecCell();
00063 
00064    void        attributes(QP_INT16 pAttributes);
00065    QP_INT16    attributes();
00066  
00067 //   const char* cellRef();
00068    void        cellRef(char* pText, QpTableNames& pTable, QP_INT16 pNoteBook, QP_UINT8 pPage, QP_UINT8 pColumn, QP_INT16 pRow);
00069    void        cellRef(char* pText, QpTableNames& pTable, QpIStream& pFormulaRef);
00070  
00071    void        column(QP_UINT8 pColumn);
00072    QP_UINT8    column();
00073  
00074    void        row(QP_INT16 pRow);
00075    QP_INT16    row();
00076 
00077 protected:
00078    int         loadCellInfo(QpIStream& pIn);
00079 
00080    QP_INT16 cAttributes;
00081    QP_UINT8 cColumn;
00082    QP_UINT8 cPage;
00083    QP_INT16 cRow;
00084    char*    cCellRef;
00085 };
00086 
00087 // -----------------------------------------------------------------------
00088 
00089 class QpRecBof : public QpRec
00090 {
00091 public:
00092    QpRecBof(QP_INT16 pLen, QpIStream& pIn);
00093    ~QpRecBof();
00094 
00095    void     fileFormat(QP_INT16 pFileFormat);
00096    QP_INT16 fileFormat();
00097 
00098 protected:
00099    QP_INT16 cFileFormat;
00100 };
00101 
00102 // -----------------------------------------------------------------------
00103 
00104 class QpRecEof : public QpRec
00105 {
00106 public:
00107    QpRecEof(QP_INT16 pLen, QpIStream& pIn);
00108    ~QpRecEof();
00109 };
00110 
00111 
00112 // -----------------------------------------------------------------------
00113 
00114 class QpRecRecalcMode : public QpRec
00115 {
00116 public:
00117    enum MODE{Manual=0, Background=1, Automatic=255};
00118 
00119    QpRecRecalcMode(QP_INT16 pLen, QpIStream& pIn);
00120    ~QpRecRecalcMode();
00121 
00122    void mode(MODE pMode);
00123    MODE mode();
00124 
00125 protected:
00126    MODE cMode;
00127 };
00128 
00129 
00130 // -----------------------------------------------------------------------
00131 
00132 class QpRecRecalcOrder : public QpRec
00133 {
00134 public:
00135    enum ORDER { Natural=0, Column=1, Row=255 };
00136 
00137    QpRecRecalcOrder(QP_INT16 pLen, QpIStream& pIn);
00138    ~QpRecRecalcOrder();
00139 
00140    void  order(ORDER pOrder);
00141    ORDER order();
00142 
00143 protected:
00144    ORDER cOrder;
00145 };
00146 
00147 
00148 // -----------------------------------------------------------------------
00149 
00150 // QpRecDimension
00151 // -----------------------------------------------------------------------
00152 
00153 // QpRecName
00154 
00155 // -----------------------------------------------------------------------
00156 
00157 class QpRecEmptyCell : public QpRecCell
00158 {
00159 public:
00160    QpRecEmptyCell(QP_INT16 pLen, QpIStream& pIn);
00161    ~QpRecEmptyCell();
00162 };
00163 
00164 
00165 // -----------------------------------------------------------------------
00166 
00167 class QpRecIntegerCell : public QpRecCell
00168 {
00169 public:
00170    QpRecIntegerCell(QP_INT16 pLen, QpIStream& pIn);
00171    ~QpRecIntegerCell();
00172 
00173 
00174    QP_INT16 integer();
00175 protected:
00176    QP_INT16 cInt;
00177 };
00178 
00179 // -----------------------------------------------------------------------
00180 
00181 class QpRecFloatingPointCell : public QpRecCell
00182 {
00183 public:
00184    QpRecFloatingPointCell(QP_INT16 pLen, QpIStream& pIn);
00185    ~QpRecFloatingPointCell();
00186  
00187    QP_INT64 value();
00188 protected:
00189    QP_INT64 cValue;
00190 };
00191 
00192 // -----------------------------------------------------------------------
00193 
00194 class QpRecFormulaCell : public QpRecCell
00195 {
00196 public:
00197    QpRecFormulaCell(QP_INT16 pLen, QpIStream& pIn);
00198    ~QpRecFormulaCell();
00199  
00200    const char* formula();
00201    QP_INT16    formulaReferences();
00202    QP_INT16    formulaLen();
00203 
00204 protected:
00205    QP_INT16    cCellRef;
00206    char*       cFormula;
00207    QP_INT64    cLastValue;
00208    QP_INT16    cLen;
00209    QP_INT16    cState;
00210 };
00211 
00212 // -----------------------------------------------------------------------
00213 
00214 class QpRecLabelCell : public QpRecCell
00215 {
00216 public:
00217    QpRecLabelCell(QP_INT16 pLen, QpIStream& pIn);
00218    ~QpRecLabelCell();
00219  
00220    char        labelPrefix();
00221    const char* label();
00222 
00223 protected:
00224    char  cLabelPrefix;
00225    char* cLabel;
00226 };                                                                                                                                 
00227 
00228 // -----------------------------------------------------------------------
00229 
00230 class QpRecUnknown : public QpRec
00231 {
00232 public:
00233    QpRecUnknown(QP_INT16 pType, QP_INT16 pLen, QpIStream& pIn);
00234    ~QpRecUnknown();
00235 };
00236 
00237 // -----------------------------------------------------------------------
00238 
00239 class QpRecBop : public QpRec
00240 {
00241 public:
00242     QpRecBop(QP_INT16 pLen, QpIStream& pIn);
00243    ~QpRecBop();
00244 
00245    QP_UINT8 pageIndex();
00246 
00247 protected:
00248    QP_UINT8 cPageIndex;
00249 };
00250 
00251 // -----------------------------------------------------------------------
00252  
00253 class QpRecPageName : public QpRec
00254 {
00255 public:
00256     QpRecPageName(QP_INT16 pLen, QpIStream& pIn);
00257    ~QpRecPageName();
00258  
00259    const char* pageName();
00260  
00261 protected:
00262    char* cPageName;
00263 };
00264 
00265 // -----------------------------------------------------------------------
00266  
00267 class QpRecPassword : public QpRec
00268 {
00269 public:
00270    QpRecPassword(QP_INT16 pLen, QpIStream& pIn);
00271    ~QpRecPassword();
00272 
00273    const QP_UINT8* password();
00274 
00275 protected:
00276    QP_UINT8* cPassword;
00277 };
00278 
00279 #endif // QPRO_RECORD_H
00280 
KDE Home | KDE Accessibility Home | Description of Access Keys