00001 /* 00002 * Qtstalker stock charter 00003 * 00004 * Copyright (C) 2001-2007 Stefan S. Stratigakos 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00019 * USA. 00020 */ 00021 00022 #ifndef PLOT_HPP 00023 #define PLOT_HPP 00024 00025 #include <qwidget.h> 00026 #include <qstring.h> 00027 #include <qcolor.h> 00028 #include <qfont.h> 00029 #include <qstringlist.h> 00030 #include "Indicator.h" 00031 #include "Scaler.h" 00032 #include "BarData.h" 00033 #include "DatePlot.h" 00034 #include "ScalePlot.h" 00035 #include "IndicatorPlot.h" 00036 #include "DBIndex.h" 00037 00038 00039 class Plot : public QWidget 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 Plot (QWidget *, DBIndex *); 00045 ~Plot (); 00046 void clear (); 00047 void setData (BarData *); 00048 void setLogScale (bool); 00049 void updateStatusBar (int, int); 00050 void setInfoFlag (bool); 00051 void drawCrossHair (); 00052 void addIndicator (Indicator *); 00053 Indicator * getIndicator (); 00054 bool deleteIndicator (); 00055 void addChartObject (Setting &); 00056 int getWidth (); 00057 void setGridFlag (bool); 00058 void setScaleToScreen (bool); 00059 void setDrawMode (bool); 00060 void setDateFlag (bool); 00061 void setCrosshairsFlag (bool); 00062 IndicatorPlot * getIndicatorPlot (); 00063 DatePlot * getDatePlot (); 00064 void setMenuFlag (bool); 00065 00066 public slots: 00067 void draw(); 00068 void drawRefresh(); 00069 void setPixelspace (int); 00070 void setBackgroundColor (QColor); 00071 void setBorderColor (QColor); 00072 void setGridColor (QColor); 00073 void setPlotFont (QFont); 00074 void setIndex (int); 00075 void setInterval(BarData::BarLength); 00076 void crossHair (int, int, bool); 00077 void setChartPath (QString); 00078 void setCrosshairsStatus (bool); 00079 void slotSliderChanged (int); 00080 void slotGridChanged (bool); 00081 void slotScaleToScreenChanged (bool); 00082 void slotDrawModeChanged (bool); 00083 void slotDateFlagChanged (bool); 00084 void slotLogScaleChanged (bool); 00085 void slotUpdateScalePlot (); 00086 00087 private: 00088 DatePlot *datePlot; 00089 ScalePlot *scalePlot; 00090 IndicatorPlot *indicatorPlot; 00091 }; 00092 00093 #endif 00094 00095