xlsxconditionalformatting_p.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // xlsxconditionalformatting_p.h
  2. #ifndef XLSXCONDITIONALFORMATTING_P_H
  3. #define XLSXCONDITIONALFORMATTING_P_H
  4. #include <QtGlobal>
  5. #include <QSharedData>
  6. #include <QSharedPointer>
  7. #include <QMap>
  8. #include "xlsxconditionalformatting.h"
  9. #include "xlsxformat.h"
  10. #include "xlsxcolor_p.h"
  11. QT_BEGIN_NAMESPACE_XLSX
  12. class XlsxCfVoData
  13. {
  14. public:
  15. XlsxCfVoData()
  16. :gte(true)
  17. {
  18. }
  19. XlsxCfVoData(ConditionalFormatting::ValueObjectType type, const QString &value, bool gte=true)
  20. :type(type), value(value), gte(gte)
  21. {
  22. }
  23. ConditionalFormatting::ValueObjectType type;
  24. QString value;
  25. bool gte;
  26. };
  27. class XlsxCfRuleData
  28. {
  29. public:
  30. enum Attribute {
  31. A_type,
  32. A_dxfId,
  33. //A_priority,
  34. A_stopIfTrue,
  35. A_aboveAverage,
  36. A_percent,
  37. A_bottom,
  38. A_operator,
  39. A_text,
  40. A_timePeriod,
  41. A_rank,
  42. A_stdDev,
  43. A_equalAverage,
  44. A_dxfFormat,
  45. A_formula1,
  46. A_formula2,
  47. A_formula3,
  48. A_formula1_temp,
  49. A_color1,
  50. A_color2,
  51. A_color3,
  52. A_cfvo1,
  53. A_cfvo2,
  54. A_cfvo3,
  55. A_hideData
  56. };
  57. XlsxCfRuleData()
  58. :priority(1)
  59. {}
  60. int priority;
  61. Format dxfFormat;
  62. QMap<int, QVariant> attrs;
  63. };
  64. class ConditionalFormattingPrivate : public QSharedData
  65. {
  66. public:
  67. ConditionalFormattingPrivate();
  68. ConditionalFormattingPrivate(const ConditionalFormattingPrivate &other);
  69. ~ConditionalFormattingPrivate();
  70. void writeCfVo(QXmlStreamWriter &writer, const XlsxCfVoData& cfvo) const;
  71. bool readCfVo(QXmlStreamReader &reader, XlsxCfVoData& cfvo);
  72. bool readCfRule(QXmlStreamReader &reader, XlsxCfRuleData *cfRule, Styles *styles);
  73. bool readCfDataBar(QXmlStreamReader &reader, XlsxCfRuleData *cfRule);
  74. bool readCfColorScale(QXmlStreamReader &reader, XlsxCfRuleData *cfRule);
  75. QList<QSharedPointer<XlsxCfRuleData> >cfRules;
  76. QList<CellRange> ranges;
  77. };
  78. QT_END_NAMESPACE_XLSX
  79. Q_DECLARE_METATYPE(QXlsx::XlsxCfVoData)
  80. #endif // XLSXCONDITIONALFORMATTING_P_H