1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/referencedrmagent/tcaf/source/cafstep.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,116 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +#if (!defined __CAF_STEP_H__)
1.25 +#define __CAF_STEP_H__
1.26 +#include <test/testexecutestepbase.h>
1.27 +
1.28 +class CCAFServer;
1.29 +class CApaDataRecognizerType;
1.30 +
1.31 +
1.32 +//Base class used to provide utility functions availble to test step classes
1.33 +class CCAFStep : public CTestStep
1.34 + {
1.35 +public:
1.36 + CCAFStep();
1.37 + virtual ~CCAFStep();
1.38 +
1.39 + /*
1.40 + * Convert a 16-bit descriptor to an 8-bit descriptor
1.41 + * A new HBufC8 is allocated to store the new version of the descriptor
1.42 + * @param source a descriptor derived from TDesC16
1.43 + * @return a new HBufC8 with a copy of the data in source
1.44 + */
1.45 + HBufC8* ConvertDes16toHBufC8LC(TDesC& source);
1.46 +
1.47 + /*
1.48 + * Convert a 8-bit descriptor to an 16-bit descriptor
1.49 + * A new HBufC16 is allocated to store the new version of the descriptor
1.50 + * @param source a descriptor derived from TDesC8
1.51 + * @return a new HBufC16 with a copy of the data in source
1.52 + */
1.53 + HBufC16* ConvertDes8toHBufC16LC(TDesC8& source);
1.54 +
1.55 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.56 +
1.57 + /*
1.58 + * Utility method which creates dummy header data for WMDRM operations.
1.59 + * @return A new HBufC8 allocated which contains the header data.
1.60 + */
1.61 + HBufC8* CreateWmdrmHeaderLC();
1.62 +
1.63 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.64 +
1.65 + /*
1.66 + * Load CAFRECOGNIZER.MDL and create an instance of CApaCafRecognizer that can be used
1.67 + * by derived classes
1.68 + */
1.69 + void LoadCafRecognizerL();
1.70 +
1.71 + /*
1.72 + * Delete the instance of CApaCafRecognizer and unload the CAFRECOGNIZER.MDL library
1.73 + */
1.74 + void UnLoadCafRecognizer();
1.75 +
1.76 + /*
1.77 + * Implementation of CTestStep virtual functions, create and install a CActiveScheduler
1.78 + */
1.79 + virtual TVerdict doTestStepPreambleL();
1.80 +
1.81 + /*
1.82 + * Implementation of CTestStep virtual functions, uninstalls and removes the CActiveScheduler
1.83 + */
1.84 + virtual TVerdict doTestStepPostambleL();
1.85 +
1.86 + /* delete a file */
1.87 + TInt Delete(const TDesC& aFile);
1.88 +
1.89 +protected:
1.90 + /*
1.91 + * Open the file and read data into the buffer up until the length of the buffer
1.92 + * aBuffer.Length() will be set to the length of data read
1.93 + * @param aFileName the file to read from
1.94 + * @param aBuffer the buffer to read into
1.95 + */
1.96 + void ReadBufferL(TDesC16& aFileName, TDes8& aBuffer);
1.97 +
1.98 + /* Starts the Apparc server (for use by CSupplier tests)
1.99 + */
1.100 + void StartApparcServerL();
1.101 +
1.102 + CApaDataRecognizerType *iRecognizer;
1.103 +
1.104 + /** Is called to initialise the following parameters
1.105 + */
1.106 + void InitialiseFileHandleParametersL();
1.107 +
1.108 + RFs iFs;
1.109 + RFile iFile;
1.110 + TPtrC iUri;
1.111 + TPtrC iUniqueId;
1.112 + TInt iExpectedResult;
1.113 +
1.114 +private:
1.115 + CActiveScheduler *iActiveScheduler;
1.116 + TUid iDtorIDKey;
1.117 + };
1.118 +
1.119 +#endif