|
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 "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: Declares svg file details dialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SVGTFILEVIEWDETAILSDIALOG_H |
|
21 #define SVGTFILEVIEWDETAILSDIALOG_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <aknPopup.h> |
|
26 #include <SVGTDrmHelper.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 class CAknDoublePopupMenuStyleListBox; |
|
31 class CEikonEnv; |
|
32 |
|
33 |
|
34 // CLASS DECLARATIONS |
|
35 |
|
36 /** |
|
37 * CSvgtFileDetails |
|
38 * Container class for file details |
|
39 */ |
|
40 class CSvgtFileDetails : public CBase |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * C++ default constructor. |
|
46 */ |
|
47 CSvgtFileDetails(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CSvgtFileDetails(); |
|
53 |
|
54 public: // Data |
|
55 |
|
56 HBufC* iUrl; |
|
57 HBufC* iFormat; |
|
58 |
|
59 TInt iSize; |
|
60 TTime iTime; |
|
61 |
|
62 |
|
63 // Drm stuff |
|
64 TBool iDrmProtected; |
|
65 TSVGTRightsStatus iDRMRightsStatus; |
|
66 TSVGTExpireConstraint iDRMExpireConstraint; |
|
67 TBool iDRMForwardLocked; |
|
68 TUint32 iDRMCountsLeft; |
|
69 |
|
70 TBool iDRMFileHasInterval; |
|
71 TBool iDRMIntervalActive; |
|
72 TTimeIntervalSeconds iDRMInterval; |
|
73 |
|
74 TTime iDRMValidFrom; |
|
75 TTime iDRMValidUntil; |
|
76 |
|
77 }; |
|
78 |
|
79 |
|
80 |
|
81 /** |
|
82 * CSvgtFileViewDetailsDialog |
|
83 * Used to display "View Details" option |
|
84 * Makes use of SVGTdrmhelper to display the drm details |
|
85 * |
|
86 * @lib SVGTFileDetailsDialog.lib |
|
87 * @since 2.0 |
|
88 */ |
|
89 class CSvgtFileViewDetailsDialog : public CBase |
|
90 { |
|
91 public: // Constructors and destructor |
|
92 |
|
93 /** |
|
94 * Two-phased constructor. |
|
95 */ |
|
96 IMPORT_C static CSvgtFileViewDetailsDialog* NewL(); |
|
97 |
|
98 /** |
|
99 * Destructor. |
|
100 */ |
|
101 virtual ~CSvgtFileViewDetailsDialog(); |
|
102 |
|
103 public: // New functions |
|
104 |
|
105 |
|
106 /** |
|
107 * Shows file details to user in dialog. |
|
108 * @since 3.0 |
|
109 * @param aFileHandle File handle for which usage rights info is loaded. |
|
110 * @leaves Leaves with KErrNotSupported if file is not valid media file. |
|
111 * @return void |
|
112 */ |
|
113 IMPORT_C void ExecuteLD( RFile& aFileHandle ); |
|
114 |
|
115 private: |
|
116 |
|
117 /** |
|
118 * C++ default constructor. |
|
119 */ |
|
120 CSvgtFileViewDetailsDialog(); |
|
121 |
|
122 /** |
|
123 * By default Symbian 2nd phase constructor is private. |
|
124 */ |
|
125 void ConstructL(); |
|
126 |
|
127 private: // New functions |
|
128 |
|
129 /** |
|
130 * Sets title for CAknPopupList. |
|
131 * @since 3.0 |
|
132 * @param aPopupList CAknPopupList which title is modified |
|
133 * @return void |
|
134 */ |
|
135 void SetTitleL( CAknPopupList* aPopupList ) const; |
|
136 |
|
137 /** |
|
138 * Fills listbox with file details information. |
|
139 * @since 3.0 |
|
140 * @param aFileDetails File details |
|
141 * @return void |
|
142 */ |
|
143 void FillListBoxL( const CSvgtFileDetails* aFileDetails ); |
|
144 |
|
145 /** |
|
146 * Adds header and value to list. |
|
147 * @since 3.0 |
|
148 * @param aHeading Heading |
|
149 * @param aValue Value |
|
150 * @param aItemArray Array where value and header are added. |
|
151 * @return void |
|
152 */ |
|
153 void AddItemToListBoxL( const TDesC& aHeading, const TDesC& aValue, |
|
154 CDesCArray* aItemArray ) const; |
|
155 |
|
156 |
|
157 /** |
|
158 * Constructs clip url item. |
|
159 * @since 3.0 |
|
160 * @param aItemArray Array where constructed item is put. |
|
161 * @param aFileDetails File details. |
|
162 * @return void |
|
163 */ |
|
164 void MakeUrlItemL( CDesCArray* aItemArray, |
|
165 const CSvgtFileDetails* aFileDetails ) const; |
|
166 |
|
167 /** |
|
168 * Constructs media format item. |
|
169 * @since 3.0 |
|
170 * @param aItemArray Array where constructed item is put. |
|
171 * @param aFileDetails File details. |
|
172 * @return void |
|
173 */ |
|
174 void MakeFormatItemL( CDesCArray* aItemArray, |
|
175 const CSvgtFileDetails* aFileDetails ) const; |
|
176 |
|
177 |
|
178 /** |
|
179 * Constructs file size item. |
|
180 * @since 3.0 |
|
181 * @param aItemArray Array where constructed item is put. |
|
182 * @param aFileDetails File details. |
|
183 * @return void |
|
184 */ |
|
185 void MakeSizeItemL( CDesCArray* aItemArray, |
|
186 const CSvgtFileDetails* aFileDetails ) const; |
|
187 |
|
188 /** |
|
189 * Constructs date item. |
|
190 * @since 3.0 |
|
191 * @param aItemArray Array where constructed item is put. |
|
192 * @param aFileDetails File details. |
|
193 * @return void |
|
194 */ |
|
195 void MakeDateItemL( CDesCArray* aItemArray, |
|
196 const CSvgtFileDetails* aFileDetails ) const; |
|
197 |
|
198 /** |
|
199 * Constructs time item. |
|
200 * @since 3.0 |
|
201 * @param aItemArray Array where constructed item is put. |
|
202 * @param aFileDetails File details. |
|
203 * @return void |
|
204 */ |
|
205 void MakeTimeItemL( CDesCArray* aItemArray, |
|
206 const CSvgtFileDetails* aFileDetails ) const; |
|
207 /** |
|
208 * Converts between arabic-indic digits and european digits. |
|
209 * @since 3.0 |
|
210 * @param aText numbers to be converted. |
|
211 * @return void |
|
212 */ |
|
213 void LanguageSpecificNumberConversion( TDes& aText) const; |
|
214 |
|
215 /** |
|
216 * Fetches drm file details. |
|
217 * @since 3.0 |
|
218 * @param aFileHandle File handle for which usage rights info is loaded. |
|
219 * @param aFileDetails Pointer to the details to be fetched. |
|
220 * @return void |
|
221 */ |
|
222 void FetchDrmDataL( RFile& aFileHandle, |
|
223 CSvgtFileDetails* aFileDetails ) const; |
|
224 |
|
225 |
|
226 /** |
|
227 * Constructs DRM items. |
|
228 * @since 3.0 |
|
229 * @param aItemArray Array where constructed item is put. |
|
230 * @param aFileDetails File details. |
|
231 * @return void |
|
232 */ |
|
233 void MakeDrmItemsL( CDesCArray* aItemArray, |
|
234 const CSvgtFileDetails* aFileDetails ) const; |
|
235 |
|
236 /** |
|
237 * Constructs restricted drm items. E.g. count, interval |
|
238 * @since 3.0 |
|
239 * @param aRights Drm right type "Play" |
|
240 * @param aItemArray Array where constructed item is put. |
|
241 * @param aFileDetails File details. |
|
242 * @return void |
|
243 */ |
|
244 void MakeRestrictedDrmItemsL( const HBufC* aRights, |
|
245 CDesCArray* aItemArray, |
|
246 const CSvgtFileDetails* aFileDetails ) const; |
|
247 |
|
248 /** |
|
249 * Add a single element of time to the string array |
|
250 * @param aNumOfElements Number of elements of the interval |
|
251 * @param aResourceIdSingle Resource id to be used in case of |
|
252 * single unit |
|
253 * @param aResourceIdOneFinal Resource id to be used in case of |
|
254 * units ending with 1, from 21 |
|
255 * (requested by Slavic languages) |
|
256 * @param aResourceIdTwoFour Resource id to be used in case of |
|
257 * units included from two to four, except |
|
258 * 12-14 (requested by Slavic languages) |
|
259 * @param aResourceIdFiveZero Resource id to be used in case of |
|
260 * units ending from 5 to 9, plus range |
|
261 * from 11 to 14 (requested by Slavic |
|
262 * languages) |
|
263 * @param aStrings Buffer where to add the element |
|
264 */ |
|
265 void AddSinglePartOfTimeL( TInt aNumOfElements, |
|
266 TInt aResourceIdSingle, |
|
267 TInt aResourceIdOneFinal, |
|
268 TInt aResourceIdTwoFour, |
|
269 TInt aResourceIdFiveZero, |
|
270 HBufC*& aStrings ) const; |
|
271 |
|
272 void AddResourceFileToEnvL(); |
|
273 |
|
274 /** |
|
275 * Shows file details to user in dialog. |
|
276 * @since 3.0 |
|
277 * @param aFileDetails File details which are shown to user. |
|
278 * @return void |
|
279 */ |
|
280 // void ExecuteLD( const CSvgtFileDetails* aFileDetails ); |
|
281 void DoLaunchDialogL(const CSvgtFileDetails* aFileDetails ); |
|
282 |
|
283 private: // Data |
|
284 CAknDoublePopupMenuStyleListBox* iListBox; |
|
285 CEikonEnv* iEnv; |
|
286 TInt iResOffset; |
|
287 }; |
|
288 |
|
289 #endif //SVGTFILEVIEWDETAILSDIALOG_H |
|
290 |
|
291 // End of File |