sl@0: /* sl@0: * Copyright (c) 2007-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: @file sl@0: @test sl@0: */ sl@0: sl@0: #if (!defined __UPS_TEST_SERVER_H__) sl@0: #define __UPS_TEST_SERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "tupstesteractive.h" sl@0: #include "tups_clientapi_sysserver.h" sl@0: sl@0: sl@0: class CUPSTestServer : public CServer2 sl@0: { sl@0: public: sl@0: static CUPSTestServer* NewL(const TDesC& serverName); sl@0: sl@0: IMPORT_C virtual ~CUPSTestServer(); sl@0: IMPORT_C CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const; sl@0: IMPORT_C virtual void ConstructL(const TDesC& aName); sl@0: void SessionClosed(); sl@0: inline const TDesC& Name() const {return iServerName;}; sl@0: protected: sl@0: IMPORT_C CUPSTestServer(); sl@0: inline void IncSessionCount() {++iSessionCount;}; sl@0: protected: sl@0: public: sl@0: TInt iSessionCount; sl@0: TBuf iServerName; sl@0: sl@0: public: sl@0: UserPromptService::RUpsSession iUpsSession; sl@0: sl@0: sl@0: }; sl@0: sl@0: class CUPSTestSession : public CSession2 sl@0: sl@0: { sl@0: public: sl@0: sl@0: static CUPSTestSession* NewL(const CUPSTestServer *aServer, const RMessage2& aMessage); sl@0: virtual void ServiceL(const RMessage2& aMessage); sl@0: sl@0: void CTUPSTesterActiveComplete(CTUPSTesterActive *aTester); sl@0: private: sl@0: void ConstructL(CUPSTestServer *aServer, const RMessage2& aMessage); sl@0: sl@0: IMPORT_C CUPSTestSession(); sl@0: IMPORT_C virtual ~CUPSTestSession(); sl@0: sl@0: void makeRequestToUPsL(const RMessage2& aMessage); sl@0: sl@0: CTUPSTesterActive *iUpsTestActiveObj; sl@0: sl@0: public: sl@0: UserPromptService::RUpsSubsession iUpsSubsession; sl@0: TUpsTestServiceRequestData iRequestData; sl@0: sl@0: }; sl@0: sl@0: #endif