KDChartAbstractAxis.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (C) 2001-2010 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 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 KDCHARTABSTRACTAXIS_H
00024 #define KDCHARTABSTRACTAXIS_H
00025 
00026 // #include <QObject>
00027 // #include <QRectF>
00028 // #include <QWidget>
00029 
00030 #include "kdchart_export.h"
00031 #include "KDChartGlobal.h"
00032 #include "KDChartAbstractArea.h"
00033 #include "KDChartTextAttributes.h"
00034 #include "KDChartRulerAttributes.h"
00035 
00036 
00037 class QPainter;
00038 class QSizeF;
00039 // class QRectF;
00040 
00041 
00042 namespace KDChart {
00043 
00044     class Area;
00045     class AbstractCoordinatePlane;
00046     class PaintContext;
00047     class AbstractDiagram;
00048 
00057     class KDCHART_EXPORT AbstractAxis : public AbstractArea
00058     {
00059         Q_OBJECT
00060 
00061         Q_DISABLE_COPY( AbstractAxis )
00062         KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( AbstractAxis, AbstractDiagram* )
00063 
00064     public:
00065         explicit AbstractAxis( AbstractDiagram* diagram = 0 );
00066         virtual ~AbstractAxis();
00067 
00068         // FIXME implement when code os ready for it:
00069         // virtual Area* clone() const = 0;
00070 
00071         // FIXME (Mirko) readd when needed
00072         // void copyRelevantDetailsFrom( const KDChartAxis* axis );
00073 
00074         /*    virtual void paint( PaintContext* ) const = 0;
00075               virtual QSize sizeHint() const = 0;*/
00076         //virtual void paintEvent( QPaintEvent* event) = 0;
00077 
00092         virtual const QString customizedLabel( const QString& label )const;
00093 
00097         bool compare( const AbstractAxis* other )const;
00098 
00109         void createObserver( AbstractDiagram* diagram );
00110 
00121         void deleteObserver( AbstractDiagram* diagram );
00122         const AbstractDiagram* diagram() const;
00123         bool observedBy( AbstractDiagram* diagram ) const;
00124 
00138         virtual void connectSignals();
00139 
00151         void setTextAttributes( const TextAttributes &a );
00152 
00158         TextAttributes textAttributes() const;
00159         
00168         void setRulerAttributes( const RulerAttributes &a );
00169 
00175         RulerAttributes rulerAttributes() const;
00176 
00194         void setLabels( const QStringList& list );
00195 
00201         QStringList labels() const;
00202 
00214         void setShortLabels( const QStringList& list );
00215 
00224         QStringList shortLabels() const;
00225 
00226         virtual void setGeometry( const QRect& rect ) = 0;
00227         virtual QRect geometry() const = 0;
00228 
00234         const AbstractCoordinatePlane* coordinatePlane() const;
00235 
00236     protected Q_SLOTS:
00238         virtual void delayedInit();
00239 
00240     public Q_SLOTS:
00241         void update();
00242     };
00243 }
00244 
00245 #endif // KDCHARTABSTRACTAXIS_H