KD Chart 2  [rev.2.5.1]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
KDChartAbstractAxis.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2013 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTABSTRACTAXIS_H
24 #define KDCHARTABSTRACTAXIS_H
25 
26 // #include <QObject>
27 // #include <QRectF>
28 // #include <QWidget>
29 
30 #include "kdchart_export.h"
31 #include "KDChartGlobal.h"
32 #include "KDChartAbstractArea.h"
33 #include "KDChartTextAttributes.h"
34 #include "KDChartRulerAttributes.h"
35 
36 QT_BEGIN_NAMESPACE
37 class QPainter;
38 class QSizeF;
39 QT_END_NAMESPACE
40 
41 
42 namespace KDChart {
43 
44  class Area;
45  class AbstractCoordinatePlane;
46  class PaintContext;
47  class AbstractDiagram;
48 
57  class KDCHART_EXPORT AbstractAxis : public AbstractArea
58  {
59  Q_OBJECT
60 
61  Q_DISABLE_COPY( AbstractAxis )
63 
64  public:
65  explicit AbstractAxis( AbstractDiagram* diagram = 0 );
66  virtual ~AbstractAxis();
67 
68  // FIXME implement when code os ready for it:
69  // virtual Area* clone() const = 0;
70 
71  // FIXME (Mirko) readd when needed
72  // void copyRelevantDetailsFrom( const KDChartAxis* axis );
73 
74  /* virtual void paint( PaintContext* ) const = 0;
75  virtual QSize sizeHint() const = 0;*/
76  //virtual void paintEvent( QPaintEvent* event) = 0;
77 
92  virtual const QString customizedLabel( const QString& label ) const;
93 
97  bool compare( const AbstractAxis* other ) const;
98 
109  void createObserver( AbstractDiagram* diagram );
110 
121  void deleteObserver( AbstractDiagram* diagram );
122  const AbstractDiagram* diagram() const;
123  bool observedBy( AbstractDiagram* diagram ) const;
124 
138  virtual void connectSignals();
139 
151  void setTextAttributes( const TextAttributes &a );
152 
158  TextAttributes textAttributes() const;
159 
168  void setRulerAttributes( const RulerAttributes &a );
169 
175  RulerAttributes rulerAttributes() const;
176 
193  void setLabels( const QStringList& list );
194 
200  QStringList labels() const;
201 
213  void setShortLabels( const QStringList& list );
214 
223  QStringList shortLabels() const;
224 
225  virtual void setGeometry( const QRect& rect ) = 0;
226  virtual QRect geometry() const = 0;
227 
233  const AbstractCoordinatePlane* coordinatePlane() const;
234 
235  protected Q_SLOTS:
237  virtual void delayedInit();
238 
239  public Q_SLOTS:
240  void update();
241 
242  Q_SIGNALS:
243  void coordinateSystemChanged();
244  };
245 }
246 
247 #endif // KDCHARTABSTRACTAXIS_H

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/