os/ossrv/syslibsapitest/syslibssvs/ecom/inc/T_EComSessionData.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/syslibsapitest/syslibssvs/ecom/inc/T_EComSessionData.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,92 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-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 "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 +#if (!defined __T_ECOM_SESSION_API_DATA_H__)
    1.24 +#define __T_ECOM_SESSION_API_DATA_H__
    1.25 +
    1.26 +//	User Includes
    1.27 +#include "DataWrapperBase.h"
    1.28 +
    1.29 +// Classes to get to protected members
    1.30 +
    1.31 +//	EPOC includes
    1.32 +#include <w32std.h>
    1.33 +#include <e32std.h>
    1.34 +#include <ecom/ecom.h>
    1.35 +
    1.36 +class CT_EComSessionData: public CDataWrapperBase
    1.37 +	{
    1.38 +private:
    1.39 +	struct TTestInterfaceInitParams
    1.40 +		{
    1.41 +		TInt			iInteger;
    1.42 +		const TDesC*	iDescriptor;
    1.43 +		};
    1.44 +
    1.45 +public:
    1.46 +	static CT_EComSessionData*	NewL();
    1.47 +
    1.48 +	~CT_EComSessionData();
    1.49 +
    1.50 +	virtual TAny*	GetObject();
    1.51 +	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    1.52 +
    1.53 +	//	MTPActiveCallback implementation
    1.54 +	virtual void	RunL(CActive* aActive, const TInt aIndex);
    1.55 +
    1.56 +protected:
    1.57 +	CT_EComSessionData();
    1.58 +	void	ConstructL();
    1.59 +
    1.60 +private:
    1.61 +	inline void	DoCmdOpenL();
    1.62 +	inline void	DoCmdClose();
    1.63 +	inline void	DoCmdFinalClose();
    1.64 +	inline void	DoCmdNotifyOnChange(const TInt aIndex);
    1.65 +	inline void	DoCmdCancelNotifyOnChange();
    1.66 +	inline void	DoCmdListImplementationsL(const TDesC& aSection);
    1.67 +	inline void	DoCmdCreateImplementationL(const TDesC& aSection);
    1.68 +	inline void	DoCmdDestroyedImplementation(const TDesC& aSection);
    1.69 +
    1.70 +	inline void	RunNotifyOnChangeL(const TInt aIndex);
    1.71 +
    1.72 +	//	Helper methods
    1.73 +	void	DestroyData();
    1.74 +	
    1.75 +	void	GetUid(const TDesC& aSection, TUid& aUid);
    1.76 +	TBool	GetResolver(const TDesC& aSection, TPtrC& aResolver);
    1.77 +	TBool	GetResolverUid(const TDesC& aSection, TUid& aUid);
    1.78 +	TBool	GetExpectedResult(const TDesC& aSection, TInt& aExpectedResult);
    1.79 +	TBool	GetOffset(const TDesC& aSection, TInt& aOffset);
    1.80 +	TBool	GetDescriptor(const TDesC& aSection, TPtrC& aDescriptor);
    1.81 +	TBool	GetInteger(const TDesC& aSection, TInt& aInt);
    1.82 +	TBool	GetEmpty(const TDesC& aSection, TBool& aEmpty);
    1.83 +
    1.84 +private:
    1.85 +    REComSession            			iSession;
    1.86 +    TUid								iDTorKey;
    1.87 +	CActiveCallback*					iActiveNotifyOnChange;
    1.88 +	TTestInterfaceInitParams			iInitParams;
    1.89 +	TBuf<KMaxTestExecuteCommandLength>	iInterfaceDesc;
    1.90 +	RImplInfoPtrArray					iInfoArray;
    1.91 +
    1.92 +	//Initially iImplementationInterface==NULL. Object can be created by DoCmdCreateImplementationL.
    1.93 +    TAny*								iImplementationInterface;
    1.94 +	};
    1.95 +#endif /* __T_ECOM_SESSION_API_DATA_H__ */