wumu
2023-06-14 e0873308a615c7e8f78fe653fd3bb2ecf4739501
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// xlsxcell.h
 
#ifndef QXLSX_XLSXCELL_H
#define QXLSX_XLSXCELL_H
 
#include <cstdio>
 
#include <QtGlobal>
#include <QObject>
#include <QString>
#include <QVariant>
#include <QDate>
#include <QDateTime>
#include <QTime>
 
#include "xlsxglobal.h"
#include "xlsxformat.h"
 
QT_BEGIN_NAMESPACE_XLSX
 
class Worksheet;
class Format;
class CellFormula;
class CellPrivate;
class WorksheetPrivate;
 
class QXLSX_EXPORT Cell
{
    Q_DECLARE_PRIVATE(Cell)
 
private:
    friend class Worksheet;
    friend class WorksheetPrivate;
 
public:
    enum CellType // See ECMA 376, 18.18.11. ST_CellType (Cell Type) for more information.
    {
        BooleanType,
        DateType,
        ErrorType,
        InlineStringType,
        NumberType,
        SharedStringType,
        StringType,
        CustomType, // custom or un-defined cell type
    };
 
public:
    Cell(const QVariant &data = QVariant(),
            CellType type = NumberType,
            const Format &format = Format(),
            Worksheet *parent = nullptr,
            qint32 styleIndex = (-1) );
    Cell(const Cell * const cell);
    ~Cell();
 
public:
    CellPrivate * const d_ptr; // See D-pointer and Q-pointer of Qt, for more information.
 
public:
    CellType cellType() const;
    QVariant value() const;
    QVariant readValue() const;
    Format format() const;
    
    bool hasFormula() const;
    CellFormula formula() const;
 
    bool isDateTime() const;
    QVariant dateTime() const; // QDateTime, QDate, QTime
 
    bool isRichString() const;
 
    qint32 styleNumber() const;
 
    static bool isDateType(CellType cellType, const Format &format);
 
};
 
QT_END_NAMESPACE_XLSX
 
#endif // QXLSX_XLSXCELL_H