os/security/authorisation/userpromptservice/test/include/tups_clientapi_sysserver.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-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 the License "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  @file    
    21  @test
    22 */
    23 
    24 #if !(defined UPS_TEST_CLIENT_H)
    25 #define UPS_TEST_CLIENT_H
    26 
    27 #include <e32base.h>
    28 #include <test/tefexportconst.h>
    29 #include <ups/upsclient.h>
    30 
    31 enum {
    32 	EUpsTest_ConnectServer, 
    33 	EUpsTest_UseTestService,    // Simulates the use of a service provided by the test system server.
    34 	EUpsTest_OpenSession,       // Opens subsession to test system server. 
    35 	EUpsTest_CloseSession, 		// Closes subsession to test system server. 
    36 	EUpsTest_GetServerSid,  	// returns sid of server. 
    37 	};
    38 
    39 class TUpsTestServiceRequestData
    40 	{
    41 	public:
    42 	inline	TUpsTestServiceRequestData();
    43 	TBool 		iOpaquePresent;
    44 	TBuf8<50> 	iOpaqueData;
    45 	TBool 		iMeasureResponceTime;
    46 	TUid  		iServiceUid;
    47 	TBuf<60>	iDestination;
    48 	TBool 		iCancelRequest;
    49 	TBool 		iPlatSecPass;
    50 	};
    51 
    52 inline TUpsTestServiceRequestData::TUpsTestServiceRequestData():
    53 iOpaquePresent(0),iOpaqueData(0),iMeasureResponceTime(0),iServiceUid(TUid::Uid(0)),iDestination(0),iCancelRequest(0),iPlatSecPass(0) 
    54 	{
    55 	}
    56 	
    57 
    58 
    59 class TUpsTestServiceReturn
    60 	{
    61 	public:
    62 	inline		TUpsTestServiceReturn();
    63 	TUpsDecision  	iDecision;
    64 	TInt			iError;
    65 	TBuf<50> 		iErrorMessage;
    66 	TUint32			iRequestDuration;
    67  	};
    68 
    69 inline TUpsTestServiceReturn::TUpsTestServiceReturn():
    70 iDecision(TUpsDecision(EUpsDecNo)),iError(0),iErrorMessage(0)  
    71 	{
    72 	}
    73 
    74 class RUpsTestServ : public RSessionBase
    75  
    76  	{
    77 public:
    78 	IMPORT_C TInt Connect(const TDesC& aServerName, TBool aDebugMode = EFalse);
    79 	IMPORT_C const TDesC& ServerName() const;
    80 protected:
    81 private:
    82 	RLibrary iLibrary;
    83 	TBuf<KMaxTestExecuteNameLength> iServerName;
    84 	TVersion Version() const;
    85 	};
    86 
    87 class RUpsTestSession : public RSubSessionBase
    88  
    89 	{
    90 public:
    91 	IMPORT_C TInt  					Open(RUpsTestServ& aServ);
    92 	IMPORT_C TInt					UseTestService(TUpsTestServiceRequestData& aTestServiceRequestData,TUpsTestServiceReturn& aServiceCompoundReturn);
    93 	IMPORT_C void  					Close(void);
    94 	IMPORT_C TInt					GetServerSid();
    95 	IMPORT_C void  					ShutdownUPS(void);
    96 protected:
    97 
    98  
    99 private:
   100 
   101 
   102 	};
   103 
   104 #endif