sl@0: /* sl@0: * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #if (!defined __CAF_STEP_H__) sl@0: #define __CAF_STEP_H__ sl@0: #include sl@0: sl@0: class CCAFServer; sl@0: class CApaDataRecognizerType; sl@0: sl@0: sl@0: //Base class used to provide utility functions availble to test step classes sl@0: class CCAFStep : public CTestStep sl@0: { sl@0: public: sl@0: CCAFStep(); sl@0: virtual ~CCAFStep(); sl@0: sl@0: /* sl@0: * Convert a 16-bit descriptor to an 8-bit descriptor sl@0: * A new HBufC8 is allocated to store the new version of the descriptor sl@0: * @param source a descriptor derived from TDesC16 sl@0: * @return a new HBufC8 with a copy of the data in source sl@0: */ sl@0: HBufC8* ConvertDes16toHBufC8LC(TDesC& source); sl@0: sl@0: /* sl@0: * Convert a 8-bit descriptor to an 16-bit descriptor sl@0: * A new HBufC16 is allocated to store the new version of the descriptor sl@0: * @param source a descriptor derived from TDesC8 sl@0: * @return a new HBufC16 with a copy of the data in source sl@0: */ sl@0: HBufC16* ConvertDes8toHBufC16LC(TDesC8& source); sl@0: sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: sl@0: /* sl@0: * Utility method which creates dummy header data for WMDRM operations. sl@0: * @return A new HBufC8 allocated which contains the header data. sl@0: */ sl@0: HBufC8* CreateWmdrmHeaderLC(); sl@0: sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: sl@0: /* sl@0: * Load CAFRECOGNIZER.MDL and create an instance of CApaCafRecognizer that can be used sl@0: * by derived classes sl@0: */ sl@0: void LoadCafRecognizerL(); sl@0: sl@0: /* sl@0: * Delete the instance of CApaCafRecognizer and unload the CAFRECOGNIZER.MDL library sl@0: */ sl@0: void UnLoadCafRecognizer(); sl@0: sl@0: /* sl@0: * Implementation of CTestStep virtual functions, create and install a CActiveScheduler sl@0: */ sl@0: virtual TVerdict doTestStepPreambleL(); sl@0: sl@0: /* sl@0: * Implementation of CTestStep virtual functions, uninstalls and removes the CActiveScheduler sl@0: */ sl@0: virtual TVerdict doTestStepPostambleL(); sl@0: sl@0: /* delete a file */ sl@0: TInt Delete(const TDesC& aFile); sl@0: sl@0: protected: sl@0: /* sl@0: * Open the file and read data into the buffer up until the length of the buffer sl@0: * aBuffer.Length() will be set to the length of data read sl@0: * @param aFileName the file to read from sl@0: * @param aBuffer the buffer to read into sl@0: */ sl@0: void ReadBufferL(TDesC16& aFileName, TDes8& aBuffer); sl@0: sl@0: /* Starts the Apparc server (for use by CSupplier tests) sl@0: */ sl@0: void StartApparcServerL(); sl@0: sl@0: CApaDataRecognizerType *iRecognizer; sl@0: sl@0: /** Is called to initialise the following parameters sl@0: */ sl@0: void InitialiseFileHandleParametersL(); sl@0: sl@0: RFs iFs; sl@0: RFile iFile; sl@0: TPtrC iUri; sl@0: TPtrC iUniqueId; sl@0: TInt iExpectedResult; sl@0: sl@0: private: sl@0: CActiveScheduler *iActiveScheduler; sl@0: TUid iDtorIDKey; sl@0: }; sl@0: sl@0: #endif