sl@0: // Copyright (c) 1997-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 "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: // The definition of the accessor class for the CResolver tests.
sl@0: // 
sl@0: //
sl@0: 
sl@0: #ifndef __RESOLVERSTATEACCESSOR_H__
sl@0: #define __RESOLVERSTATEACCESSOR_H__
sl@0: 
sl@0: #include <s32file.h>
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : State accessor for the CDefaultResolver object under test.
sl@0:  */
sl@0: class TDefaultResolver_StateAccessor : public MStateAccessor
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				InvariantTest(TAny* aTestObject)
sl@0: 		Intended Usage	: Checks if CDefaultResolver has violated its invariants.	
sl@0: 		@since			7.0
sl@0: 		@param			TAny* A pointer to the object under test.
sl@0: 		@return			TInt KErrNone if the invariants were valid, error code otherwise.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed.
sl@0: 		@post			The class under test is set to the state specified.
sl@0: 	 */
sl@0: 	inline TInt InvariantTest(TAny* aTestObject);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Internalize(TAny* aTestObject)
sl@0: 		Intended Usage	: Implemented by the developer to set the state of the object under test.
sl@0: 		@since			7.0
sl@0: 		@param			aTestObject The object to be tested
sl@0: 		@return			KErrNone if the internalize was successful.
sl@0: 		@return			One of the EPOC standard error codes indicating the reason
sl@0: 						for the failure	to load the object state.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed, and
sl@0: 						valid test object must be passed in.
sl@0: 		@post			The class under test is set to the state specified
sl@0: 	 */
sl@0: 	inline virtual TInt Internalize(TAny* aTestObject);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Externalize(TAny* aTestObject)
sl@0: 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
sl@0: 		@since			7.0
sl@0: 		@param			aTestObject The object to be tested
sl@0: 		@return			KErrNone if the internalize was successful.
sl@0: 		@return			One of the EPOC standard error codes indicating the reason
sl@0: 						for the failure	to externalize the object.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed, and
sl@0: 						valid test object must be passed in.
sl@0: 		@post			Returns an error code dependant on the result of the test
sl@0: 	 */
sl@0: 	inline virtual TInt Externalize(TAny* aTestObject);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				InternalizeL(RFileReadStream& aStream, CDefaultResolver* aDefaultResolver)
sl@0: 		Intended Usage	: Implemented by the developer to set the state of the object under test.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@since			7.0
sl@0: 		@param			aStream The filestream to read from .
sl@0: 		@param			aDefaultResolver A pointer to the CDefaultResolver object under test.
sl@0: 		@return			None.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed.
sl@0: 		@post			The class under test is set to the state specified.
sl@0: 	 */
sl@0: 		inline void InternalizeL(RFileReadStream& aStream, CDefaultResolver* aDefaultResolver);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				ExternalizeL(RFileWriteStream& aStream, CDefaultResolver* aDefaultResolver)
sl@0: 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@since			7.0
sl@0: 		@param			aStream The filestream to persist into.
sl@0: 		@param			aDefaultResolver A pointer to the CDefaultResolver object under test.
sl@0: 		@return			None.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed.
sl@0: 		@post			No change to the class under test, its internal state.
sl@0: 						is persisted.
sl@0: 	*/
sl@0: 	inline void ExternalizeL(RFileWriteStream& aStream, CDefaultResolver* aDefaultResolver);
sl@0: 
sl@0: /**
sl@0: 	@fn				TBool CDefaultResolver::Match(const TDesC8& aImplementationType, 
sl@0: 												  const TDesC8& aMatchType, 
sl@0: 												  TBool aUseWildcards) const
sl@0: 	Intended Usage	:	
sl@0: 	Error Condition	:	
sl@0: 	@since			7.0
sl@0: 	@param			aImplementationType " "
sl@0: 	@param			aMatchType " "
sl@0: 	@param			aUseWildcards " "
sl@0: 	@return			TBool ETrue if a match has been found
sl@0: 	@pre 			The object is fully constructed
sl@0:  */
sl@0: 	TBool Match(CDefaultResolver& aResolver,
sl@0: 				const TDesC8& aImplementationType, 
sl@0: 				const TDesC8& aMatchType, 
sl@0: 				TBool aUseWildcards) const;
sl@0: 
sl@0: /**
sl@0: 	@fn				Resolve(CDefaultResolver& aResolver,
sl@0: 							RImplInfoArray& aImplementationData, 
sl@0: 							const TEComResolverParams& aAdditionalParameters) const
sl@0: 	Intended Usage	:	
sl@0: 	Error Condition	:	
sl@0: 	@since			7.0
sl@0: 	@param			aResolver " "
sl@0: 	@param			aImplementationData " "
sl@0: 	@param			aAdditionalParameters " "
sl@0: 	@return			The Uid of a suitable implementation
sl@0: 	@pre 			The object is fully constructed
sl@0:  */
sl@0: 	TUid Resolve(CDefaultResolver& aResolver,
sl@0: 				 RImplInfoArray& aImplementationData, 
sl@0: 				 const TEComResolverParams& aAdditionalParameters) const;
sl@0: 
sl@0: private:
sl@0: 	/**
sl@0: 		@fn				InternalizeL(CDefaultResolver* aDefaultResolver)
sl@0: 		Intended Usage	: Implemented by the developer to set the state of the object under test.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@since			7.0
sl@0: 		@param			TAny* A pointer to the object under test.
sl@0: 		@return			None.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed.
sl@0: 		@post			The class under test is set to the state specified.
sl@0: 	*/
sl@0: 	inline void InternalizeL(CDefaultResolver* aDefaultResolver);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				ExternalizeL(CDefaultResolver* aDefaultResolver)
sl@0: 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@since			7.0
sl@0: 		@param			TAny* A pointer to the object under test.
sl@0: 		@return			None.
sl@0: 		@pre 			TDefaultResolver_StateAccessor is fully constructed.
sl@0: 		@post			No change to the class under test, its internal state.
sl@0: 						is persisted.
sl@0: 	*/
sl@0: 	inline void ExternalizeL(CDefaultResolver* aDefaultResolver);
sl@0: 	};	// TDefaultResolver_StateAccessor
sl@0: 
sl@0: #include "ResolverStateAccessor.inl"
sl@0: 
sl@0: #endif		// __RESOLVERSTATEACCESSOR_H__