KD Chart 2 [rev.2.4]
|
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 00089 void setTitleSpace( qreal value ); 00090 qreal titleSpace() const; 00091 00092 void setTitleTextAttributes( const TextAttributes &a ); 00100 TextAttributes titleTextAttributes() const; 00107 void resetTitleTextAttributes(); 00108 bool hasDefaultTitleTextAttributes() const; 00109 00110 virtual void setPosition ( Position p ); 00111 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE) 00112 virtual const Position position () const; 00113 #else 00114 virtual Position position () const; 00115 #endif 00116 00117 virtual void layoutPlanes(); 00118 00119 virtual bool isAbscissa() const; 00120 virtual bool isOrdinate() const; 00121 00129 void setAnnotations( const QMap< double, QString >& annotations ); 00133 QMap< double, QString > annotations() const; 00134 00139 void setCustomTicks( const QList< double >& ticksPostions ); 00143 QList< double > customTicks() const; 00144 00145 00147 virtual bool isEmpty() const; 00149 virtual Qt::Orientations expandingDirections() const; 00151 virtual QSize maximumSize() const; 00153 virtual QSize minimumSize() const; 00155 virtual QSize sizeHint() const; 00157 virtual void setGeometry( const QRect& r ); 00159 virtual QRect geometry() const; 00160 00161 public Q_SLOTS: 00162 void setCachedSizeDirty() const; 00163 00164 virtual int tickLength( bool subUnitTicks = false ) const; 00165 private Q_SLOTS: 00166 void coordinateSystemChanged(); 00167 }; 00168 00169 typedef QList<CartesianAxis*> CartesianAxisList; 00170 } 00171 00172 #endif