File indexing completed on 2025-01-19 13:27:34

0001 /*
0002  *  Copyright (c) 2010 Sebastian Sauer <sebsauer@kdab.com>
0003  *  Copyright (c) 2010 Carlos Licea <carlos@kdab.com>
0004  *
0005  *  This program is free software; you can redistribute it and/or modify
0006  *  it under the terms of the GNU Lesser General Public License as published
0007  *  by the Free Software Foundation; either version 2 of the License, or
0008  *  (at your option) any later version.
0009  *
0010  *  This program is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  *  GNU Lesser General Public License for more details.
0014  *
0015  *  You should have received a copy of the GNU Lesser General Public License
0016  *  along with this program; if not, write to the Free Software
0017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef XLSXCHARTODFWRITER_H
0021 #define XLSXCHARTODFWRITER_H
0022 
0023 #include <KoOdfChartWriter.h>
0024 
0025 
0026 class KoGenStyles;
0027 class KoGenStyle;
0028 
0029 namespace MSOOXML
0030 {
0031     class DrawingMLTheme;
0032 }
0033 
0034 
0035 class XlsxChartOdfWriter : public KoOdfChartWriter
0036 {
0037 public:
0038     explicit XlsxChartOdfWriter(KoChart::Chart* chart,
0039                 const MSOOXML::DrawingMLTheme* const contextWithThemeInfo = nullptr);
0040     ~XlsxChartOdfWriter() override;
0041 
0042 
0043 private:
0044 
0045     // All of these are virtual functions called from other functions (mainly
0046     // saveContent()) in the parent class.
0047 
0048     QString genChartAreaStyle(KoGenStyle& style, KoGenStyles& styles, KoGenStyles& mainStyles) override;
0049     QString genPlotAreaStyle(KoGenStyle& style, KoGenStyles& styles, KoGenStyles& mainStyles) override;
0050     void addDataThemeToStyle(KoGenStyle& style,
0051                  int dataNumber, int maxNumData = 1, bool strokes = true) override;
0052 
0053     QColor calculateColorFromGradientStop(const KoChart::Gradient::GradientStop& grad) override;
0054     QColor labelFontColor() const override;
0055 
0056 private:
0057     const MSOOXML::DrawingMLTheme* m_theme;
0058 };
0059 
0060 #endif  // XLSXCHARTODFWRITER_H