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_LEGENDCONFIGWIDGET
0025 #define KOCHART_LEGENDCONFIGWIDGET
0026 
0027 
0028 #include "ConfigWidgetBase.h"
0029 #include "ChartShape.h"
0030 
0031 
0032 class KoShape;
0033 class QAction;
0034 
0035 namespace KChart
0036 {
0037     class Position;
0038     class CartesianAxis;
0039 }
0040 
0041 namespace KoChart
0042 {
0043 class ChartShape;
0044 
0045 /**
0046  * Chart type configuration widget.
0047  */
0048 class LegendConfigWidget : public ConfigWidgetBase
0049 {
0050     Q_OBJECT
0051 
0052 public:
0053     LegendConfigWidget();
0054     ~LegendConfigWidget();
0055 
0056     QAction * createAction();
0057 
0058     /// reimplemented
0059     virtual bool showOnShapeCreate() override { return true; }
0060 
0061 public Q_SLOTS:
0062     void updateData() override;
0063 
0064     void setLegendOrientation(int boxEntryIndex);
0065     void setLegendAlignment(int boxEntryIndex);
0066     void setLegendPosition(int buttonGroupIndex);
0067     //void setLegendShowTitle(bool toggled);
0068 
0069 Q_SIGNALS:
0070     void showLegendChanged(bool b);
0071     void legendTitleChanged(const QString&);
0072     void legendFontChanged(const QFont& font);
0073     void legendTitleFontChanged(const QFont& font);
0074     void legendFontSizeChanged(int size);
0075     void legendSpacingChanged(int spacing);
0076     void legendShowLinesToggled(bool toggled);
0077     void legendOrientationChanged(Qt::Orientation orientation);
0078     void legendAlignmentChanged(Qt::Alignment alignment);
0079     void legendPositionChanged(Position position);
0080 
0081 private Q_SLOTS:
0082     void ui_legendEditFontButtonClicked();
0083 
0084 private:
0085     void createActions();
0086 
0087     class Private;
0088     Private * const d;
0089 };
0090 
0091 }  // namespace KoChart
0092 
0093 
0094 #endif // KOCHART_LEGENDCONFIGWIDGET