1
/****************************************************************************
2
** Copyright (C) 2001-2007 Klarälvdalens Datakonsult AB. All rights reserved.
4
** This file is part of the KD Chart library.
6
** This file may be used under the terms of the GNU General Public
7
** License versions 2.0 or 3.0 as published by the Free Software
8
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9
** included in the packaging of this file. Alternatively you may (at
10
** your option) use any later version of the GNU General Public
11
** License if such license has been publicly approved by
12
** Klarälvdalens Datakonsult AB (or its successors, if any).
14
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16
** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17
** not expressly granted herein.
19
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22
**********************************************************************/
23
#ifndef __KDCHARTDIAGRAMOBSERVER_H_
24
#define __KDCHARTDIAGRAMOBSERVER_H_
26
#include "KDChartGlobal.h"
30
#include <QModelIndex>
32
class QAbstractItemModel;
36
class AbstractDiagram;
39
* \brief A DiagramObserver watches the associated diagram for
40
* changes and deletion and emits corresponsing signals.
42
class KDCHART_EXPORT DiagramObserver : public QObject
47
* Constructs a new observer observing the given diagram.
49
explicit DiagramObserver( AbstractDiagram * diagram, QObject* parent = 0 );
52
const AbstractDiagram* diagram() const;
53
AbstractDiagram* diagram();
56
/** This signal is emitted immediately before the diagram is
58
void diagramDestroyed( AbstractDiagram* diagram );
59
/** This signal is emitted whenever the data of the diagram changes. */
60
void diagramDataChanged( AbstractDiagram* diagram );
61
/** This signal is emitted whenever any of the data of the diagram was set (un)hidden. */
62
void diagramDataHidden( AbstractDiagram* diagram );
63
/** This signal is emitted whenever the attributes of the diagram change. */
64
void diagramAttributesChanged( AbstractDiagram* diagram );
67
void slotDestroyed(QObject*);
68
void slotHeaderDataChanged(Qt::Orientation,int,int);
69
void slotDataChanged(QModelIndex,QModelIndex);
70
void slotDataChanged();
71
void slotDataHidden();
72
void slotAttributesChanged();
73
void slotAttributesChanged(QModelIndex,QModelIndex);
74
void slotModelsChanged();
79
AbstractDiagram* m_diagram;
80
QPointer<QAbstractItemModel> m_model;
81
QPointer<QAbstractItemModel> m_attributesmodel;
85
#endif // KDChartDiagramObserver_H