|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Vod Dl event object* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CIPTVVODDLDOWNLOADEVENT_H |
|
22 #define CIPTVVODDLDOWNLOADEVENT_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "CIptvUtil.h" |
|
27 |
|
28 #include "MIptvEvent.h" |
|
29 #include "TIptvVodDlDownloadId.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 |
|
34 // MACROS |
|
35 |
|
36 // DATA TYPES |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // CLASS DECLARATION |
|
43 class RDesReadStream; |
|
44 class RDesWriteStream; |
|
45 class CIptvMyVideosGlobalFileId; |
|
46 |
|
47 /** |
|
48 * Used for sending download events from VOD DL Manager to client. |
|
49 * |
|
50 * @lib IptvClientApi.lib |
|
51 */ |
|
52 class CIptvVodDlDownloadEvent : public CBase, public MIptvEvent |
|
53 { |
|
54 public: |
|
55 |
|
56 /** |
|
57 * Identifies the type of the event. Type specifies which member fields contain |
|
58 * valid data. |
|
59 */ |
|
60 enum TEvent |
|
61 { |
|
62 /** |
|
63 * VOD download state change event. |
|
64 * All members are valid. |
|
65 */ |
|
66 EDownloadState = 0, |
|
67 |
|
68 /** |
|
69 * Response event to CIptvVodDlClient::DownloadReqL() method call. |
|
70 * iGlobalFileIsValid and iServiceIdAndContentIdAreValid members indicate which ids are usable. |
|
71 * iProgress and iState members do not contain valid data. |
|
72 * Download request failed, no download instance was created, iError and iGlobalError members |
|
73 * contain reason codes. |
|
74 */ |
|
75 EDownloadReqFailed, |
|
76 |
|
77 /** |
|
78 * Response event to CIptvVodDlClient::DownloadReqL() method call. |
|
79 * iGlobalFileIsValid and iServiceIdAndContentIdAreValid members indicate which ids are usable. |
|
80 * iProgress and iState members do not contain valid data. |
|
81 * Download request succeeded, download instance was created, EDownloadState |
|
82 * messages will follow. |
|
83 */ |
|
84 EDownloadReqSucceeded, |
|
85 |
|
86 /** |
|
87 * Response event to CIptvVodDlClient::CancelDownloadReqL() method call. |
|
88 * iGlobalFileIsValid and iServiceIdAndContentIdAreValid members indicate which ids are usable. |
|
89 * iProgress and iState members do not contain valid data. |
|
90 * Request failed, iError and iGlobalError members contain reason codes. |
|
91 */ |
|
92 ECancelReqFailed, |
|
93 |
|
94 /** |
|
95 * Response event to CIptvVodDlClient::CancelDownloadReqL() method call. |
|
96 * iGlobalFileIsValid and iServiceIdAndContentIdAreValid members indicate which ids are usable. |
|
97 * iProgress and iState members do not contain valid data. |
|
98 * Request succeeded and cancel process started, EDownloadState messages |
|
99 * show when download is gone (iState = KIptvVodDlDownloadDeletedCompletely). |
|
100 * Notice that client might get ECancelReqSucceeded message after KIptvVodDlDownloadDeletedCompletely. |
|
101 */ |
|
102 ECancelReqSucceeded, |
|
103 |
|
104 /** |
|
105 * Event indicating that details of download item(s) has been modified. Occurs if EPG |
|
106 * data related to download has been modified during download. Forces client to rebuild |
|
107 * its information about on-going downloads. |
|
108 */ |
|
109 EDownloadItemsModified, |
|
110 |
|
111 /** |
|
112 * Response event to CIptvVodDlClient::DownloadReqL() method call. |
|
113 * This is response for single file download. |
|
114 * iServiceId is only usable ident. iContentIndex will contain original request. |
|
115 * iState contain result. iProgress member do not contain valid data. |
|
116 * Download request is completed. |
|
117 */ |
|
118 EDownloadSingleFileCompleted |
|
119 }; |
|
120 |
|
121 public: // Constructors and destructor |
|
122 |
|
123 /** |
|
124 * Two-phased constructor. |
|
125 */ |
|
126 IMPORT_C static CIptvVodDlDownloadEvent* NewL(); |
|
127 |
|
128 /** |
|
129 * Destructor. |
|
130 */ |
|
131 IMPORT_C virtual ~CIptvVodDlDownloadEvent(); |
|
132 |
|
133 public: |
|
134 |
|
135 //from MIptvEvent |
|
136 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
137 IMPORT_C void ExternalizeL(RWriteStream& aStream); |
|
138 IMPORT_C TUint32 CountExternalizeSize(); |
|
139 IMPORT_C MIptvEvent* GetCopyL(); |
|
140 IMPORT_C void Destruct(); |
|
141 |
|
142 IMPORT_C void Set(CIptvVodDlDownloadEvent& aEvent); |
|
143 |
|
144 private: |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 */ |
|
149 CIptvVodDlDownloadEvent(); |
|
150 |
|
151 /** |
|
152 * By default Symbian 2nd phase constructor is private. |
|
153 */ |
|
154 void ConstructL(); |
|
155 |
|
156 public: // Data |
|
157 |
|
158 /** |
|
159 * Identifies the type of the event. Type specifies which member fields contain |
|
160 * valid data. |
|
161 */ |
|
162 TEvent iEvent; |
|
163 |
|
164 /** |
|
165 * ETrue if global file ID is valid and can be used. |
|
166 */ |
|
167 TBool iGlobalFileIdIsValid; |
|
168 |
|
169 /** |
|
170 * File ID in My Videos. |
|
171 */ |
|
172 CIptvMyVideosGlobalFileId* iGlobalFileId; |
|
173 |
|
174 /** |
|
175 * If ETrue, then iServiceId and iContentId contain valid data. |
|
176 */ |
|
177 TBool iServiceIdAndContentIdAreValid; |
|
178 |
|
179 /** |
|
180 * Service ID in Service Manager database. |
|
181 */ |
|
182 TUint32 iServiceId; |
|
183 |
|
184 /** |
|
185 * Content ID in EPG database. |
|
186 */ |
|
187 TUint32 iContentId; |
|
188 |
|
189 /** |
|
190 * Content index in EPG database. |
|
191 */ |
|
192 TUint32 iContentIndex; |
|
193 |
|
194 /** |
|
195 * Download progress in percentages. |
|
196 */ |
|
197 TUint8 iProgress; |
|
198 |
|
199 /** |
|
200 * Download state, see possible states from CIptvUtil.h |
|
201 */ |
|
202 TUint32 iState; |
|
203 |
|
204 /** |
|
205 * VOD DL specific error code is stored here. |
|
206 */ |
|
207 TIptvDlError iError; |
|
208 |
|
209 /** |
|
210 * Global error code is stored here. This variable is used |
|
211 * when functions leave or return error value and they are |
|
212 * not directly related to download, e.g memory runs out etc. |
|
213 * If iGlobalError != KErrNone then iError is EIptvDlGeneral. |
|
214 */ |
|
215 TInt iGlobalError; |
|
216 |
|
217 }; |
|
218 |
|
219 #endif // CIPTVVODDLEVENT_H |
|
220 |
|
221 // End of File |