contentmgmt/referencedrmagent/tcaf/source/cafstep.h
changeset 15 da2ae96f639b
child 53 030c4fbc13d7
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
       
     1 /*
       
     2 * Copyright (c) 2002-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 
       
    20 
       
    21 #if (!defined __CAF_STEP_H__)
       
    22 #define __CAF_STEP_H__
       
    23 #include <test/testexecutestepbase.h>
       
    24 
       
    25 class CCAFServer;
       
    26 class CApaDataRecognizerType;
       
    27 
       
    28 
       
    29 //Base class used to provide utility functions availble to test step classes
       
    30 class CCAFStep : public CTestStep
       
    31 	{
       
    32 public:
       
    33 	CCAFStep();
       
    34 	virtual ~CCAFStep();
       
    35 
       
    36 	/* 
       
    37 	* Convert a 16-bit descriptor to an 8-bit descriptor
       
    38 	* A new HBufC8 is allocated to store the new version of the descriptor
       
    39 	* @param source a descriptor derived from TDesC16 
       
    40 	* @return a new HBufC8 with a copy of the data in source
       
    41 	*/
       
    42 	HBufC8* ConvertDes16toHBufC8LC(TDesC& source);
       
    43 
       
    44 	/* 
       
    45 	* Convert a 8-bit descriptor to an 16-bit descriptor
       
    46 	* A new HBufC16 is allocated to store the new version of the descriptor
       
    47 	* @param source a descriptor derived from TDesC8 
       
    48 	* @return a new HBufC16 with a copy of the data in source
       
    49 	*/
       
    50 	HBufC16* ConvertDes8toHBufC16LC(TDesC8& source);
       
    51 
       
    52 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
    53       
       
    54     /*     
       
    55     * Utility method which creates dummy header data for WMDRM operations.     
       
    56     * @return   A new HBufC8 allocated which contains the header data.     
       
    57     */     
       
    58     HBufC8* CreateWmdrmHeaderLC();     
       
    59       
       
    60 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
       
    61 
       
    62 	/* 
       
    63 	* Load CAFRECOGNIZER.MDL and create an instance of CApaCafRecognizer that can be used
       
    64 	* by derived classes
       
    65 	*/
       
    66 	void LoadCafRecognizerL();
       
    67 
       
    68 	/* 
       
    69 	* Delete the instance of CApaCafRecognizer and unload the CAFRECOGNIZER.MDL library 
       
    70 	*/
       
    71 	void UnLoadCafRecognizer();
       
    72 
       
    73 	/* 
       
    74 	* Implementation of CTestStep virtual functions, create and install a CActiveScheduler
       
    75 	*/
       
    76 	virtual TVerdict doTestStepPreambleL();
       
    77 
       
    78 	/* 
       
    79 	* Implementation of CTestStep virtual functions, uninstalls and removes the CActiveScheduler
       
    80 	*/
       
    81 	virtual TVerdict doTestStepPostambleL();
       
    82 
       
    83 	/* delete a file */
       
    84 	TInt Delete(const TDesC& aFile);
       
    85 
       
    86 protected:
       
    87 	/* 
       
    88 	* Open the file and read data into the buffer up until the length of the buffer
       
    89 	* aBuffer.Length() will be set to the length of data read
       
    90 	* @param aFileName the file to read from
       
    91 	* @param aBuffer the buffer to read into
       
    92 	*/
       
    93 	void ReadBufferL(TDesC16& aFileName, TDes8& aBuffer);
       
    94 
       
    95 	/* Starts the Apparc server (for use by CSupplier tests)
       
    96 	*/
       
    97 	void StartApparcServerL();
       
    98 
       
    99 	CApaDataRecognizerType *iRecognizer;
       
   100 	
       
   101 	/** Is called to initialise the following parameters
       
   102 	 */ 
       
   103 	void  InitialiseFileHandleParametersL();
       
   104 	
       
   105 	RFs		iFs;
       
   106 	RFile	iFile;
       
   107 	TPtrC	iUri;
       
   108 	TPtrC	iUniqueId;
       
   109 	TInt	iExpectedResult;
       
   110 	
       
   111 private:
       
   112 	CActiveScheduler *iActiveScheduler;
       
   113 	TUid iDtorIDKey;
       
   114 	};
       
   115 
       
   116 #endif