Diffstat (limited to 'noncore/apps/checkbook/graphinfo.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/graphinfo.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/graphinfo.h b/noncore/apps/checkbook/graphinfo.h index 41927b4..f7842c6 100644 --- a/noncore/apps/checkbook/graphinfo.h +++ b/noncore/apps/checkbook/graphinfo.h | |||
@@ -21,68 +21,69 @@ | |||
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef GRAPHINFO_H | 29 | #ifndef GRAPHINFO_H |
30 | #define GRAPHINFO_H | 30 | #define GRAPHINFO_H |
31 | 31 | ||
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | #include <qstringlist.h> | 33 | #include <qstringlist.h> |
34 | 34 | ||
35 | class DataPointInfo | 35 | class DataPointInfo |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | DataPointInfo() | 38 | DataPointInfo() |
39 | : l( 0x0 ), v( 0.0 ) {} | 39 | : l( 0x0 ), v( 0.0 ) {} |
40 | DataPointInfo( const QString &label, float value ) | 40 | DataPointInfo( const QString &label, float value ) |
41 | : l( label ), v( value ) {} | 41 | : l( label ), v( value ) {} |
42 | 42 | ||
43 | const QString &label() { return l; } | 43 | const QString &label() { return l; } |
44 | float value() { return v; } | 44 | float value() { return v; } |
45 | 45 | ||
46 | void addToValue( float value ) { v += value; } | 46 | void addToValue( float value ) { v += value; } |
47 | 47 | ||
48 | private: | 48 | private: |
49 | QString l; | 49 | QString l; |
50 | float v; | 50 | float v; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | typedef QList<DataPointInfo> DataPointList; | 53 | typedef QList<DataPointInfo> DataPointList; |
54 | 54 | ||
55 | class GraphInfo | 55 | class GraphInfo |
56 | { | 56 | { |
57 | public: | 57 | public: |
58 | enum GraphType { BarChart, PieChart }; | 58 | enum GraphType { BarChart, PieChart }; |
59 | 59 | ||
60 | GraphInfo( GraphType = BarChart, DataPointList * = 0x0, | 60 | GraphInfo( GraphType = BarChart, DataPointList * = 0x0, |
61 | const QString & = 0x0, const QString & = 0x0, const QString & = 0x0 ); | 61 | const QString & = 0x0, const QString & = 0x0, const QString & = 0x0 ); |
62 | ~GraphInfo(); | 62 | ~GraphInfo(); |
63 | 63 | ||
64 | GraphInfo::GraphType graphType(); | 64 | GraphInfo::GraphType graphType(); |
65 | void setGraphType( GraphType ); | 65 | void setGraphType( GraphType ); |
66 | 66 | ||
67 | DataPointList *dataPoints(); | 67 | DataPointList *dataPoints(); |
68 | void setDataPoints( DataPointList * ); | 68 | void setDataPoints( DataPointList * ); |
69 | DataPointInfo *firstDataPoint(); | 69 | DataPointInfo *firstDataPoint(); |
70 | DataPointInfo *nextDataPoint(); | 70 | DataPointInfo *nextDataPoint(); |
71 | int numberDataPoints(); | 71 | int numberDataPoints(); |
72 | 72 | ||
73 | float maxValue(); | 73 | float maxValue(); |
74 | float minValue(); | ||
74 | float totalValue(); | 75 | float totalValue(); |
75 | 76 | ||
76 | void setGraphTitle( const QString & ); | 77 | void setGraphTitle( const QString & ); |
77 | void setXAxisTitle( const QString & ); | 78 | void setXAxisTitle( const QString & ); |
78 | void setYAxisTitle( const QString & ); | 79 | void setYAxisTitle( const QString & ); |
79 | 80 | ||
80 | private: | 81 | private: |
81 | GraphType t; | 82 | GraphType t; |
82 | DataPointList *d; | 83 | DataPointList *d; |
83 | QString gt; | 84 | QString gt; |
84 | QString xt; | 85 | QString xt; |
85 | QString yt; | 86 | QString yt; |
86 | }; | 87 | }; |
87 | 88 | ||
88 | #endif | 89 | #endif |