KChart

KChartAbstractAreaBase.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 KCHARTABSTRACTAREABASE_H
21 #define KCHARTABSTRACTAREABASE_H
22 
23 #include <QPointF>
24 #include <QSizeF>
25 #include <QRectF>
26 
27 #include "KChartGlobal.h"
28 #include "KChartLayoutItems.h"
29 #include "KChartRelativePosition.h"
30 #include "KChartAbstractAreaBase.h"
31 
32 
33 QT_BEGIN_NAMESPACE
34 class QPainter;
35 class QString;
36 QT_END_NAMESPACE
37 
38 namespace KChart {
39  class TextAttributes;
40  class BackgroundAttributes;
41  class FrameAttributes;
42  class PaintContext;
43 
44 
62 class KCHART_EXPORT AbstractAreaBase
63 {
64  Q_DISABLE_COPY( AbstractAreaBase )
65  KCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC( AbstractAreaBase )
66 
67 protected:
69  virtual ~AbstractAreaBase() ;
70 
71 public:
75  bool compare( const AbstractAreaBase* other ) const;
76 
77  void alignToReferencePoint( const RelativePosition& position );
78 
79  void setFrameAttributes( const FrameAttributes &a );
80  FrameAttributes frameAttributes() const;
81 
82  void setBackgroundAttributes( const BackgroundAttributes &a );
83  BackgroundAttributes backgroundAttributes() const;
84 
85  virtual void paintBackground( QPainter& painter, const QRect& rectangle );
86  virtual void paintFrame( QPainter& painter, const QRect& rectangle );
87 
88  static void paintBackgroundAttributes( QPainter& painter, const QRect& rectangle,
89  const KChart::BackgroundAttributes& attributes );
90  static void paintFrameAttributes( QPainter& painter, const QRect& rectangle,
91  const KChart::FrameAttributes& attributes );
92 
98  void getFrameLeadings(int& left, int& top, int& right, int& bottom ) const;
99 
100 
101 protected:
107  QRect innerRect() const;
108 
114  virtual QRect areaGeometry() const = 0;
115 
122  virtual void positionHasChanged();
123 
124 }; // End of class AbstractAreaBase
125 
126 }
127 #endif // KCHARTABSTRACTAREABASE_H
Defines relative position information: reference area, position in this area (reference position)...
Contains KChart macros.
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background, a frame, etc.
Set of attributes usable for background pixmaps.
Global namespace.
A set of attributes for frames around items.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Sep 19 2020 22:36:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.