Add HAVE_NO_PACKAGEKIT for better UI dev.
[meego-garage:garage-client-services.git] / src / applicationstatusstorage.h
1 #ifndef APPLICATIONSTATUSSTORAGE_H
2 #define APPLICATIONSTATUSSTORAGE_H
3
4 #include <QObject>
5 #include <QtXml/QDomDocument>
6 #include <QUuid>
7 #include <QHash>
8 #include <QList>
9 #include "application.h"
10
11 namespace MeeGoGarage {
12
13 class ApplicationStatusStorage : public QObject
14 {
15 Q_OBJECT
16 public:
17     ApplicationStatusStorage();
18
19     /// applications must be registered before reading files
20     void registerApplications(QList<Application*> appList);
21     void updateApplications(QList<Application*> appList);
22     QList<Application*> getOldOrUnknownApps();
23
24     bool read(QIODevice *device);
25     bool write(QIODevice *device);
26
27 public slots:
28
29     void onApplicationStatusUpdated(Application::ApplicationStatus status, bool fromCache);
30
31 private:
32     void parseDomElement(QDomElement & element);
33     void updateDomElement(Application *item);
34
35     QDomDocument m_domDocument;
36     QHash<QString, QDomElement> m_domElementForUuid;
37     QHash<QString, Application*> m_applicationForUuid;
38
39 };
40
41 } // namespace MeeGoGarage
42
43 #endif // APPLICATIONSTATUSSTORAGE_H