|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef ASF_H |
|
21 #define ASF_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <f32file.h> |
|
25 |
|
26 // LOCAL CONSTANTS AND MACROS |
|
27 |
|
28 // CLASS DECLARATION |
|
29 class CAsfPartInfo; |
|
30 /** |
|
31 * Encapsulates an WMDRM file |
|
32 * |
|
33 * @lib DrmAsf.lib |
|
34 * @since Series 60 3.1 |
|
35 */ |
|
36 class CAsf: public CBase |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 IMPORT_C static CAsf* NewL( |
|
44 const RFile& aFile ); |
|
45 |
|
46 IMPORT_C static CAsf* NewL( |
|
47 const TDesC& aFileName ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 IMPORT_C virtual ~CAsf(); |
|
53 |
|
54 public: // Functions from base classes |
|
55 |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Validates whether ASF content is DRM protected or not. |
|
61 */ |
|
62 IMPORT_C static TBool IsProtected( |
|
63 const TDesC8& aAsfHeader); |
|
64 |
|
65 protected: |
|
66 |
|
67 /** |
|
68 * C++ default constructor. |
|
69 */ |
|
70 CAsf(); |
|
71 |
|
72 /** |
|
73 * Symbian 2nd phase constructor. |
|
74 */ |
|
75 void ConstructL( |
|
76 const RFile& aFile ); |
|
77 |
|
78 void ConstructL( |
|
79 const TDesC& aFileName ); |
|
80 |
|
81 private: // New functions |
|
82 |
|
83 /** |
|
84 * ValidateL(); |
|
85 * Validates whether content is ASF format or not. |
|
86 */ |
|
87 void ValidateL(); |
|
88 |
|
89 void InitializeL(); |
|
90 |
|
91 /** |
|
92 * FormatGUID(TDes8 &aGUID); |
|
93 * Formats Global UID |
|
94 * @return void |
|
95 */ |
|
96 void FormatGUID( TDes8 &aGUID ); |
|
97 |
|
98 /** |
|
99 * Parses all entries in Content Description Object |
|
100 * @return void |
|
101 */ |
|
102 void ParseContentDescriptionObjectL(); |
|
103 |
|
104 /** |
|
105 * Parses all entries in Content Encryption Object |
|
106 * @return void |
|
107 */ |
|
108 void ParseContentEncryptionObjectL(); |
|
109 |
|
110 /** |
|
111 * Parses all entries in Extended Content Description Object |
|
112 * @return void |
|
113 */ |
|
114 void ParseExtendedContentDescriptionObjectL(); |
|
115 |
|
116 /** |
|
117 * read Extended Content Description Object |
|
118 * @return void |
|
119 */ |
|
120 HBufC16* ReadExtendedContentObjectL( TInt aOffset ); |
|
121 |
|
122 public: // Data |
|
123 |
|
124 // File to be used for reading |
|
125 RFs iFs; |
|
126 RFile iFile; |
|
127 |
|
128 // Size of the ASF itself |
|
129 TInt iLength; |
|
130 |
|
131 // metadata from Content Description Object |
|
132 // All metadata is UTF-16 format. |
|
133 HBufC* iTitle; |
|
134 HBufC* iAuthor; |
|
135 HBufC* iCopyright; |
|
136 HBufC* iDescription; |
|
137 HBufC* iRating; |
|
138 |
|
139 // metadata from Extended Content Description Object |
|
140 HBufC* iAlbumTitle; |
|
141 HBufC* iPicture; |
|
142 HBufC* iText; |
|
143 HBufC* iComposer; |
|
144 HBufC* iGenre; |
|
145 HBufC* iOriginalArtist; |
|
146 HBufC* iTrackNumber; |
|
147 HBufC* iUniqueFileID; |
|
148 HBufC* iAudioFileUrl; |
|
149 HBufC* iSharedUserRating; |
|
150 HBufC* iDate; |
|
151 HBufC* iYear; |
|
152 |
|
153 // DRM protected content |
|
154 TBool iIsDrmProtected; |
|
155 |
|
156 // ASF validated content |
|
157 TBool iIsValidated; |
|
158 |
|
159 // Header data |
|
160 HBufC8* iHeaderData; |
|
161 |
|
162 // Data from ContentEncryption Object |
|
163 HBufC8* iSecretData; |
|
164 HBufC8* iProtectionType; |
|
165 HBufC8* iKeyId; |
|
166 HBufC8* iLicenseUrl; |
|
167 |
|
168 // Data from ExtendedContentEncryption Object |
|
169 HBufC8* iExtendedContentEncryptionObject; |
|
170 |
|
171 // Data from DigitalSignature Object |
|
172 HBufC8* iDigitalSignatureObject; |
|
173 HBufC8* iSignedData; |
|
174 |
|
175 // Character Set Id used during Unicode conversion |
|
176 |
|
177 // mainly for future use: Nbr of all Objects found from Hdr |
|
178 TInt iNbrOfObjects; |
|
179 TInt iContentDescriptionOffset; |
|
180 TInt iFilePropertiesOffset; |
|
181 TInt iExtendedContentDescriptionOffset; |
|
182 TInt iContentEncryptionOffset; |
|
183 TInt iExtendedContentEncryptionOffset; |
|
184 TInt iDigitalSignatureOffset; |
|
185 |
|
186 TInt iExtendedContentDescriptionCount; |
|
187 TInt iHeaderSize; |
|
188 TInt iTitleLength; |
|
189 TInt iAuthorLength; |
|
190 TInt iCopyrightLength; |
|
191 TInt iDescriptionLength; |
|
192 TInt iRatingLength; |
|
193 |
|
194 // Details from Content Encryption Object |
|
195 TInt iSecretDataLength; |
|
196 TInt iProtectionTypeLength; |
|
197 TInt iKeyIDLength; |
|
198 TInt iLicenceUrlLength; |
|
199 |
|
200 TBool iContentDescriptionObjectExists; |
|
201 TBool iFilePropertiesObjectExists; |
|
202 TBool iExtendedContentDescriptionObjectExists; |
|
203 TBool iExtendedContentEncryptionObjectExists; |
|
204 TBool iContentEncryptionObjectExists; |
|
205 TBool iDigitalSignatureObjectExists; |
|
206 |
|
207 TPtrC iMimeType; |
|
208 |
|
209 // End offset of file properties object |
|
210 // Used to decide start point of signed data |
|
211 TInt iFilePropertiesEndOffset; |
|
212 |
|
213 // Reserved pointer for future extension |
|
214 //TAny* iReserved; |
|
215 |
|
216 public: // Friend classes |
|
217 //?friend_class_declaration; |
|
218 protected: // Friend classes |
|
219 //?friend_class_declaration; |
|
220 private: // Friend classes |
|
221 //?friend_class_declaration; |
|
222 |
|
223 }; |
|
224 |
|
225 #endif // ASF_H |
|
226 |
|
227 // End of File |