File indexing completed on 2024-05-12 04:43:21

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public
0015  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #ifndef SCRIPTINGKRSCRIPTCHART_H
0019 #define SCRIPTINGKRSCRIPTCHART_H
0020 
0021 #include <QObject>
0022 #include <QPointF>
0023 #include <QSizeF>
0024 #include <QColor>
0025 
0026 class KReportItemChart;
0027 
0028 namespace Scripting
0029 {
0030 
0031 /**
0032 */
0033 class Chart : public QObject
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit Chart(KReportItemChart *);
0038 
0039     ~Chart();
0040 public Q_SLOTS:
0041 
0042 
0043     /**
0044     * Get the position of the barcode
0045     * @return position in points
0046      */
0047     QPointF position();
0048 
0049     /**
0050      * Sets the position of the barcode in points
0051      * @param Position
0052      */
0053     void setPosition(const QPointF&);
0054 
0055     /**
0056      * Get the size of the barcode
0057      * @return size in points
0058      */
0059     QSizeF size();
0060 
0061     /**
0062      * Set the size of the barcode in points
0063      * @param Size
0064      */
0065     void setSize(const QSizeF&);
0066 
0067     /**
0068      * The data source for the chart
0069      * @return Datasource
0070      */
0071     QString dataSource();
0072 
0073     /**
0074      * Set the data source for the chart
0075      * @param datasource
0076      */
0077     void setDataSource(const QString &);
0078 
0079     /**
0080      * The 3d status of the chart
0081      * @return 3d
0082      */
0083     bool threeD();
0084 
0085     /**
0086      * Set the 3d status of the chart
0087      * @param 3d
0088      */
0089     void setThreeD(bool td);
0090 
0091     /**
0092      * The visibility status of the legend
0093      * @return visibility
0094      */
0095     bool legendVisible();
0096 
0097     /**
0098      * Sets the visibility of the legend
0099      * @param visible
0100      */
0101     void setLegendVisible(bool v);
0102 
0103     /**
0104      * The color scheme used by the chart
0105      * @return scheme, 0=default, 2=rainbow 3=subdued
0106      */
0107     int colorScheme();
0108 
0109     /**
0110      * Sets the colorscheme of the chart
0111      * @param scheme 0=default, 2=rainbow 3=subdued
0112      */
0113     void setColorScheme(int);
0114 
0115     /**
0116      * The background color of the chart
0117      * @return backgroundcolor
0118      */
0119     QColor backgroundColor();
0120 
0121     /**
0122      * Sets the background color of the chart
0123      * @param backgroundcolor
0124      */
0125     void setBackgroundColor(const QColor &);
0126 
0127     /**
0128      * The title of the X Axis
0129      * @return xTitle
0130      */
0131     QString xAxisTitle();
0132 
0133     /**
0134      * Set the title of the X Axis
0135      * @param xTitle
0136      */
0137     void setXAxisTitle(const QString &);
0138 
0139     /**
0140      * The title of the Y Axis
0141      * @return yTitle
0142      */
0143     QString yAxisTitle();
0144 
0145     /**
0146      * Set the title of the Y Axis
0147      * @param yTitle
0148      */
0149     void setYAxisTitle(const QString &);
0150 
0151 private:
0152     KReportItemChart* m_chart;
0153 
0154 };
0155 
0156 }
0157 
0158 #endif