kreportchartview.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           kreportchartview.h
00003                              -------------------
00004     begin                : Sat May 22 2004
00005     copyright            : (C) 2004-2005 by Ace Jones
00006     email                : <ace.j@hotpop.com>
00007                            Thomas Baumgart <ipwizard@users.sourceforge.net>
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef KREPORTCHARTVIEW_H
00020 #define KREPORTCHARTVIEW_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "../../config.h"
00024 #endif
00025 #ifdef HAVE_KDCHART
00026 
00027 // ----------------------------------------------------------------------------
00028 // QT Includes
00029 
00030 // ----------------------------------------------------------------------------
00031 // KDE Includes
00032 // Some STL headers in GCC4.3 contain operator new. Memory checker mangles these
00033 #ifdef _CHECK_MEMORY
00034   #undef new
00035 #endif
00036 
00037 #include <qlabel.h>
00038 #include <KDChartWidget.h>
00039 #include <KDChartTable.h>
00040 #include <KDChartParams.h>
00041 #include <KDChartAxisParams.h>
00042 
00043 // ----------------------------------------------------------------------------
00044 // Project Includes
00045 #ifdef _CHECK_MEMORY
00046   #include <kmymoney/mymoneyutils.h>
00047 #endif
00048 
00049 namespace reports {
00050 
00051 class KReportChartView: public KDChartWidget
00052 {
00053 public:
00054   KReportChartView( QWidget* parent, const char* name );
00055   ~KReportChartView() {}
00056   static bool implemented(void) { return true; }
00057   void setNewData( const KDChartTableData& newdata ) { this->setData(new KDChartTableData(newdata)); }
00058   QStringList& abscissaNames(void) { return m_abscissaNames; }
00059   void refreshLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosBottom,&m_abscissaNames,0); }
00060   void setProperty(int row, int col, int id);
00061 //   void setCircularLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosCircular,&m_abscissaNames,0); }
00062 
00063   void setAccountSeries(bool accountSeries) {_accountSeries = accountSeries; }
00064   bool getAccountSeries(void) {return _accountSeries; }
00065 
00066 protected:
00067   virtual void mouseMoveEvent( QMouseEvent* event );
00068 
00069 private:
00070   QStringList m_abscissaNames;
00071   bool _accountSeries;
00072 
00073   // label to display when hovering on a data region
00074   QLabel *label;
00075 };
00076 
00077 } // end namespace reports
00078 
00079 #else
00080 
00081 namespace reports {
00082 
00083 class KReportChartView : public QWidget
00084 {
00085 public:
00086   KReportChartView( QWidget* parent, const char* name ): QWidget(parent,name) {}
00087   ~KReportChartView() {}
00088   static bool implemented(void) { return false; }
00089 };
00090 
00091 } // end namespace reports
00092 
00093 #endif
00094 
00095 #endif // KREPORTCHARTVIEW_H

Generated on Wed Jan 26 13:03:18 2011 for KMyMoney by  doxygen 1.5.6