authenticationservices/authenticationserver/source/server/authtransaction.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 * CAuthTransaction class definition
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @released
       
    23  @internalComponent
       
    24 */
       
    25 #ifndef AUTHTRANSACTION_H
       
    26 #define AUTHTRANSACTION_H
       
    27 
       
    28 #include <e32cmn.h>
       
    29 #include <e32base.h>
       
    30 #include "authserver/authtypes.h"
       
    31 
       
    32 namespace AuthServer 
       
    33 {
       
    34 
       
    35 class CAuthExpressionImpl;
       
    36 
       
    37 /**
       
    38  * This class holds state information about the current asynchronous
       
    39  * authentication taking place.
       
    40  **/
       
    41 class CAuthTransaction : public CBase
       
    42 	{
       
    43 public:
       
    44 	struct TPluginResult
       
    45 		{
       
    46 		TPluginId iPlugin;
       
    47 		TIdentityId* iId;		
       
    48 		HBufC8* iData;
       
    49 	    }; 
       
    50 
       
    51 	typedef RPointerArray<TPluginResult> RResultArray;
       
    52 	
       
    53 	static CAuthTransaction* NewL(const RMessage2& aMsg,
       
    54 								  TBool aClientKey, TInt aClientSid,
       
    55 								  TBool aWithString, const TDesC& aClientMessage,
       
    56 								  const CAuthExpressionImpl* aExpr);
       
    57 	
       
    58 	HBufC8*& AddPluginL(TPluginId& aPluginId,
       
    59 						TIdentityId& aIdentityId);
       
    60 					   
       
    61 	const RMessagePtr2& Message() { return iMsg; }
       
    62 
       
    63 	RResultArray& Results() { return iRecords; }
       
    64 	
       
    65 	TBool ClientKey() { return iClientKey; }
       
    66 
       
    67 	TBool WithString() { return iWithString; }
       
    68 	
       
    69 	TInt ClientSid()  { return iClientSid;	}
       
    70 
       
    71 	const HBufC* ClientMessage() {return static_cast<const HBufC*>(&iClientMessage); }
       
    72 
       
    73 	TPluginId LastPluginId() const;
       
    74 	
       
    75 	~CAuthTransaction();
       
    76 	
       
    77 private:
       
    78 
       
    79 	CAuthTransaction(const RMessage2& aMsg, TBool aClientKey, TInt aClientSid,
       
    80 					 TBool aWithString, const TDesC& aClientMessage,
       
    81 					 const CAuthExpressionImpl* aExpr);
       
    82 					 
       
    83 	void ConstructL(const RMessage2& aMessage);
       
    84 	
       
    85 	/// the message to complete at the end
       
    86     const RMessagePtr2         iMsg;
       
    87     
       
    88 	/// are we returning a client key?
       
    89 	TBool                      iClientKey;
       
    90 	   
       
    91 	TInt					   iClientSid;
       
    92        
       
    93 	/// are we returning a client key?
       
    94 	TBool                      iWithString;
       
    95 	
       
    96     /// the displayable text string to the plugin
       
    97     const TDesC&              	iClientMessage;
       
    98     
       
    99 	// the authentication expression being used
       
   100 	const CAuthExpressionImpl* iExpr;
       
   101 	
       
   102 	/// A list of results returned by each plugin called
       
   103     RResultArray               iRecords;
       
   104     
       
   105     };
       
   106 
       
   107 } //namespace
       
   108 
       
   109 #endif // AUTHTRANSACTION_H