contentmgmt/referencedrmagent/TestAgent/TestAgentDrmContent.h
changeset 15 da2ae96f639b
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
       
     1 /*
       
     2 * Copyright (c) 2006-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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __TESTAGENTDRMFILE_H__
       
    20 #define __TESTAGENTDRMFILE_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include "TestAgentFileInterface.h"
       
    25 
       
    26 class CTestAgentDrmContent : public CTestAgentFileInterface
       
    27 		{
       
    28 	public:
       
    29 		static CTestAgentDrmContent* NewL(RFile& aFile);
       
    30 
       
    31 		CTestAgentDrmContent(RFile& aFile);
       
    32 		virtual ~CTestAgentDrmContent();
       
    33 
       
    34 		virtual TInt Read(TDes8& aDes,TInt aLength);
       
    35 		virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
       
    36 		virtual void ReadCancel(TRequestStatus& aStatus);
       
    37 		virtual TInt Seek(TSeek aMode,TInt& aPos);
       
    38 		virtual TPtrC8 ContentMimeType();
       
    39 		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue);
       
    40 		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue);
       
    41 		virtual void DataSizeL(TInt &aSize);
       
    42 		virtual void Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);	
       
    43 	private:
       
    44 		void ConstructL();
       
    45 		TInt ReadTUintvarL(TDes8& aBuffer, TInt Offset, TInt& aNumBytes) const;
       
    46 
       
    47 	private:
       
    48 		RFile& iFile;
       
    49 
       
    50 		/* OMA DRM Specific */
       
    51 		TInt iHeaderLength;
       
    52 		TInt iHeaderOffset;
       
    53 		TInt iDataSize;
       
    54 		TInt iDataOffset;
       
    55 
       
    56 		HBufC8 *iContentMimeType;
       
    57 		};
       
    58 
       
    59 #endif