|
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_COMMON_H_ |
|
18 #define DOWNLOAD_COMMON_H_ |
|
19 |
|
20 #define INVALID_DL_ID 0 |
|
21 #define IPC_ERR_START_VALUE -5000 |
|
22 |
|
23 // download states |
|
24 enum DownloadState |
|
25 { |
|
26 DlNone = 0, |
|
27 DlCreated, |
|
28 DlStarted, |
|
29 DlInprogress, |
|
30 DlPaused, |
|
31 DlCompleted, |
|
32 DlFailed, |
|
33 DlCancelled, |
|
34 DlDescriptorUpdated |
|
35 }; |
|
36 |
|
37 // download attributes |
|
38 enum DownloadAttribute |
|
39 { |
|
40 /* general download attributes */ |
|
41 DlDestPath = 0, // destination path(set) |
|
42 DlDownloadedSize, // downloaded size(get) |
|
43 DlTotalSize, // total size(get) |
|
44 DlDownloadState, // download state(get) |
|
45 DlFileName, // file name(set/get) |
|
46 DlSourceUrl, // source url(get) |
|
47 DlContentType, // content type(get) |
|
48 DlLastError, // last error occured(get) |
|
49 DlLastErrorString, // last error string(get) |
|
50 DlLastPausedSize, // last download paused size(get) |
|
51 |
|
52 /* OMA Download Attributes */ |
|
53 OMADownloadDescriptorName, // "name" in OMA dd |
|
54 OMADownloadDescriptorVersion, // "version" in OMA dd |
|
55 OMADownloadDescriptorType, // "type" in OMA dd |
|
56 OMADownloadDescriptorSize, // "size" in OMA dd |
|
57 OMADownloadDescriptorVendor, // "vendor" in OMA dd |
|
58 OMADownloadDescriptorDescription,// "description" in OMA dd |
|
59 OMADownloadDescriptorNextURL, // "nextURL" in OMA dd |
|
60 |
|
61 DlDownloadType, // download type (get) |
|
62 DlPriority, // download priority(set/get) |
|
63 DlDownloadScope, // download scope i.e normal/background(get) |
|
64 |
|
65 DlStartTime, // download start/resumed time in QDateTime (get) |
|
66 DlEndTime, // download end time in QDateTime if successfully completed (get) |
|
67 DlElapsedTime, // time elapsed since the download started/resumed( in secs (get) |
|
68 DlRemainingTime, // remaining time to download in secs(get) |
|
69 DlSpeed, // speed of the download in Bytes/sec(get) |
|
70 DlPercentage, // percentage of download(get) |
|
71 DlProgressInterval // KiloBytes at which progress event has to be sent(set/get) |
|
72 }; |
|
73 |
|
74 // download event attributes |
|
75 enum DownloadEventAttribute |
|
76 { |
|
77 HeaderReceivedStatusCode = 0 |
|
78 }; |
|
79 |
|
80 // download manager attributes |
|
81 enum DownloadManagerAttribute |
|
82 { |
|
83 DlMgrDestPath = 0, // destination path |
|
84 DlMgrDlCount, // total number of downloads |
|
85 DlMgrClientName, // client name |
|
86 DlMgrServerError, // last server error |
|
87 DlMgrProgressMode, // quiet/nonquiet |
|
88 DlMgrPersistantMode // Active/InActive |
|
89 }; |
|
90 |
|
91 // download manager event attributes |
|
92 enum DownloadManagerEventAttribute |
|
93 { |
|
94 }; |
|
95 |
|
96 // event types |
|
97 enum DEventType |
|
98 { |
|
99 DownloadCreated = 2000, // atleast one dowload exists - DownloadManager event |
|
100 DownloadsCleared, // no more downloads exist - DownloadManager event |
|
101 ConnectedToServer, // connected to download manager server |
|
102 DisconnectedFromServer, // disconnected from download manager server |
|
103 ServerError, // server error - DownloadManager event |
|
104 Started, // download started - Download event |
|
105 HeaderReceived, // download headers recieved - Download event |
|
106 Progress, // download is in progress, bytes recieved - Download event |
|
107 Completed, // download is completed - Download event |
|
108 Paused, // download is paused - Download event |
|
109 Cancelled, // download is cancelled - Download event |
|
110 Failed, // download is failed - Download event |
|
111 DescriptorUpdated, // download is restarted - Download event |
|
112 NetworkLoss, // Network is lost - Download event |
|
113 Error, // error occurred during download - Download event |
|
114 OMADownloadDescriptorReady, // OMA DD recieved and ready to be displayed - Download event |
|
115 WMDRMLicenseAcquiring // License acquisition in progress for wmdrm |
|
116 }; |
|
117 |
|
118 // download manager type |
|
119 enum DownloadType |
|
120 { |
|
121 Parallel = 0, |
|
122 Sequential |
|
123 }; |
|
124 |
|
125 // Sequential Download Priority |
|
126 enum DownloadPriority |
|
127 { |
|
128 High = 0, |
|
129 Low |
|
130 }; |
|
131 |
|
132 // Download scope |
|
133 enum DownloadScope |
|
134 { |
|
135 Normal = 0, |
|
136 Background |
|
137 }; |
|
138 |
|
139 enum DownloadMgrProgressMode |
|
140 { |
|
141 Quiet = 0, |
|
142 NonQuiet |
|
143 }; |
|
144 |
|
145 enum DownloadMgrPersistantMode |
|
146 { |
|
147 Active = 0, |
|
148 InActive |
|
149 }; |
|
150 |
|
151 #endif /*DOWNLOAD_COMMON_H_ */ |