@@ -0,0 +1,60 @@
1+/*
2+ * Copyright (C) 2013 - Canonical Ltd.
3+ *
4+ * This program is free software: you can redistribute it and/or modify it
5+ * under the terms of the GNU Lesser General Public License, as
6+ * published by the Free Software Foundation; either version 2.1 or 3.0
7+ * of the License.
8+ *
9+ * This program is distributed in the hope that it will be useful, but
10+ * WITHOUT ANY WARRANTY; without even the implied warranties of
11+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12+ * PURPOSE. See the applicable version of the GNU Lesser General Public
13+ * License for more details.
14+ *
15+ * You should have received a copy of both the GNU Lesser General Public
16+ * License along with this program. If not, see <http://www.gnu.org/licenses/>
17+ *
18+ * Authored by: Diego Sarmentero <diego.sarmentero@canonical.com>
19+ */
20+
21+
22+#ifndef MYTYPE_H
23+#define MYTYPE_H
24+
25+#include <QObject>
26+#include <QList>
27+
28+class DownloadTracker : public QObject
29+{
30+ Q_OBJECT
31+ Q_DISABLE_COPY(DownloadTracker)
32+ Q_PROPERTY(QString service WRITE setService)
33+ Q_PROPERTY(QString dbusPath WRITE setDbusPath)
34+ Q_PROPERTY(bool serviceReady READ isServiceReady)
35+
36+public:
37+ explicit DownloadTracker(QObject *parent = 0);
38+
39+ void setDbusPath(QString& path);
40+ void setService(QString& service);
41+ bool isServiceReady();
42+
43+Q_SIGNALS:
44+ void canceled(bool success);
45+ void error(const QString &error);
46+ void finished(const QString &path);
47+ void paused(bool success);
48+ void progress(qulonglong received, qulonglong total);
49+ void resumed(bool success);
50+ void started(bool success);
51+
52+private:
53+ QString m_dbusPath;
54+ QString m_service;
55+ bool active = false;
56+
57+ void startService();
58+};
59+
60+#endif // MYTYPE_H