KD Chart 2  [rev.2.5]
KDChartRelativePosition.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (C) 2001-2012 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Chart library.
00005 **
00006 ** Licensees holding valid commercial KD Chart licenses may use this file in
00007 ** accordance with the KD Chart Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 
00023 #ifndef KDCHARTRELATIVEPOSITION_H
00024 #define KDCHARTRELATIVEPOSITION_H
00025 
00026 #include <QDebug>
00027 #include <QMetaType>
00028 #include <Qt>
00029 #include <QPointF>
00030 #include <QSizeF>
00031 #include "KDChartGlobal.h"
00032 
00033 namespace KDChart {
00034 
00035     class Position;
00036     class PositionPoints;
00037     class Measure;
00038 
00057 class KDCHART_EXPORT RelativePosition
00058 {
00059 public:
00060     RelativePosition();
00061     RelativePosition( const RelativePosition& );
00062 
00063     RelativePosition & operator=( const RelativePosition & other );
00064 
00065     ~RelativePosition();
00066 
00082     void setReferenceArea( QObject* area );
00083     QObject* referenceArea() const;
00084 
00098     void setReferencePoints( const PositionPoints& points );
00099     const PositionPoints referencePoints() const;
00100 
00112     void setReferencePosition( Position position );
00113 
00124     void resetReferencePosition();
00125     Position referencePosition() const;
00126 
00138     void setAlignment( Qt::Alignment flags );
00139     Qt::Alignment alignment() const;
00140 
00153     void setHorizontalPadding( const Measure& padding );
00154     Measure horizontalPadding() const;
00155 
00168     void setVerticalPadding( const Measure& padding );
00169     Measure verticalPadding() const;
00170 
00171     void setRotation( qreal rot );
00172     qreal rotation() const;
00173 
00186     const QPointF referencePoint(qreal* polarDegrees=0) const;
00187 
00198     const QPointF calculatedPoint( const QSizeF& autoSize ) const;
00199 
00200     bool operator==( const RelativePosition& ) const;
00201     bool operator!=( const RelativePosition & other ) const;
00202 
00203 private:
00204     KDCHART_DECLARE_PRIVATE_BASE_VALUE( RelativePosition )
00205 };
00206 
00207 inline bool RelativePosition::operator!=( const RelativePosition & other ) const { return !operator==( other ); }
00208 }
00209 
00210 #if !defined(QT_NO_DEBUG_STREAM)
00211 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::RelativePosition& );
00212 #endif /* QT_NO_DEBUG_STREAM */
00213 
00214 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::RelativePosition )
00215 
00216 QT_BEGIN_NAMESPACE
00217 Q_DECLARE_TYPEINFO( KDChart::RelativePosition, Q_MOVABLE_TYPE );
00218 QT_END_NAMESPACE
00219 
00220 Q_DECLARE_METATYPE( KDChart::RelativePosition )
00221 
00222 #endif // KDCHARTRELATIVEPOSITION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

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