|
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: Contains information of ongoing download* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <s32mem.h> |
|
23 #include "CIptvUtil.h" |
|
24 #include "IptvDebug.h" |
|
25 |
|
26 #include "CIptvMyVideosGlobalFileId.h" |
|
27 #include "CIptvVodDlDownloadListItem.h" |
|
28 |
|
29 // EXTERNAL DATA STRUCTURES |
|
30 |
|
31 // EXTERNAL FUNCTION PROTOTYPES |
|
32 |
|
33 // CONSTANTS |
|
34 |
|
35 // MACROS |
|
36 |
|
37 // LOCAL CONSTANTS AND MACROS |
|
38 |
|
39 // MODULE DATA STRUCTURES |
|
40 |
|
41 // LOCAL FUNCTION PROTOTYPES |
|
42 |
|
43 // FORWARD DECLARATIONS |
|
44 |
|
45 // ============================= LOCAL FUNCTIONS =============================== |
|
46 |
|
47 // ============================ MEMBER FUNCTIONS =============================== |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CIptvVodDlDownloadListItem::CIptvVodDlDownloadListItem |
|
51 // C++ default constructor can NOT contain any code, that |
|
52 // might leave. |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CIptvVodDlDownloadListItem::CIptvVodDlDownloadListItem() |
|
56 { |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CIptvVodDlDownloadListItem::ConstructL |
|
61 // Symbian 2nd phase constructor can leave. |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 void CIptvVodDlDownloadListItem::ConstructL() |
|
65 { |
|
66 iGlobalFileId = CIptvMyVideosGlobalFileId::NewL(); |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CIptvVodDlDownloadListItem::NewL |
|
71 // Two-phased constructor. |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C CIptvVodDlDownloadListItem* CIptvVodDlDownloadListItem::NewL() |
|
75 { |
|
76 CIptvVodDlDownloadListItem* self = new( ELeave ) CIptvVodDlDownloadListItem; |
|
77 |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(); |
|
80 CleanupStack::Pop(self); |
|
81 |
|
82 return self; |
|
83 } |
|
84 |
|
85 |
|
86 // Destructor |
|
87 EXPORT_C CIptvVodDlDownloadListItem::~CIptvVodDlDownloadListItem() |
|
88 { |
|
89 delete iGlobalFileId; |
|
90 } |
|
91 |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CIptvVodDlDownloadListItem::InternalizeL |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 EXPORT_C void CIptvVodDlDownloadListItem::InternalizeL(RReadStream& aStream) |
|
98 { |
|
99 iGlobalFileId->InternalizeL(aStream); |
|
100 iGlobalFileIdIsValid = static_cast<TBool>(aStream.ReadUint8L()); |
|
101 iServiceId = aStream.ReadUint32L(); |
|
102 iContentId = aStream.ReadUint32L(); |
|
103 iContentIndex = aStream.ReadUint32L(); |
|
104 iIapId = aStream.ReadUint32L(); |
|
105 iDlType = static_cast<TIptvDownloadType>(aStream.ReadUint8L()); |
|
106 iProgress = aStream.ReadUint32L(); |
|
107 iState = aStream.ReadUint32L(); |
|
108 iError = static_cast<TIptvDlError>(aStream.ReadUint32L()); |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CIptvVodDlDownloadListItem::ExternalizeL |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 EXPORT_C void CIptvVodDlDownloadListItem::ExternalizeL(RWriteStream& aStream) |
|
116 { |
|
117 iGlobalFileId->ExternalizeL(aStream); |
|
118 aStream.WriteUint8L(static_cast<TUint8>(iGlobalFileIdIsValid)); |
|
119 aStream.WriteUint32L(iServiceId); |
|
120 aStream.WriteUint32L(iContentId); |
|
121 aStream.WriteUint32L(iContentIndex); |
|
122 aStream.WriteUint32L(iIapId); |
|
123 aStream.WriteUint8L(static_cast<TUint8>(iDlType)); |
|
124 aStream.WriteUint32L(iProgress); |
|
125 aStream.WriteUint32L(iState); |
|
126 aStream.WriteUint32L(iError); |
|
127 } |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // CIptvVodDlDownloadListItem::CountExternalizeSize |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 EXPORT_C TUint32 CIptvVodDlDownloadListItem::CountExternalizeSize() |
|
134 { |
|
135 TUint32 size = 0; |
|
136 size = iGlobalFileId->CountExternalizeSize(); |
|
137 size += 1; //TBool iGlobalFileIdIsValid |
|
138 size += 4; //TUint32 iServiceId |
|
139 size += 4; //TUint32 iContentId |
|
140 size += 4; //TUint32 iContentIndex |
|
141 size += 4; //TUint32 iIapId |
|
142 size += 1; //TIptvDownloadType iDlType (TUint8) |
|
143 size += 4; //TUint32 iProgress |
|
144 size += 4; //TUint32 iState |
|
145 size += 4; //TIptvDlError iError |
|
146 return size; |
|
147 } |
|
148 |
|
149 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
150 |
|
151 // End of File |