KChart

KChartRelativePosition.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 KCHARTRELATIVEPOSITION_H
21 #define KCHARTRELATIVEPOSITION_H
22 
23 #include <QDebug>
24 #include <QMetaType>
25 #include <Qt>
26 #include <QPointF>
27 #include <QSizeF>
28 #include "KChartGlobal.h"
29 
30 namespace KChart {
31 
32  class Position;
33  class PositionPoints;
34  class Measure;
35 
54 class KCHART_EXPORT RelativePosition
55 {
56 public:
59 
60  RelativePosition & operator=( const RelativePosition & other );
61 
63 
79  void setReferenceArea( QObject* area );
80  QObject* referenceArea() const;
81 
95  void setReferencePoints( const PositionPoints& points );
96  const PositionPoints referencePoints() const;
97 
109  void setReferencePosition( Position position );
110 
121  void resetReferencePosition();
122  Position referencePosition() const;
123 
135  void setAlignment( Qt::Alignment flags );
136  Qt::Alignment alignment() const;
137 
150  void setHorizontalPadding( const Measure& padding );
151  Measure horizontalPadding() const;
152 
165  void setVerticalPadding( const Measure& padding );
166  Measure verticalPadding() const;
167 
168  void setRotation( qreal rot );
169  qreal rotation() const;
170 
183  const QPointF referencePoint(qreal* polarDegrees = nullptr) const;
184 
195  const QPointF calculatedPoint( const QSizeF& autoSize ) const;
196 
197  bool operator==( const RelativePosition& ) const;
198  bool operator!=( const RelativePosition & other ) const;
199 
200 private:
201  KCHART_DECLARE_PRIVATE_BASE_VALUE( RelativePosition )
202 };
203 
204 inline bool RelativePosition::operator!=( const RelativePosition & other ) const { return !operator==( other ); }
205 }
206 
207 #if !defined(QT_NO_DEBUG_STREAM)
208 KCHART_EXPORT QDebug operator<<(QDebug, const KChart::RelativePosition& );
209 #endif /* QT_NO_DEBUG_STREAM */
210 
211 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::RelativePosition )
212 
213 QT_BEGIN_NAMESPACE
214 Q_DECLARE_TYPEINFO( KChart::RelativePosition, Q_MOVABLE_TYPE );
215 QT_END_NAMESPACE
216 
217 Q_DECLARE_METATYPE( KChart::RelativePosition )
218 
219 #endif // KCHARTRELATIVEPOSITION_H
Defines relative position information: reference area, position in this area (reference position)...
Defines a position, using compass terminology.
typedef Alignment
Stores the absolute target points of a Position.
Class only listed here to document inheritance of some KChart classes.
Contains KChart macros.
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Global namespace.
Measure is used to specify relative and absolute sizes in KChart, e.g.
Definition: KChartMeasure.h:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 22:39:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.