KD Chart 2  [rev.2.5]
KDChartCartesianAxis.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 KDCHARTCARTESIANAXIS_H
00024 #define KDCHARTCARTESIANAXIS_H
00025 
00026 #include <QList>
00027 
00028 #include "KDChartAbstractAxis.h"
00029 
00030 namespace KDChart {
00031 
00032     class AbstractCartesianDiagram;
00033 
00042     class KDCHART_EXPORT CartesianAxis : public AbstractAxis
00043     {
00044         Q_OBJECT
00045 
00046         Q_DISABLE_COPY( CartesianAxis )
00047         KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( CartesianAxis, AbstractDiagram* )
00048 
00049     public:
00050         enum Position {
00051             Bottom,
00052             Top,
00053             Right,
00054             Left
00055         };
00056 
00067         explicit CartesianAxis ( AbstractCartesianDiagram* diagram = 0 );
00068         ~CartesianAxis();
00069 
00073         bool compare( const CartesianAxis* other ) const;
00074 
00076         virtual void paint( QPainter* );
00078         virtual void paintCtx( PaintContext* );
00079 
00083         void setTitleText( const QString& text );
00084         QString titleText() const;
00085         
00091         void setTitleSpace( qreal value );
00092         qreal titleSpace() const;
00093 
00097         void setTitleSize(qreal value);
00098         qreal titleSize() const;
00099 
00100         void setTitleTextAttributes( const TextAttributes &a );
00108         TextAttributes titleTextAttributes() const;
00115         void resetTitleTextAttributes();
00116         bool hasDefaultTitleTextAttributes() const;
00117 
00118         virtual void setPosition ( Position p );
00119 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00120         virtual const Position position () const;
00121 #else
00122         virtual Position position () const;
00123 #endif
00124 
00125         virtual void layoutPlanes();
00126 
00127         virtual bool isAbscissa() const;
00128         virtual bool isOrdinate() const;
00129 
00137         void setAnnotations( const QMap< qreal, QString >& annotations );
00141         QMap< qreal, QString > annotations() const;
00142 
00147         void setCustomTicks( const QList< qreal >& ticksPostions );
00151         QList< qreal > customTicks() const;
00152 
00156         void setCustomTickLength(int value);
00160         int customTickLength() const;
00161 
00163         virtual bool isEmpty() const;
00165         virtual Qt::Orientations expandingDirections() const;
00167         virtual QSize maximumSize() const;
00169         virtual QSize minimumSize() const;
00171         virtual QSize sizeHint() const;
00173         virtual void setGeometry( const QRect& r );
00175         virtual QRect geometry() const;
00176 
00177     public Q_SLOTS:
00178         void setCachedSizeDirty() const;
00179 
00180         virtual int tickLength( bool subUnitTicks = false ) const;
00181     private Q_SLOTS:
00182         void coordinateSystemChanged();
00183     private:
00184         friend class TickIterator;
00185     };
00186 
00187     typedef QList<CartesianAxis*> CartesianAxisList;
00188 }
00189 
00190 #endif
 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/