syslibsapitest/syslibssvs/ecom/inc/T_EComSessionData.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2005-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 "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 #if (!defined __T_ECOM_SESSION_API_DATA_H__)
       
    21 #define __T_ECOM_SESSION_API_DATA_H__
       
    22 
       
    23 //	User Includes
       
    24 #include "DataWrapperBase.h"
       
    25 
       
    26 // Classes to get to protected members
       
    27 
       
    28 //	EPOC includes
       
    29 #include <w32std.h>
       
    30 #include <e32std.h>
       
    31 #include <ecom/ecom.h>
       
    32 
       
    33 class CT_EComSessionData: public CDataWrapperBase
       
    34 	{
       
    35 private:
       
    36 	struct TTestInterfaceInitParams
       
    37 		{
       
    38 		TInt			iInteger;
       
    39 		const TDesC*	iDescriptor;
       
    40 		};
       
    41 
       
    42 public:
       
    43 	static CT_EComSessionData*	NewL();
       
    44 
       
    45 	~CT_EComSessionData();
       
    46 
       
    47 	virtual TAny*	GetObject();
       
    48 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
       
    49 
       
    50 	//	MTPActiveCallback implementation
       
    51 	virtual void	RunL(CActive* aActive, const TInt aIndex);
       
    52 
       
    53 protected:
       
    54 	CT_EComSessionData();
       
    55 	void	ConstructL();
       
    56 
       
    57 private:
       
    58 	inline void	DoCmdOpenL();
       
    59 	inline void	DoCmdClose();
       
    60 	inline void	DoCmdFinalClose();
       
    61 	inline void	DoCmdNotifyOnChange(const TInt aIndex);
       
    62 	inline void	DoCmdCancelNotifyOnChange();
       
    63 	inline void	DoCmdListImplementationsL(const TDesC& aSection);
       
    64 	inline void	DoCmdCreateImplementationL(const TDesC& aSection);
       
    65 	inline void	DoCmdDestroyedImplementation(const TDesC& aSection);
       
    66 
       
    67 	inline void	RunNotifyOnChangeL(const TInt aIndex);
       
    68 
       
    69 	//	Helper methods
       
    70 	void	DestroyData();
       
    71 	
       
    72 	void	GetUid(const TDesC& aSection, TUid& aUid);
       
    73 	TBool	GetResolver(const TDesC& aSection, TPtrC& aResolver);
       
    74 	TBool	GetResolverUid(const TDesC& aSection, TUid& aUid);
       
    75 	TBool	GetExpectedResult(const TDesC& aSection, TInt& aExpectedResult);
       
    76 	TBool	GetOffset(const TDesC& aSection, TInt& aOffset);
       
    77 	TBool	GetDescriptor(const TDesC& aSection, TPtrC& aDescriptor);
       
    78 	TBool	GetInteger(const TDesC& aSection, TInt& aInt);
       
    79 	TBool	GetEmpty(const TDesC& aSection, TBool& aEmpty);
       
    80 
       
    81 private:
       
    82     REComSession            			iSession;
       
    83     TUid								iDTorKey;
       
    84 	CActiveCallback*					iActiveNotifyOnChange;
       
    85 	TTestInterfaceInitParams			iInitParams;
       
    86 	TBuf<KMaxTestExecuteCommandLength>	iInterfaceDesc;
       
    87 	RImplInfoPtrArray					iInfoArray;
       
    88 
       
    89 	//Initially iImplementationInterface==NULL. Object can be created by DoCmdCreateImplementationL.
       
    90     TAny*								iImplementationInterface;
       
    91 	};
       
    92 #endif /* __T_ECOM_SESSION_API_DATA_H__ */