File indexing completed on 2024-05-05 17:04:28

0001 /* This file is part of the KDE project
0002    Copyright (C) 2000-2002 Kalle Dalheimer <kalle@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License version 2 as published by the Free Software Foundation.
0007 
0008    This library is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    Library General Public License for more details.
0012 
0013    You should have received a copy of the GNU Library General Public License
0014    along with this library; see the file COPYING.LIB.  If not, write to
0015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0016  * Boston, MA 02110-1301, USA.
0017 */
0018 
0019 #ifndef KOCHART_INTERFACE
0020 #define KOCHART_INTERFACE
0021 
0022 
0023 #include <QtPlugin>
0024 #include <Qt>
0025 
0026 
0027 #define ChartShapeId "ChartShape"
0028 
0029 class QAbstractItemModel;
0030 class QString;
0031 
0032 
0033 namespace KoChart
0034 {
0035 
0036 /**
0037  * Interface for ChartShape to embed it into a spreadsheet.
0038  */
0039 class ChartInterface
0040 {
0041 public:
0042     virtual ~ChartInterface() {}
0043 
0044     /**
0045      * Sets the SheetAccessModel to be used by this chart. Use this method if
0046      * you want to embed the ChartShape into a spreadsheet.
0047      *
0048      * See sheets/SheetAccessModel.h for details.
0049      */
0050     virtual void setSheetAccessModel(QAbstractItemModel* model) = 0;
0051 
0052     /**
0053      * Re-initializes the chart with data from an arbitrary region.
0054      *
0055      * @param region             Name of region to use, e.g. "Table1.A1:B3"
0056      * @param firstRowIsLabel    Whether to interpret the first row as labels
0057      * @param firstColumnIsLabel Whether to interpret the first column as labels
0058      * @param dataDirection      orientation of a data set. Qt::Horizontal means a row is
0059      *                           to be interpreted as one data set, columns with Qt::Vertical.
0060      */
0061     virtual void reset(const QString& region,
0062                        bool firstRowIsLabel,
0063                        bool firstColumnIsLabel,
0064                        Qt::Orientation dataDirection) = 0;
0065 };
0066 
0067 } // namespace KoChart
0068 
0069 Q_DECLARE_INTERFACE(KoChart::ChartInterface, "org.calligra.KoChart.ChartInterface:1.0")
0070 
0071 #endif // KOCHART_INTERFACE
0072