KD Chart 2: KDChartRelativePosition.h Source File

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# KDChartRelativePosition.h

Go to the documentation of this file.

    00001 /* -*- Mode: C++ -*-
    00002   KDChart - a multi-platform charting engine
    00003   */
    00004
    00005 /****************************************************************************
    00006 ** Copyright (C) 2005-2006 Klarälvdalens Datakonsult AB.  All rights reserved.
    00007 **
    00008 ** This file is part of the KD Chart library.
    00009 **
    00010 ** This file may be distributed and/or modified under the terms of the
    00011 ** GNU General Public License version 2 as published by the Free Software
    00012 ** Foundation and appearing in the file LICENSE.GPL included in the
    00013 ** packaging of this file.
    00014 **
    00015 ** Licensees holding valid commercial KD Chart licenses may use this file in
    00016 ** accordance with the KD Chart Commercial License Agreement provided with
    00017 ** the Software.
    00018 **
    00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00021 **
    00022 ** See http://www.kdab.net/kdchart for
    00023 **   information about KD Chart Commercial License Agreements.
    00024 **
    00025 ** Contact info@kdab.net if any conditions of this
    00026 ** licensing are not clear to you.
    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 /* QT_NO_DEBUG_STREAM */
    00209
    00210
    00211 #endif // KDCHARTREALTIVEPOSITION_H