|
1 /** |
|
2 This file is part of CWRT package ** |
|
3 |
|
4 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** |
|
5 |
|
6 This program is free software: you can redistribute it and/or modify |
|
7 it under the terms of the GNU (Lesser) General Public License as |
|
8 published by the Free Software Foundation, version 2.1 of the License. |
|
9 This program is distributed in the hope that it will be useful, but |
|
10 WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 (Lesser) General Public License for more details. You should have |
|
13 received a copy of the GNU (Lesser) General Public License along |
|
14 with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 */ |
|
16 |
|
17 #ifndef DOWNLOAD_H |
|
18 #define DOWNLOAD_H |
|
19 |
|
20 #include "dmcommon.h" |
|
21 #include "downloadevent.h" |
|
22 #include <QObject> |
|
23 |
|
24 class DownloadManager; |
|
25 class QNetworkReply; |
|
26 class DownloadInfo; |
|
27 class DownloadPrivate; |
|
28 |
|
29 typedef QList<QObject*> EventReceiverList; |
|
30 |
|
31 // class declaration |
|
32 class Download : public QObject |
|
33 { |
|
34 Q_OBJECT |
|
35 public: |
|
36 virtual ~Download() {}; |
|
37 |
|
38 // starts the download |
|
39 virtual int start() = 0; |
|
40 // id of the download |
|
41 virtual int id() = 0; |
|
42 // sets the attributes for the download |
|
43 virtual int setAttribute(DownloadAttribute attr, const QVariant& value) = 0; |
|
44 // fetches the attributes of download |
|
45 virtual QVariant getAttribute(DownloadAttribute attr) = 0; |
|
46 // pauses the download |
|
47 virtual int pause() = 0; |
|
48 // resumes the download |
|
49 virtual int resume() = 0; |
|
50 // cancels the download |
|
51 virtual int cancel() = 0; |
|
52 // registers the event listener |
|
53 virtual void registerEventReceiver(QObject *receiver) = 0; |
|
54 // unregisters the event listener |
|
55 virtual void unregisterEventReceiver(QObject *receiver) = 0; |
|
56 // returns the download manager |
|
57 virtual DownloadManager *downloadManager() = 0; |
|
58 // returns the list of child downloads |
|
59 virtual void getChildren(QList<Download*>& list) = 0; |
|
60 }; |
|
61 |
|
62 #endif |