xlsxabstractsheet.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // xlsxabstractsheet.h
  2. #ifndef XLSXABSTRACTSHEET_H
  3. #define XLSXABSTRACTSHEET_H
  4. #include "xlsxglobal.h"
  5. #include "xlsxabstractooxmlfile.h"
  6. QT_BEGIN_NAMESPACE_XLSX
  7. class Workbook;
  8. class Drawing;
  9. class AbstractSheetPrivate;
  10. class AbstractSheet : public AbstractOOXmlFile
  11. {
  12. Q_DECLARE_PRIVATE(AbstractSheet)
  13. public:
  14. Workbook *workbook() const;
  15. public:
  16. // NOTE: If all Qt compiler supports C++1x, recommend to use a 'class enum'.
  17. enum SheetType { ST_WorkSheet, ST_ChartSheet, ST_DialogSheet, ST_MacroSheet };
  18. enum SheetState { SS_Visible,SS_Hidden, SS_VeryHidden };
  19. public:
  20. QString sheetName() const;
  21. SheetType sheetType() const;
  22. SheetState sheetState() const;
  23. void setSheetState(SheetState ss);
  24. bool isHidden() const;
  25. bool isVisible() const;
  26. void setHidden(bool hidden);
  27. void setVisible(bool visible);
  28. protected:
  29. friend class Workbook;
  30. AbstractSheet(const QString &sheetName, int sheetId, Workbook *book, AbstractSheetPrivate *d);
  31. virtual AbstractSheet *copy(const QString &distName, int distId) const = 0;
  32. void setSheetName(const QString &sheetName);
  33. void setSheetType(SheetType type);
  34. int sheetId() const;
  35. Drawing *drawing() const;
  36. };
  37. QT_END_NAMESPACE_XLSX
  38. #endif // XLSXABSTRACTSHEET_H