Connecting client-server communication to new GUI.
[speedfreak] / Client / categorylist.h
1 /*
2  * Categorylist
3  *
4  * @author     Olavi Pulkkinen <olavi.pulkkinena@fudeco.com>
5  * @author     Tiina Kivilinna-Korhola <tiina.kivilinna-korhola@fudeco.com>
6  * @copyright  (c) 2010 Speed Freak team
7  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
8  */
9
10 #ifndef CATEGORYLIST_H
11 #define CATEGORYLIST_H
12
13 #include <QStringList>
14
15 class CategoryList : public QObject
16 {
17 public:
18     CategoryList();
19     ~CategoryList();
20     QString top10List;
21     int realSizeOfCats;
22
23     QStringList getCategoryList();
24     void fillCategoryList(int index, QString item);
25     void appendCategoryList(QString item);
26     QString itemOfCategoryList(int index);
27     QString getTopList( QString category, int size);
28     void clearCategoryList();
29     int sizeOfCategoryList();
30     void appendCats(int ind, QString des, QString uni, QString cat);
31     void clearCats();
32     QString getRecentDescription(int i);
33     QString getRecentCategory(int ind);
34
35 private:
36     QStringList categoryList;   //Stores categories. categoryList is routed to UI.
37     typedef struct {
38         QString category;       //name of category variable
39         QString description;    //verbal description of category
40         QString unit;           //km/h, miles/h
41     } categoryElements;
42     categoryElements cats[20];
43
44 };
45
46 #endif // CATEGORYLIST_H