|
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_INTERNAL_H_ |
|
18 #define DOWNLOAD_COMMON_INTERNAL_H_ |
|
19 |
|
20 #define OMA_CONTENT_TYPE "application/vnd.oma.dd+xml" |
|
21 #define OMA_VERSION_1 "1.0" |
|
22 #define OMA2_CONTENT_TYPE "application/vnd.oma.dd2+xml" |
|
23 #define OMA_VERSION_2 "2.0" |
|
24 #define OMA_DRM_MESSAGE_CONTENT_TYPE "application/vnd.oma.drm.message" |
|
25 #define WMDRM_CONTENT_TYPE "application/vnd.ms-wmdrm.lic-chlg-req" |
|
26 #define ROOT_PATH "/root/" |
|
27 |
|
28 // DownloadManagerServer definitions |
|
29 #define DM_FIELD_DELIMITER ";" |
|
30 #define DM_MSG_DELIMITER "&" |
|
31 #define CLIENTNAME_SUFFIX "_Background" |
|
32 #define DMSERVER "WrtDownloadManagerServer" |
|
33 #ifdef Q_OS_LINUX |
|
34 #define DMSERVEREXE "./WrtDownloadManagerServer" |
|
35 #else |
|
36 #define DMSERVEREXE "WrtDownloadManagerServer.exe" |
|
37 #endif |
|
38 |
|
39 // DownloadManagerClient definitions |
|
40 #define EVENTS_REQUEST_INTERVAL 50 |
|
41 |
|
42 // enum for progressive download operations supported |
|
43 enum ProgressiveOperation |
|
44 { |
|
45 DlPause = 0, |
|
46 DlResume, |
|
47 DlCancel, |
|
48 DlGetAttribute |
|
49 }; |
|
50 |
|
51 // enum for operations supported |
|
52 enum ProgressiveResponse |
|
53 { |
|
54 ProgressiveDlPaused = 0, |
|
55 ProgressiveDlInprogress, |
|
56 ProgressiveDlCompleted, |
|
57 ProgressiveDlCancelled, |
|
58 ProgressiveDlFailed, |
|
59 ProgressiveDlGetAttribute, |
|
60 ProgressiveDlServerDown |
|
61 }; |
|
62 |
|
63 // enum for http status codes |
|
64 // NOTE: do not change order |
|
65 enum HttpStatusCode |
|
66 { |
|
67 HttpOK = 200, // 200 = ok |
|
68 HttpCreated, // 201 = created |
|
69 HttpAccepted, // 202 = accepted |
|
70 HttpNonAuthorativeInfo, // 203 = non-authorative information |
|
71 HttpNoContent, // 204 = no content |
|
72 HttpResetContent, // 205 = reset content |
|
73 HttpPartialContent, // 206 = partial content |
|
74 HttpNotFound = 404, // 404 = not found |
|
75 HttpPreconditionFailed = 412 // 412 = precondition failed |
|
76 }; |
|
77 |
|
78 enum ClientServerOpCode |
|
79 { |
|
80 // Events |
|
81 GetEvents = 0, // 0 |
|
82 // Download Manager operation |
|
83 StartupInfo, // 1 |
|
84 SetDownloadManagerAttribute, // 2 |
|
85 GetDownloadManagerAttribute, // 3 |
|
86 SetProxy, // 4 |
|
87 CreateDownload, // 5 |
|
88 RemoveDownload, // 6 |
|
89 PauseAll, // 7 |
|
90 ResumeAll, // 8 |
|
91 RemoveAll, // 9 |
|
92 // Download operation |
|
93 StartDownload, // 10 |
|
94 PauseDownload, // 11 |
|
95 ResumeDownload, // 12 |
|
96 CancelDownload, // 13 |
|
97 SetDownloadAttribute, // 14 |
|
98 GetDownloadAttribute, // 15 |
|
99 GetDownloadIds, // 16 |
|
100 AttachToDownload // 17 |
|
101 }; |
|
102 |
|
103 enum ClientServerEventMessage |
|
104 { |
|
105 EventDownloadManager = 0, // 0 |
|
106 EventDownload // 1 |
|
107 }; |
|
108 |
|
109 #endif /*DOWNLOAD_COMMON_INTERNAL_H_ */ |
|
110 |
|
111 |