File indexing completed on 2024-05-12 16:33:35

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 
0006    This library is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU Library General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 
0011    This library is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014    Library General Public License for more details.
0015 
0016    You should have received a copy of the GNU Library General Public License
0017    along with this library; see the file COPYING.LIB.  If not, write to
0018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020 */
0021 
0022 
0023 #ifndef KOCHART_PLOTAREACONFIGWIDGET
0024 #define KOCHART_PLOTAREACONFIGWIDGET
0025 
0026 
0027 #include "ConfigWidgetBase.h"
0028 #include "ChartShape.h"
0029 
0030 
0031 class KoShape;
0032 class QAction;
0033 
0034 namespace KChart
0035 {
0036     class Position;
0037     class CartesianAxis;
0038 }
0039 
0040 namespace KoChart
0041 {
0042 class ChartShape;
0043 class AxesConfigWidget;
0044 class DataSetConfigWidget;
0045 class PieConfigWidget;
0046 class RingConfigWidget;
0047 class StockConfigWidget;
0048 class RadarDataSetConfigWidget;
0049 
0050 /**
0051  * Chart type configuration widget.
0052  */
0053 class PlotAreaConfigWidget : public ConfigWidgetBase
0054 {
0055     Q_OBJECT
0056 
0057 public:
0058     PlotAreaConfigWidget();
0059     ~PlotAreaConfigWidget();
0060 
0061     void deactivate() override;
0062     void open(KoShape* shape) override;
0063     QAction * createAction();
0064 
0065     /// reimplemented
0066     bool showOnShapeCreate() override { return true; }
0067 
0068     /// Delete all open dialogs.
0069     /// This is called when e.g. the tool is deactivated.
0070     void deleteSubDialogs(ChartType type = LastChartType) override;
0071 
0072     AxesConfigWidget *cartesianAxesConfigWidget() const;
0073     DataSetConfigWidget *cartesianDataSetConfigWidget() const;
0074     PieConfigWidget *pieConfigWidget() const;
0075     RingConfigWidget *ringConfigWidget() const;
0076     StockConfigWidget *stockConfigWidget() const;
0077     AxesConfigWidget *stockAxesConfigWidget() const;
0078     RadarDataSetConfigWidget *radarDataSetConfigWidget() const;
0079     
0080 public Q_SLOTS:
0081     void chartTypeSelected(QAction *action);
0082     void setThreeDMode(bool threeD);
0083     void updateData() override;
0084 
0085     void slotShowTableEditor();
0086     void slotShowCellRegionDialog();
0087 
0088 private Q_SLOTS:
0089     void ui_dataSetSelectionChanged_CellRegionDialog(int);
0090     void ui_dataSetXDataRegionChanged();
0091     void ui_dataSetYDataRegionChanged();
0092     void ui_dataSetLabelDataRegionChanged();
0093     void ui_dataSetCategoryDataRegionChanged();
0094     void ui_dataSetCustomDataRegionChanged();
0095 
0096     void ui_chartOrientationChanged(int value);
0097 
0098 Q_SIGNALS:
0099     void chartTypeChanged(ChartType type, ChartSubtype subType);
0100     void chartSubTypeChanged(ChartSubtype subType);
0101 
0102     void threeDModeToggled(bool threeD);
0103     void chartOrientationChanged(Qt::Orientation);
0104 
0105 
0106     void dataSetXDataRegionChanged(DataSet *dataSet, const CellRegion &region);
0107     void dataSetYDataRegionChanged(DataSet *dataSet, const CellRegion &region);
0108     void dataSetCustomDataRegionChanged(DataSet *dataSet, const CellRegion &region);
0109     void dataSetCategoryDataRegionChanged(DataSet *dataSet, const CellRegion &region);
0110     void dataSetLabelDataRegionChanged(DataSet *dataSet, const CellRegion &region);
0111 
0112 private:
0113     void setupWidgets();
0114     void setupDialogs();
0115     void createActions();
0116 
0117     class Private;
0118     Private * const d;
0119 };
0120 
0121 }  // namespace KoChart
0122 
0123 
0124 #endif // KOCHART_PLOTAREACONFIGWIDGET