1 | /* This file is part of the KDE project |
2 | Copyright (C) 2000-2002 Kalle Dalheimer <kalle@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. |
7 | |
8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | * Boston, MA 02110-1301, USA. |
17 | */ |
18 | |
19 | #ifndef KOCHART_INTERFACE |
20 | #define KOCHART_INTERFACE |
21 | |
22 | |
23 | #include <QtPlugin> |
24 | #include <Qt> |
25 | |
26 | |
27 | #define ChartShapeId "ChartShape" |
28 | |
29 | class QAbstractItemModel; |
30 | class QString; |
31 | |
32 | |
33 | namespace KoChart |
34 | { |
35 | |
36 | /** |
37 | * Interface for ChartShape to embed it into a spreadsheet. |
38 | */ |
39 | class ChartInterface |
40 | { |
41 | public: |
42 | virtual ~ChartInterface() {} |
43 | |
44 | /** |
45 | * Sets the SheetAccessModel to be used by this chart. Use this method if |
46 | * you want to embed the ChartShape into a spreadsheet. |
47 | * |
48 | * See kspread/SheetAccessModel.h for details. |
49 | */ |
50 | virtual void setSheetAccessModel(QAbstractItemModel* model) = 0; |
51 | |
52 | /** |
53 | * Re-initializes the chart with data from an arbitrary region. |
54 | * |
55 | * @param region Name of region to use, e.g. "Table1.A1:B3" |
56 | * @param firstRowIsLabel Whether to interpret the first row as labels |
57 | * @param firstColumnIsLabel Whether to interpret the first column as labels |
58 | * @param dataDirection orientation of a data set. Qt::Horizontal means a row is |
59 | * to be interpreted as one data set, columns with Qt::Vertical. |
60 | */ |
61 | virtual void reset(const QString& region, |
62 | bool firstRowIsLabel, |
63 | bool firstColumnIsLabel, |
64 | Qt::Orientation dataDirection) = 0; |
65 | }; |
66 | |
67 | } // namespace KoChart |
68 | |
69 | Q_DECLARE_INTERFACE(KoChart::ChartInterface, "org.calligra.KoChart.ChartInterface:1.0" ) |
70 | |
71 | #endif // KOCHART_INTERFACE |
72 | |
73 | |