wumu
2024-05-07 5e74d49c960965e3134cda27f603024483a4a1d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// xlsxcellformula.h
 
#ifndef QXLSX_XLSXCELLFORMULA_H
#define QXLSX_XLSXCELLFORMULA_H
 
#include "xlsxglobal.h"
 
#include <QExplicitlySharedDataPointer>
 
class QXmlStreamWriter;
class QXmlStreamReader;
 
QT_BEGIN_NAMESPACE_XLSX
 
class CellFormulaPrivate;
class CellRange;
class Worksheet;
class WorksheetPrivate;
 
class QXLSX_EXPORT CellFormula
{
public:
    enum FormulaType { NormalType, ArrayType, DataTableType, SharedType };
 
public:
    CellFormula();
    CellFormula(const char *formula, FormulaType type=NormalType);
    CellFormula(const QString &formula, FormulaType type=NormalType);
    CellFormula(const QString &formula, const CellRange &ref, FormulaType type);
    CellFormula(const CellFormula &other);
    ~CellFormula();
 
public:
    CellFormula &operator =(const CellFormula &other);
    bool isValid() const;
 
    FormulaType formulaType() const;
    QString formulaText() const;
    CellRange reference() const;
    int sharedIndex() const;
 
    bool operator == (const CellFormula &formula) const;
    bool operator != (const CellFormula &formula) const;
 
    bool saveToXml(QXmlStreamWriter &writer) const;
    bool loadFromXml(QXmlStreamReader &reader);
private:
    friend class Worksheet;
    friend class WorksheetPrivate;
    QExplicitlySharedDataPointer<CellFormulaPrivate> d;
};
 
QT_END_NAMESPACE_XLSX
 
#endif // QXLSX_XLSXCELLFORMULA_H