00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PLOTLINE_HPP
00023 #define PLOTLINE_HPP
00024
00025 #include <qstring.h>
00026 #include <qvaluelist.h>
00027 #include <qcolor.h>
00028 #include <qdatetime.h>
00029 #include "Setting.h"
00030
00031
00032 typedef struct
00033 {
00034 double v;
00035 double open;
00036 double high;
00037 double low;
00038 QColor color;
00039 bool candleFill;
00040
00041 } Val;
00042
00043
00044 class PlotLine
00045 {
00046 public:
00047
00048 enum LineType
00049 {
00050 Dot,
00051 Dash,
00052 Histogram,
00053 HistogramBar,
00054 Line,
00055 Invisible,
00056 Horizontal,
00057 Bar,
00058 Candle,
00059 PF
00060 };
00061
00062 PlotLine ();
00063 ~PlotLine ();
00064 void copy (PlotLine *);
00065 void setColor (QString &);
00066 void setColor (QColor &);
00067 void getColor (QColor &);
00068 void setType (PlotLine::LineType);
00069 void setType (QString &);
00070 PlotLine::LineType getType ();
00071 void setLabel (QString &);
00072 void getLabel (QString &);
00073 void append (double);
00074 void append (QColor &, double, double, double, double, bool);
00075 void append2 (QColor &, double, double, double, double, bool);
00076 void append (QDateTime &);
00077 void prepend (QDateTime &);
00078 void prepend (double);
00079 void prepend (QColor &, double, double, double, double, bool);
00080 double getData (int);
00081 void getData (int, QColor &, double &, double &, double &, double &, bool &);
00082 void getData (int, QDateTime &);
00083 void setData (int, double);
00084 int getSize ();
00085 double getHigh ();
00086 void setHigh (double);
00087 double getLow ();
00088 void setLow (double);
00089 void checkHighLow (double);
00090 void setScaleFlag (bool);
00091 bool getScaleFlag ();
00092 void setColorFlag (bool);
00093 bool getColorFlag ();
00094 void getLineTypes (QStringList &);
00095 void setColorBar (int, QColor &);
00096 void getColorBar (int, QColor &);
00097 void getHighLowRange (int, int, double &, double &);
00098 void getInfo (int, Setting &);
00099 void strip (double, int, QString &);
00100 void getDateList (QValueList<QDateTime> &);
00101 void setDateList (QValueList<QDateTime> &);
00102 void getData (QValueList<Val> &);
00103
00104 private:
00105 QValueList<Val> data;
00106 QValueList<QDateTime> dateList;
00107 QColor color;
00108 PlotLine::LineType lineType;
00109 QString label;
00110 double high;
00111 double low;
00112 bool scaleFlag;
00113 bool colorFlag;
00114 };
00115
00116 #endif
00117