00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef KDCHARTREALTIVEPOSITION_H
00031 #define KDCHARTREALTIVEPOSITION_H
00032
00033 #include <QDebug>
00034 #include <QMetaType>
00035 #include <Qt>
00036 #include <QPointF>
00037 #include <QSizeF>
00038 #include "KDChartGlobal.h"
00039
00040 namespace KDChart {
00041
00042 class Position;
00043 class PositionPoints;
00044 class Measure;
00045
00062 class KDCHART_EXPORT RelativePosition
00063 {
00064 public:
00065 RelativePosition();
00066 RelativePosition( const RelativePosition& );
00067
00068 RelativePosition & operator=( const RelativePosition & other );
00069
00070 ~RelativePosition();
00071
00087 void setReferenceArea( QObject* area );
00088 QObject* referenceArea() const;
00089
00103 void setReferencePoints( const PositionPoints& points );
00104 const PositionPoints referencePoints() const;
00105
00114 void setReferencePosition( Position position );
00115
00126 void resetReferencePosition();
00127 Position referencePosition() const;
00128
00137 void setAlignment( Qt::Alignment flags );
00138 Qt::Alignment alignment() const;
00139
00150 void setHorizontalPadding( const Measure& padding );
00151 Measure horizontalPadding() const;
00152
00163 void setVerticalPadding( const Measure& padding );
00164 Measure verticalPadding() const;
00165
00166 void setRotation( qreal rot );
00167 qreal rotation() const;
00168
00178 const QPointF referencePoint() const;
00179
00189 const QPointF calculatedPoint( const QSizeF& autoSize ) const;
00190
00191 bool operator==( const RelativePosition& ) const;
00192 bool operator!=( const RelativePosition & other ) const;
00193
00194 private:
00195 KDCHART_DECLARE_PRIVATE_BASE_VALUE( RelativePosition )
00196 };
00197
00198 inline bool RelativePosition::operator!=( const RelativePosition & other ) const { return !operator==( other ); }
00199 }
00200
00201 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::RelativePosition )
00202
00203 Q_DECLARE_TYPEINFO( KDChart::RelativePosition, Q_MOVABLE_TYPE );
00204 Q_DECLARE_METATYPE( KDChart::RelativePosition )
00205
00206 #if !defined(QT_NO_DEBUG_STREAM)
00207 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::RelativePosition& );
00208 #endif
00209
00210
00211 #endif // KDCHARTREALTIVEPOSITION_H