File indexing completed on 2024-05-12 16:33:34
0001 /* This file is part of the KDE project 0002 0003 Copyright 2008 Johannes Simon <johannes.simon@gmail.com> 0004 Copyright 2008 Inge Wallin <inge@lysator.liu.se> 0005 Copyright 2018 Dag Andersen <danders@get2net.dk> 0006 0007 This library is free software; you can redistribute it and/or 0008 modify it under the terms of the GNU Library General Public 0009 License as published by the Free Software Foundation; either 0010 version 2 of the License, or (at your option) any later version. 0011 0012 This library is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 Library General Public License for more details. 0016 0017 You should have received a copy of the GNU Library General Public License 0018 along with this library; see the file COPYING.LIB. If not, write to 0019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 */ 0022 0023 0024 #ifndef KOCHART_PIECONFIGWIDGET 0025 #define KOCHART_PIECONFIGWIDGET 0026 0027 0028 #include "ConfigSubWidgetBase.h" 0029 #include "ui_PieConfigWidget.h" 0030 0031 0032 namespace KoChart 0033 { 0034 class ChartShape; 0035 0036 /** 0037 * Chart type configuration widget. 0038 */ 0039 class PieConfigWidget : public ConfigSubWidgetBase 0040 { 0041 Q_OBJECT 0042 0043 public: 0044 PieConfigWidget(QWidget *parent = 0); 0045 PieConfigWidget(QList<ChartType> types, QWidget *parent = 0); 0046 ~PieConfigWidget(); 0047 0048 void open(ChartShape *shape) override; 0049 0050 void updateData(ChartType type, ChartSubtype subtype) override; 0051 0052 public Q_SLOTS: 0053 void dataPointSelectionChanged(int index); 0054 void brushChanged(const QColor& color); 0055 void penChanged(const QColor& color); 0056 void showCategoryChanged(bool b); 0057 void showNumberChanged(bool b); 0058 void showPercentChanged(bool b); 0059 void explodeFactorChanged(int percent); 0060 0061 Q_SIGNALS: 0062 void penChanged(DataSet *dataSet, const QColor& color, int section); 0063 void brushChanged(DataSet *dataSet, const QColor& color, int section); 0064 void showCategoryChanged(DataSet *dataSet, bool b, int section); 0065 void showNumberChanged(DataSet *dataSet, bool b, int section); 0066 void showPercentChanged(DataSet *dataSet, bool b, int section); 0067 void showSymbolChanged(DataSet *dataSet, bool b, int section); 0068 void explodeFactorChanged(DataSet *dataSet, int section, int percent); 0069 0070 private: 0071 void init(); 0072 0073 DataSet *m_dataSet; 0074 Ui::PieConfigWidget m_ui; 0075 }; 0076 0077 } // namespace KoChart 0078 0079 0080 #endif // KOCHART_PIECONFIGWIDGET