Diffstat (limited to 'noncore/apps/checkbook/graphinfo.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/graphinfo.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/graphinfo.h b/noncore/apps/checkbook/graphinfo.h new file mode 100644 index 0000000..4ad1dc9 --- a/dev/null +++ b/noncore/apps/checkbook/graphinfo.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | This file is part of the OPIE Project | ||
3 | =. | ||
4 | .=l. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This file is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This file is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
18 | ..}^=.= = ; Public License for more details. | ||
19 | ++= -. .` .: | ||
20 | : = ...= . :.=- You should have received a copy of the GNU | ||
21 | -. .:....=;==+<; General Public License along with this file; | ||
22 | -_. . . )=. = see the file COPYING. If not, write to the | ||
23 | -- :-=` Free Software Foundation, Inc., | ||
24 | 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #ifndef GRAPHINFO_H | ||
30 | #define GRAPHINFO_H | ||
31 | |||
32 | #include <qlist.h> | ||
33 | #include <qstringlist.h> | ||
34 | |||
35 | class DataPointInfo | ||
36 | { | ||
37 | public: | ||
38 | DataPointInfo() | ||
39 | : l( 0x0 ), v( 0.0 ) {} | ||
40 | DataPointInfo( const QString &label, float value ) | ||
41 | : l( label ), v( value ) {} | ||
42 | |||
43 | const QString &label() { return l; } | ||
44 | float value() { return v; } | ||
45 | |||
46 | private: | ||
47 | QString l; | ||
48 | float v; | ||
49 | }; | ||
50 | |||
51 | typedef QList<DataPointInfo> DataPointList; | ||
52 | |||
53 | class GraphInfo | ||
54 | { | ||
55 | public: | ||
56 | enum GraphType { BarChart, LineChart, PieChart }; | ||
57 | |||
58 | GraphInfo( GraphType = BarChart, DataPointList * = 0x0, | ||
59 | const QString & = 0x0, const QString & = 0x0, const QString & = 0x0 ); | ||
60 | |||
61 | GraphInfo::GraphType graphType(); | ||
62 | void setGraphType( GraphType ); | ||
63 | |||
64 | DataPointList *dataPoints(); | ||
65 | void setDataPoints( DataPointList * ); | ||
66 | |||
67 | float maxValue(); | ||
68 | float minValue(); | ||
69 | |||
70 | void setGraphTitle( const QString & ); | ||
71 | void setXAxisTitle( const QString & ); | ||
72 | void setYAxisTitle( const QString & ); | ||
73 | |||
74 | private: | ||
75 | GraphType t; | ||
76 | DataPointList *d; | ||
77 | QString gt; | ||
78 | QString xt; | ||
79 | QString yt; | ||
80 | }; | ||
81 | |||
82 | #endif | ||