KDChartCartesianAxis.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-2007 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 #ifndef KDCHARTCARTESIANAXIS_H
00030 #define KDCHARTCARTESIANAXIS_H
00031 
00032 #include <QList>
00033 
00034 #include "KDChartAbstractAxis.h"
00035 
00036 namespace KDChart {
00037 
00038     class AbstractCartesianDiagram;
00039 
00048     class KDCHART_EXPORT CartesianAxis : public AbstractAxis
00049     {
00050         Q_OBJECT
00051 
00052         Q_DISABLE_COPY( CartesianAxis )
00053         KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( CartesianAxis, AbstractDiagram* )
00054 
00055     public:
00056         enum Position {
00057             Bottom,
00058             Top,
00059             Right,
00060             Left
00061         };
00062 
00073         explicit CartesianAxis ( AbstractCartesianDiagram* diagram = 0 );
00074         ~CartesianAxis();
00075 
00079         bool compare( const CartesianAxis* other )const;
00080 
00082         virtual void paint( QPainter* );
00084         virtual void paintCtx( PaintContext* );
00085 
00086         void setTitleText( const QString& text );
00087         QString titleText() const;
00088 
00089         void setTitleTextAttributes( const TextAttributes &a );
00097         TextAttributes titleTextAttributes() const;
00104         void resetTitleTextAttributes();
00105         bool hasDefaultTitleTextAttributes() const;
00106 
00107         virtual void setPosition ( Position p );
00108 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00109         virtual const Position position () const;
00110 #else
00111         virtual Position position () const;
00112 #endif
00113 
00114         virtual void layoutPlanes();
00115 
00116         virtual bool isAbscissa() const;
00117         virtual bool isOrdinate() const;
00118 
00126         void setAnnotations( const QMap< double, QString >& annotations );
00130         QMap< double, QString > annotations() const;
00131 
00133         virtual bool isEmpty() const;
00135         virtual Qt::Orientations expandingDirections() const;
00137         virtual QSize maximumSize() const;
00139         virtual QSize minimumSize() const;
00141         virtual QSize sizeHint() const;
00143         virtual void setGeometry( const QRect& r );
00145         virtual QRect geometry() const;
00146 
00147     public Q_SLOTS:
00148         void setCachedSizeDirty() const;
00149 
00150 
00151         int tickLength( bool subUnitTicks = false ) const;
00152     };
00153 
00154     typedef QList<CartesianAxis*> CartesianAxisList;
00155 }
00156 
00157 #endif

Generated on Thu Mar 4 23:19:10 2010 for KD Chart 2 by  doxygen 1.5.4