kspread
manipulator_data.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSPREAD_MANIPULATOR_DATA
00022 #define KSPREAD_MANIPULATOR_DATA
00023
00024 #include "manipulator.h"
00025 #include "kspread_global.h"
00026 #include "kspread_value.h"
00027
00028 namespace KSpread {
00029
00030
00036 struct ADMStorage {
00037 Value val;
00038 QString text;
00039 FormatType format;
00040 };
00041
00042 class AbstractDataManipulator : public Manipulator {
00043 public:
00044 AbstractDataManipulator ();
00045 virtual ~AbstractDataManipulator ();
00046 virtual bool process (Element* element);
00049 protected:
00053 virtual Value newValue (Element *element, int col, int row,
00054 bool *parse, FormatType *fmtType) = 0;
00056 virtual bool preProcessing ();
00057 QMap<int, QMap<int, ADMStorage> > oldData;
00058 };
00059
00060
00066 class DataManipulator : public AbstractDataManipulator {
00067 public:
00068 DataManipulator ();
00069 virtual ~DataManipulator ();
00070 void setParsing (bool val) { m_parsing = val; };
00073 void setValue (Value val) { data = val; };
00076 void setFormat (FormatType fmtType) { m_format = fmtType; };
00077 protected:
00078 virtual Value newValue (Element *element, int col, int row, bool *,
00079 FormatType *);
00080
00081 Value data;
00082 FormatType m_format;
00083 bool m_parsing : 1;
00084 };
00085
00086 class ArrayFormulaManipulator : public AbstractDataManipulator {
00087 public:
00088 ArrayFormulaManipulator ();
00089 virtual ~ArrayFormulaManipulator ();
00090 void setText (const QString text) { m_text = text; };
00091 protected:
00092 virtual Value newValue (Element *element, int col, int row, bool *,
00093 FormatType *);
00094 QString cellRef, m_text;
00095 };
00096
00097
00100 class ProtectedCheck : public Region {
00101 public:
00102 ProtectedCheck ();
00103 virtual ~ProtectedCheck ();
00104 void setSheet (Sheet *sheet) { m_sheet = sheet; };
00105 bool check ();
00106 protected:
00107 Sheet *m_sheet;
00108 };
00109
00110
00111 }
00112
00113 #endif // KSPREAD_MANIPULATOR_DATA
00114
|