xlsxchart.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /****************************************************************************
  2. ** Copyright (c) 2013-2014 Debao Zhang <hello@debao.me>
  3. ** All right reserved.
  4. **
  5. ** Permission is hereby granted, free of charge, to any person obtaining
  6. ** a copy of this software and associated documentation files (the
  7. ** "Software"), to deal in the Software without restriction, including
  8. ** without limitation the rights to use, copy, modify, merge, publish,
  9. ** distribute, sublicense, and/or sell copies of the Software, and to
  10. ** permit persons to whom the Software is furnished to do so, subject to
  11. ** the following conditions:
  12. **
  13. ** The above copyright notice and this permission notice shall be
  14. ** included in all copies or substantial portions of the Software.
  15. **
  16. ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. **
  24. ****************************************************************************/
  25. #ifndef QXLSX_CHART_H
  26. #define QXLSX_CHART_H
  27. #include "xlsxabstractooxmlfile.h"
  28. #include <QSharedPointer>
  29. class QXmlStreamReader;
  30. class QXmlStreamWriter;
  31. QT_BEGIN_NAMESPACE_XLSX
  32. class AbstractSheet;
  33. class Worksheet;
  34. class ChartPrivate;
  35. class CellRange;
  36. class DrawingAnchor;
  37. class Q_XLSX_EXPORT Chart : public AbstractOOXmlFile
  38. {
  39. Q_DECLARE_PRIVATE(Chart)
  40. public:
  41. enum ChartType {
  42. CT_Area = 1, //Zero is internally used for unknown types
  43. CT_Area3D,
  44. CT_Line,
  45. CT_Line3D,
  46. CT_Stock,
  47. CT_Radar,
  48. CT_Scatter,
  49. CT_Pie,
  50. CT_Pie3D,
  51. CT_Doughnut,
  52. CT_Bar,
  53. CT_Bar3D,
  54. CT_OfPie,
  55. CT_Surface,
  56. CT_Surface3D,
  57. CT_Bubble
  58. };
  59. ~Chart();
  60. void addSeries(const CellRange &range, AbstractSheet *sheet=0);
  61. void setChartType(ChartType type);
  62. void setChartStyle(int id);
  63. void saveToXmlFile(QIODevice *device) const;
  64. bool loadFromXmlFile(QIODevice *device);
  65. private:
  66. friend class AbstractSheet;
  67. friend class Worksheet;
  68. friend class Chartsheet;
  69. friend class DrawingAnchor;
  70. Chart(AbstractSheet *parent, CreateFlag flag);
  71. };
  72. QT_END_NAMESPACE_XLSX
  73. #endif // QXLSX_CHART_H