|
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 DOWNLOADEVENT_H |
|
18 #define DOWNLOADEVENT_H |
|
19 |
|
20 #include <QEvent> |
|
21 #include <QVariant> |
|
22 #include "dmcommon.h" |
|
23 #include "dmpimpl.h" |
|
24 |
|
25 // forward declarations |
|
26 class DownloadEventPrivate; |
|
27 class DownloadManagerEventPrivate; |
|
28 |
|
29 // typedef |
|
30 typedef QMap<DownloadEventAttribute, QVariant> DlEventAttributeMap; |
|
31 typedef QMap<DownloadManagerEventAttribute, QVariant> DlManagerEventAttributeMap; |
|
32 |
|
33 |
|
34 // class declarations |
|
35 |
|
36 // DownloadEvent for download events |
|
37 class DownloadEvent : public QEvent |
|
38 { |
|
39 DM_DECLARE_PRIVATE(DownloadEvent); // private implementation |
|
40 public: |
|
41 DownloadEvent(DEventType type, DlEventAttributeMap* attrMap, int id); |
|
42 ~DownloadEvent(); |
|
43 |
|
44 // to fetch the download event related attributes |
|
45 Q_DECL_EXPORT QVariant getAttribute(DownloadEventAttribute attr); |
|
46 // to fetch the id of download object which is the sender of this event |
|
47 Q_DECL_EXPORT int getId(); |
|
48 }; |
|
49 |
|
50 // DownloadManagerEvent for download manager events |
|
51 class DownloadManagerEvent : public QEvent |
|
52 { |
|
53 DM_DECLARE_PRIVATE(DownloadManagerEvent); // private implementation |
|
54 public: |
|
55 DownloadManagerEvent(DEventType type, DlManagerEventAttributeMap* attrMap); |
|
56 ~DownloadManagerEvent(); |
|
57 |
|
58 // to fetch the download manager event related attributes |
|
59 QVariant getAttribute(DownloadManagerEventAttribute attr); |
|
60 }; |
|
61 |
|
62 #endif //DOWNLOADEVENT_H |