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