xlsxcolor_p.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // xlsxcolor_p.h
  2. #ifndef QXLSX_XLSXCOLOR_P_H
  3. #define QXLSX_XLSXCOLOR_P_H
  4. #include <QtGlobal>
  5. #include <QVariant>
  6. #include <QColor>
  7. #include <QXmlStreamWriter>
  8. #include <QXmlStreamReader>
  9. #include "xlsxglobal.h"
  10. QT_BEGIN_NAMESPACE_XLSX
  11. class Styles;
  12. class XlsxColor
  13. {
  14. public:
  15. explicit XlsxColor(const QColor &color = QColor());
  16. explicit XlsxColor(const QString &theme, const QString &tint=QString());
  17. explicit XlsxColor (int index);
  18. bool isThemeColor() const;
  19. bool isIndexedColor() const;
  20. bool isRgbColor() const;
  21. bool isInvalid() const;
  22. QColor rgbColor() const;
  23. int indexedColor() const;
  24. QStringList themeColor() const;
  25. operator QVariant() const;
  26. static QColor fromARGBString(const QString &c);
  27. static QString toARGBString(const QColor &c);
  28. bool saveToXml(QXmlStreamWriter &writer, const QString &node=QString()) const;
  29. bool loadFromXml(QXmlStreamReader &reader);
  30. private:
  31. QVariant val;
  32. };
  33. #if !defined(QT_NO_DATASTREAM)
  34. QDataStream &operator<<(QDataStream &, const XlsxColor &);
  35. QDataStream &operator>>(QDataStream &, XlsxColor &);
  36. #endif
  37. #ifndef QT_NO_DEBUG_STREAM
  38. QDebug operator<<(QDebug dbg, const XlsxColor &c);
  39. #endif
  40. QT_END_NAMESPACE_XLSX
  41. Q_DECLARE_METATYPE(QXlsx::XlsxColor)
  42. #endif // QXLSX_XLSXCOLOR_P_H