xlsxcell.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // xlsxcell.h
  2. #ifndef QXLSX_XLSXCELL_H
  3. #define QXLSX_XLSXCELL_H
  4. #include <cstdio>
  5. #include <QtGlobal>
  6. #include <QObject>
  7. #include <QString>
  8. #include <QVariant>
  9. #include <QDate>
  10. #include <QDateTime>
  11. #include <QTime>
  12. #include "xlsxglobal.h"
  13. #include "xlsxformat.h"
  14. QT_BEGIN_NAMESPACE_XLSX
  15. class Worksheet;
  16. class Format;
  17. class CellFormula;
  18. class CellPrivate;
  19. class WorksheetPrivate;
  20. class Cell
  21. {
  22. Q_DECLARE_PRIVATE(Cell)
  23. private:
  24. friend class Worksheet;
  25. friend class WorksheetPrivate;
  26. public:
  27. enum CellType // See ECMA 376, 18.18.11. ST_CellType (Cell Type) for more information.
  28. {
  29. BooleanType,
  30. DateType,
  31. ErrorType,
  32. InlineStringType,
  33. NumberType,
  34. SharedStringType,
  35. StringType,
  36. CustomType, // custom or un-defined cell type
  37. };
  38. public:
  39. Cell(const QVariant &data = QVariant(),
  40. CellType type = NumberType,
  41. const Format &format = Format(),
  42. Worksheet *parent = NULL,
  43. qint32 styleIndex = (-1) );
  44. Cell(const Cell * const cell);
  45. ~Cell();
  46. public:
  47. CellPrivate * const d_ptr; // See D-pointer and Q-pointer of Qt, for more information.
  48. public:
  49. CellType cellType() const;
  50. QVariant value() const;
  51. QVariant readValue() const;
  52. Format format() const;
  53. bool hasFormula() const;
  54. CellFormula formula() const;
  55. bool isDateTime() const;
  56. QVariant dateTime() const; // QDateTime, QDate, QTime
  57. bool isRichString() const;
  58. qint32 styleNumber() const;
  59. };
  60. QT_END_NAMESPACE_XLSX
  61. #endif // QXLSX_XLSXCELL_H