xlsxcellformula.h 1.3 KB

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