KChart

KChartAbstractAxis.h
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTABSTRACTAXIS_H
21 #define KCHARTABSTRACTAXIS_H
22 
23 // #include <QObject>
24 // #include <QRectF>
25 // #include <QWidget>
26 
27 #include "kchart_export.h"
28 #include "KChartGlobal.h"
29 #include "KChartAbstractArea.h"
30 #include "KChartTextAttributes.h"
31 #include "KChartRulerAttributes.h"
32 
33 QT_BEGIN_NAMESPACE
34 class QPainter;
35 class QSizeF;
36 QT_END_NAMESPACE
37 
38 
39 namespace KChart {
40 
41  class Area;
42  class AbstractCoordinatePlane;
43  class PaintContext;
44  class AbstractDiagram;
45 
54  class KCHART_EXPORT AbstractAxis : public AbstractArea
55  {
56  Q_OBJECT
57 
58  Q_DISABLE_COPY( AbstractAxis )
59  KCHART_DECLARE_PRIVATE_DERIVED_PARENT( AbstractAxis, AbstractDiagram* )
60 
61  public:
62  explicit AbstractAxis( AbstractDiagram* diagram = nullptr );
63  virtual ~AbstractAxis();
64 
65  // FIXME implement when code os ready for it:
66  // virtual Area* clone() const = 0;
67 
68  // FIXME (Mirko) readd when needed
69  // void copyRelevantDetailsFrom( const KChartAxis* axis );
70 
71  /* virtual void paint( PaintContext* ) const = 0;
72  virtual QSize sizeHint() const = 0;*/
73  //virtual void paintEvent( QPaintEvent* event) = 0;
74 
97  virtual const QString customizedLabel( const QString& label ) const;
98 
102  bool compare( const AbstractAxis* other ) const;
103 
114  void createObserver( AbstractDiagram* diagram );
115 
126  void deleteObserver( AbstractDiagram* diagram );
127  const AbstractDiagram* diagram() const;
128  bool observedBy( AbstractDiagram* diagram ) const;
129 
143  virtual void connectSignals();
144 
156  void setTextAttributes( const TextAttributes &a );
157 
163  TextAttributes textAttributes() const;
164 
173  void setRulerAttributes( const RulerAttributes &a );
174 
180  RulerAttributes rulerAttributes() const;
181 
198  void setLabels( const QStringList& list );
199 
205  QStringList labels() const;
206 
218  void setShortLabels( const QStringList& list );
219 
228  QStringList shortLabels() const;
229 
230  void setGeometry( const QRect& rect ) override = 0;
231  QRect geometry() const override = 0;
232 
238  const AbstractCoordinatePlane* coordinatePlane() const;
239 
240  protected Q_SLOTS:
242  virtual void delayedInit();
243 
244  public Q_SLOTS:
245  void update();
246 
247  Q_SIGNALS:
248  void coordinateSystemChanged();
249  };
250 }
251 
252 #endif // KCHARTABSTRACTAXIS_H
AbstractDiagram defines the interface for diagram classes.
Contains KChart macros.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
The base class for axes.
An area in the chart with a background, a frame, etc.
A set of text attributes.
Global namespace.
A set of attributes controlling the appearance of axis rulers.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:36:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.