KDChartAbstractAxis.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 
00030 #ifndef KDCHARTABSTRACTAXIS_H
00031 #define KDCHARTABSTRACTAXIS_H
00032 
00033 // #include <QObject>
00034 // #include <QRectF>
00035 // #include <QWidget>
00036 
00037 #include "kdchart_export.h"
00038 #include "KDChartGlobal.h"
00039 #include "KDChartAbstractArea.h"
00040 #include "KDChartTextAttributes.h"
00041 #include "KDChartRulerAttributes.h"
00042 
00043 
00044 class QPainter;
00045 class QSizeF;
00046 // class QRectF;
00047 
00048 
00049 namespace KDChart {
00050 
00051     class Area;
00052     class AbstractCoordinatePlane;
00053     class PaintContext;
00054     class AbstractDiagram;
00055 
00064     class KDCHART_EXPORT AbstractAxis : public AbstractArea
00065     {
00066         Q_OBJECT
00067 
00068         Q_DISABLE_COPY( AbstractAxis )
00069         KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( AbstractAxis, AbstractDiagram* )
00070 
00071     public:
00072         explicit AbstractAxis( AbstractDiagram* diagram = 0 );
00073         virtual ~AbstractAxis();
00074 
00075         // FIXME implement when code os ready for it:
00076         // virtual Area* clone() const = 0;
00077 
00078         // FIXME (Mirko) readd when needed
00079         // void copyRelevantDetailsFrom( const KDChartAxis* axis );
00080 
00081         /*    virtual void paint( PaintContext* ) const = 0;
00082               virtual QSize sizeHint() const = 0;*/
00083         //virtual void paintEvent( QPaintEvent* event) = 0;
00084 
00099         virtual const QString customizedLabel( const QString& label )const;
00100 
00104         bool compare( const AbstractAxis* other )const;
00105 
00106         void createObserver( AbstractDiagram* diagram );
00107         void deleteObserver( AbstractDiagram* diagram );
00108         const AbstractDiagram* diagram() const;
00109         bool observedBy( AbstractDiagram* diagram ) const;
00110         virtual void connectSignals();
00111 
00112         void setTextAttributes( const TextAttributes &a );
00113         TextAttributes textAttributes() const;
00114         
00115         void setRulerAttributes( const RulerAttributes &a );
00116         RulerAttributes rulerAttributes() const;
00117 
00118         void setLabels( const QStringList& list );
00119         QStringList labels() const;
00120         void setShortLabels( const QStringList& list );
00121         QStringList shortLabels() const;
00122 
00123         virtual void setGeometry( const QRect& rect ) = 0;
00124         virtual QRect geometry() const = 0;
00125 
00126         const AbstractCoordinatePlane* coordinatePlane() const;
00127 
00128     protected Q_SLOTS:
00130         virtual void delayedInit();
00131 
00132     public Q_SLOTS:
00133         void update();
00134     };
00135 }
00136 
00137 #endif // KDCHARTABSTRACTAXIS_H

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