Added qanimationlabel to show loading icon while loading stuff form server
[meego-garage:garage-netbook-ui.git] / src / model.h
1 #ifndef MODEL_H
2 #define MODEL_H
3
4 #include <Qt/QtGui>
5 #include <QObject>
6 #include <QList>
7 #include <QIcon>
8 #include <QSharedPointer>
9 #include <QWeakPointer>
10
11 #include "application.h"
12 #include "category.h"
13
14 class QStandardItemModel;
15
16 namespace MeeGoGarage {
17
18 struct GarageClientServices;
19 class CategoryModel;
20
21 /**
22   Gets the time in string format
23   */
24 QString getDurationString(int seconds);
25
26 class Model : public QObject
27 {
28 Q_OBJECT
29 public:
30     explicit Model(QObject *parent = 0);
31     ~Model();
32     /// Get singleton instance
33     static QSharedPointer<Model> model();
34
35     void init();
36     void finish();
37
38     /// access to the garage client services
39     GarageClientServices * garageClientServices();
40
41     static QIcon getApplicationIcon(Application *);
42
43 signals:
44
45 private slots:
46
47     void onGarageClientServicesInitialized(int);
48
49 private:
50
51     static QSharedPointer<Model> mInstance;
52     QWeakPointer<GarageClientServices> mGarageClientServices;
53     bool mInitialized;
54
55 };
56
57 } // namespace MeeGoGarage
58
59 #endif // MODEL_H