authenticationservices/authenticationserver/inc/authserver/authclient.h
changeset 29 ece3df019add
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
       
     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 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 * RAuthclient - external authentication client session interface
       
    16 * The defined fuctionality is used by clients to access the authentication
       
    17 * server.
       
    18 * The access to a specific functionality is dependant on the client 
       
    19 * capabilities and may be restricted.             
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 /**
       
    25  @file 
       
    26  @publishedAll
       
    27  @released
       
    28 */
       
    29 
       
    30 #ifndef AUTHCLIENT_H
       
    31 #define AUTHCLIENT_H
       
    32 
       
    33 #include "authserver/identity.h"
       
    34 #include "authserver/authexpression.h"
       
    35 #include "authserver/plugindesc.h"
       
    36 #include "authserver/idandstring.h"
       
    37 #include <scs/scsclient.h>
       
    38 namespace AuthServer
       
    39 {
       
    40 
       
    41 class CAsyncResponseDecoder;
       
    42 
       
    43 /**
       
    44  * Client side interface to the authentication server providing general
       
    45  * authentication and plugin query services.
       
    46  *
       
    47  */	
       
    48 class RAuthClient : public RScsClientBase
       
    49 	{
       
    50 	
       
    51 	friend class CAsyncResponseDecoder;
       
    52 	
       
    53 public:
       
    54 
       
    55     IMPORT_C RAuthClient();
       
    56     
       
    57 	IMPORT_C TInt Connect();
       
    58 
       
    59 	IMPORT_C void AuthenticateL(
       
    60 	    const CAuthExpression& aExpression,
       
    61 	    TTimeIntervalSeconds   aTimeout,
       
    62 		TBool                  aClientSpecificKey,
       
    63 		TBool                  aWithString,
       
    64 	    CIdentity*&            aIdentityResult, 
       
    65 	    TRequestStatus&        aStatus);
       
    66 	
       
    67 	IMPORT_C CIdentity* AuthenticateL(
       
    68 	    const CAuthExpression& aExpression,
       
    69 	    TTimeIntervalSeconds   aTimeout,
       
    70 		TBool                  aClientSpecificKey,
       
    71 		TBool                  aWithString);
       
    72 
       
    73 	IMPORT_C CIdentity* AuthenticateL(
       
    74 			const CAuthExpression& 	aAuthExpression,
       
    75 		    TTimeIntervalSeconds   	aTimeout,
       
    76 			TBool                  	aClientSpecificKey,
       
    77 			TUid 				   	aClientSid,
       
    78 			TBool                  	aWithString,
       
    79 			const TDesC&			aClientMessage);
       
    80 			
       
    81 	IMPORT_C void AuthenticateL(
       
    82 		const CAuthExpression& 	aAuthExpression,
       
    83 	    TTimeIntervalSeconds   	aTimeout,
       
    84 		TBool                  	aClientSpecificKey,
       
    85 		TUid 					aClientSid,
       
    86 		TBool                  	aWithString,
       
    87 	    const TDesC&			aClientMessage,
       
    88 	    CIdentity*&            	aIdentityResult,
       
    89 	    TRequestStatus&        	aStatus
       
    90 		);
       
    91 
       
    92 	IMPORT_C void DeauthenticateL();
       
    93 	
       
    94 	IMPORT_C void PluginsL(RPluginDescriptions& aPluginList);
       
    95 	IMPORT_C void ActivePluginsL(RPluginDescriptions& aPluginList);
       
    96 	IMPORT_C void PluginsOfTypeL(TAuthPluginType aType,
       
    97 								  RPluginDescriptions& aPluginList);
       
    98 	
       
    99 	IMPORT_C void PluginsWithTrainingStatusL(
       
   100         TAuthTrainingStatus aStatus,
       
   101 		RPluginDescriptions& aPluginList);
       
   102 	
       
   103 	IMPORT_C void IdentitiesL(RIdentityIdArray& aIdList);
       
   104 	IMPORT_C void IdentitiesWithStringL(RIdAndStringArray& aList);
       
   105 
       
   106 	IMPORT_C HBufC* IdentityStringL(TIdentityId aId);
       
   107 	IMPORT_C void SetIdentityStringL(TIdentityId aId, const TDesC& aString);
       
   108 	
       
   109 	IMPORT_C TPluginId PreferredTypePluginL(TAuthPluginType aPluginType);
       
   110 	
       
   111 	IMPORT_C TUint Cancel();
       
   112 	IMPORT_C void Close();
       
   113 	
       
   114 	IMPORT_C void ListAuthAliasesL(RPointerArray<HBufC>& aAuthAliasList);
       
   115 	
       
   116 	IMPORT_C CAuthExpression* CreateAuthExpressionL(const TDesC& aAuthString) const;
       
   117 	
       
   118 protected:
       
   119 	/* @internalComponent */
       
   120 	void CheckAsyncDecoderL();
       
   121 	/* @internalComponent */
       
   122 	HBufC8* SendReceiveBufferLC(TInt aMessage);
       
   123 	/* @internalComponent */
       
   124 	HBufC8* SendReceiveBufferLC(TInt aMessage, TIpcArgs& aArgs);
       
   125 	
       
   126 private:
       
   127 	TInt StartAuthServer();
       
   128 
       
   129 protected:
       
   130 	CAsyncResponseDecoder* iAsyncResponseDecoder;
       
   131 };
       
   132   
       
   133 } // namespace
       
   134 #endif
       
   135