cryptomgmtlibs/securitycommonutils/inc/scsclient.h
changeset 8 35751d3474b7
child 33 cf642210ecb7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     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 * Defines the client-side classes which other client-side handles
       
    16 * derive from to use the SCS functionality.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology
       
    24  @released
       
    25 */
       
    26 
       
    27 #ifndef SCSCLIENT_H
       
    28 #define SCSCLIENT_H
       
    29 
       
    30 #include <e32std.h>
       
    31 
       
    32 
       
    33 class RScsClientBase : public RSessionBase
       
    34 /**
       
    35 	Provides functionality to connect to the server, starting
       
    36 	the server process if necessary.  This class cannot be used
       
    37 	directly - the SCS implementor must define a subclass.
       
    38  */
       
    39 	{
       
    40 public:
       
    41 	IMPORT_C void Close();
       
    42 	IMPORT_C TInt SetServerHeapFail(TInt aRate);
       
    43 	IMPORT_C TInt ResetServerHeapFail();
       
    44 
       
    45 	IMPORT_C TInt ShutdownServer();
       
    46 	
       
    47 protected:
       
    48 	IMPORT_C RScsClientBase();
       
    49 	IMPORT_C TInt Connect(
       
    50 		const TDesC& aSvrName, const TVersion& aReqVer, const TDesC& aExeName, const TUidType& aFullExeUid);
       
    51 
       
    52 	IMPORT_C TInt CallSessionFunction(TInt aFunction) const;
       
    53 	IMPORT_C TInt CallSessionFunction(TInt aFunction, const TIpcArgs& aArgs) const;
       
    54 	IMPORT_C void CallSessionFunction(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus) const;
       
    55 	IMPORT_C void CancelSessionFunction(TInt aFunction) const;
       
    56 	
       
    57 private:
       
    58 	TInt StartServerProcess(const TDesC& aExeName, const TUidType& aFullExeUid);	
       
    59 	};
       
    60 
       
    61 class RScsClientSubsessionBase : public RSubSessionBase
       
    62 /**
       
    63 	This class is used to send messages to server-side SCS subsessions.
       
    64 	This class cannot be used directly - the implementor must define a
       
    65 	subclass.
       
    66  */
       
    67 	{
       
    68 public:
       
    69 	IMPORT_C void Close();
       
    70 
       
    71 protected:
       
    72 	IMPORT_C RScsClientSubsessionBase();
       
    73 	IMPORT_C TInt CreateSubsession(const RScsClientBase& aSession, TInt aFunction, const TIpcArgs& aArgs);
       
    74 
       
    75 	IMPORT_C TInt CallSubsessionFunction(TInt aFunction) const;
       
    76 	IMPORT_C TInt CallSubsessionFunction(TInt aFunction, const TIpcArgs& aArgs) const;
       
    77 	IMPORT_C void CallSubsessionFunction(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus) const;
       
    78 	IMPORT_C void CancelSubsessionFunction(TInt aFunction) const;
       
    79 	};
       
    80 
       
    81 #endif	// #ifndef SCSCLIENT_H
       
    82