kchart

KDChartSeriesCollection.h

00001 /* -*- Mode: C++ -*-
00002    KDChart - a multi-platform charting engine
00003    */
00004 
00005 /****************************************************************************
00006  ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB.  All rights reserved.
00007  **
00008  ** This file is part of the KDChart 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 KDChart licenses may use this file in
00016  ** accordance with the KDChart 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.klaralvdalens-datakonsult.se/?page=products for
00023  **   information about KDChart Commercial License Agreements.
00024  **
00025  ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
00026  ** licensing are not clear to you.
00027  **
00028  **********************************************************************/
00029 #ifndef __KDCHARTSERIESCOLLECTION_H__
00030 #define __KDCHARTSERIESCOLLECTION_H__
00031 
00032 // to avoid problems in TableBase - it doesn't include this - bug!
00033 #include <qtable.h>
00034 
00035 #include "KDChartTableBase.h"
00036 #include "KDChartBaseSeries.h"
00037 #if COMPAT_QT_VERSION >= 0x030000
00038 #include <qvaluevector.h>
00039 #else
00040 #include <qarray.h>
00041 #endif
00042 class KDChartParams;
00043 #include "KDChartAxisParams.h"
00044 
00045 // takes ownership of any series passed to it, and will delete
00046 // them when it is deleted.
00047 class KDCHART_EXPORT KDChartSeriesCollection : public KDChartTableDataBase,
00048 #if COMPAT_QT_VERSION >= 0x030000
00049     public QValueVector<KDChartBaseSeries *>
00050 #else
00051     public QArray<KDChartBaseSeries *>
00052 #endif
00053 {
00054     // Standard KDChartTableDataBase interface
00055     public:
00056         KDChartSeriesCollection( KDChartParams *params );
00057         virtual ~KDChartSeriesCollection();
00058 
00059         virtual uint rows() const;
00060         virtual uint cols() const;
00061         virtual void setUsedRows( uint _rows );
00062         virtual uint usedRows() const;
00063         virtual void setUsedCols( uint _cols );
00064         virtual uint usedCols() const;
00065         virtual void setCell( uint _row, uint _col,
00066                 const KDChartData& _element );
00067         virtual const KDChartData& cell( uint _row, uint _col ) const;
00068         virtual void expand( uint _rows, uint _cols );
00069 
00070 
00071         // Methods we need KHZ to modify in HIS code so we can use our code
00072         // needs to become virtual!
00073         virtual double minValue( int coordinate=1 ) const;
00074         virtual double maxValue( int coordinate=1 ) const;
00075 
00076 
00077         // extra functions for our use
00078         virtual void setLegendText( KDChartBaseSeries *series, QString text );
00079         virtual QString legendText( KDChartBaseSeries *series );
00080 
00081         virtual void setYaxis( KDChartBaseSeries *series,
00082                 KDChartAxisParams::AxisPos axis );// PENDING(blackie) possible enum problem
00083         virtual KDChartAxisParams::AxisPos yAxis( KDChartBaseSeries *series );// PENDING(blackie) possible enum problem
00084 
00085         virtual unsigned int indexOf( KDChartBaseSeries *series );
00086 
00087     protected:
00088         KDChartData _blank;
00089         KDChartParams *_params;
00090 };
00091 
00092 
00093 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys