|
1 /* |
|
2 * Copyright (c) 2004-2009 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: |
|
15 * reftestagentarchive.h |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalAll |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef __REFTESTAGENTARCHIVE_H__ |
|
27 #define __REFTESTAGENTARCHIVE_H__ |
|
28 |
|
29 #include <f32file.h> |
|
30 |
|
31 namespace ReferenceTestAgent |
|
32 { |
|
33 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
34 _LIT8(KRTAArchiveHeader, "$_SYMRTA_$"); |
|
35 const TUint KRTAArchiveHeaderSize = 10; |
|
36 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
37 |
|
38 class CDrmFiles; |
|
39 class CDrmFilesParser; |
|
40 class CPartOfFile; |
|
41 class CVirtualFile; |
|
42 class CRefTestAgentArchive : public CBase |
|
43 { |
|
44 public: |
|
45 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
46 IMPORT_C static CRefTestAgentArchive* NewL(RFile64& aFile); |
|
47 #else |
|
48 IMPORT_C static CRefTestAgentArchive* NewL(RFile& aFile); |
|
49 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
50 virtual ~CRefTestAgentArchive(); |
|
51 |
|
52 // obtain the mime type of the content in the file |
|
53 IMPORT_C const TDesC8& DefaultMimeType(); |
|
54 |
|
55 // return the drm file object used for reading |
|
56 IMPORT_C CDrmFiles& DrmFilesL(); |
|
57 |
|
58 IMPORT_C static TInt CreateArchive(const TDesC& aContentXmlFileName, const TDesC& aRightsXmlFileName, TDes& aOutputFileName, TDes8& aOutputMimeType); |
|
59 IMPORT_C static void GetDefaultMimeTypeFromHeaderL(const TDesC8& aBuffer, TDes8& aDefaultMimeType); |
|
60 |
|
61 private: |
|
62 CRefTestAgentArchive(); |
|
63 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
64 void ConstructL(RFile64& aFile); |
|
65 #else |
|
66 void ConstructL(RFile& aFile); |
|
67 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
68 |
|
69 static void DoCreateArchiveL(const TDesC& aContentXmlFileName, const TDesC& aRightsXmlFileName, const TDesC& aOutputFileName); |
|
70 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
71 static void WriteHeaderL(CVirtualFile& aVirtualFile, const TInt64& aRightsOffset, const TInt64& aContentOffset); |
|
72 #else |
|
73 static void WriteHeaderL(CVirtualFile& aVirtualFile, TInt aRightsOffset, TInt aContentOffset); |
|
74 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
75 |
|
76 |
|
77 private: |
|
78 CDrmFilesParser* iDrmFilesParser; |
|
79 CPartOfFile* iPartOfFile; |
|
80 CPartOfFile* iContentXmlFile; |
|
81 HBufC8* iMimeType; |
|
82 RSemaphore iFileLock; |
|
83 |
|
84 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
85 TInt64 iDrmFileOffset; |
|
86 TInt64 iDrmRightsOffset; |
|
87 TInt64 iContentOffset; |
|
88 TInt64 iFileSize; |
|
89 TBool iIs64BitSize; |
|
90 #else |
|
91 TInt iDrmFileOffset; |
|
92 TInt iDrmRightsOffset; |
|
93 TInt iContentOffset; |
|
94 TInt iFileSize; |
|
95 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
96 }; |
|
97 } |
|
98 |
|
99 #endif |
|
100 |