File indexing completed on 2024-05-12 13:00:15

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2000-2002 Kalle Dalheimer <kalle@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KOCHART_INTERFACE
0008 #define KOCHART_INTERFACE
0009 
0010 
0011 #include <QtPlugin>
0012 #include <Qt>
0013 
0014 
0015 #define ChartShapeId "ChartShape"
0016 
0017 class QAbstractItemModel;
0018 class QString;
0019 
0020 
0021 namespace KoChart
0022 {
0023 
0024 /**
0025  * Interface for ChartShape to embed it into a spreadsheet.
0026  */
0027 class ChartInterface
0028 {
0029 public:
0030     virtual ~ChartInterface() {}
0031 
0032     /**
0033      * Sets the SheetAccessModel to be used by this chart. Use this method if
0034      * you want to embed the ChartShape into a spreadsheet.
0035      *
0036      * See sheets/SheetAccessModel.h for details.
0037      */
0038     virtual void setSheetAccessModel(QAbstractItemModel* model) = 0;
0039 
0040     /**
0041      * Re-initializes the chart with data from an arbitrary region.
0042      *
0043      * @param region             Name of region to use, e.g. "Table1.A1:B3"
0044      * @param firstRowIsLabel    Whether to interpret the first row as labels
0045      * @param firstColumnIsLabel Whether to interpret the first column as labels
0046      * @param dataDirection      orientation of a data set. Qt::Horizontal means a row is
0047      *                           to be interpreted as one data set, columns with Qt::Vertical.
0048      */
0049     virtual void reset(const QString& region,
0050                        bool firstRowIsLabel,
0051                        bool firstColumnIsLabel,
0052                        Qt::Orientation dataDirection) = 0;
0053 };
0054 
0055 } // namespace KoChart
0056 
0057 Q_DECLARE_INTERFACE(KoChart::ChartInterface, "org.calligra.KoChart.ChartInterface:1.0")
0058 
0059 #endif // KOCHART_INTERFACE
0060