1 /* |
1 /* |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
4 * |
9 * Initial Contributors: |
5 * This program is free software: you can redistribute it and/or modify |
10 * Nokia Corporation - initial contribution. |
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
11 * |
8 * |
12 * Contributors: |
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
13 * |
13 * |
14 * Description: |
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
15 * |
19 * |
16 */ |
20 */ |
17 |
|
18 |
21 |
19 #ifndef __DOWNLOADS_H__ |
22 #ifndef __DOWNLOADS_H__ |
20 #define __DOWNLOADS_H__ |
23 #define __DOWNLOADS_H__ |
21 |
24 |
22 #include <QObject> |
25 #include <QObject> |
23 |
26 |
|
27 #include "downloadproxy.h" |
|
28 |
|
29 class QUrl; |
24 class QWebPage; |
30 class QWebPage; |
25 |
31 |
26 class DownloadController; |
32 class DownloadController; |
27 class Download; |
|
28 |
33 |
29 namespace GVA { |
34 namespace GVA { |
30 |
35 |
31 class Downloads : public QObject |
36 class Downloads : public QObject |
32 { |
37 { |
36 Downloads(); |
41 Downloads(); |
37 virtual ~Downloads(); |
42 virtual ~Downloads(); |
38 |
43 |
39 void handlePage(QWebPage * page); |
44 void handlePage(QWebPage * page); |
40 |
45 |
|
46 public slots: |
|
47 void downloadImage(const QString & imageUrl); |
|
48 |
41 private slots: |
49 private slots: |
42 void reportDownloadCreated(Download * download); |
50 void reportDownloadCreated(DownloadProxy downloadProxy); |
43 void reportDownloadStarted(Download * download); |
51 void reportDownloadStarted(DownloadProxy downloadProxy); |
44 void reportDownloadSuccess(Download * download); |
52 void reportDownloadSuccess(DownloadProxy downloadProxy); |
45 void reportDownloadFailure(Download * download, const QString & error); |
53 void reportDownloadFailure(DownloadProxy downloadProxy, const QString & error); |
|
54 void reportUnsupportedDownload(const QUrl & url); |
46 |
55 |
47 signals: |
56 signals: |
48 void downloadCreated(const QString & messageHTML); |
57 void downloadCreated(const QString & messageHTML); |
49 void downloadStarted(const QString & messageHTML); |
58 void downloadStarted(const QString & messageHTML); |
50 void downloadSuccess(const QString & messageHTML); |
59 void downloadSuccess(const QString & messageHTML); |
51 void downloadFailure(const QString & messageHTML); |
60 void downloadFailure(const QString & messageHTML); |
52 void downloadsCleared(); |
61 void downloadsCleared(); |
|
62 void unsupportedDownload(const QString & messageHTML); |
53 |
63 |
54 private: |
64 private: |
55 DownloadController * m_downloadController; |
65 DownloadController * m_downloadController; |
56 }; |
66 }; |
57 |
67 |