authenticationservices/authenticationserver/inc/authserver/plugindesc.h
changeset 102 deec7e509f66
parent 94 0e6c5a9328b5
child 108 ca9a0fc2f082
equal deleted inserted replaced
94:0e6c5a9328b5 102:deec7e509f66
     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 * CPluginDesc class declaration
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @publishedAll
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef PLUGINDESC_H
       
    27 #define PLUGINDESC_H
       
    28 
       
    29 #include <s32strm.h>
       
    30 #include <ct/rcpointerarray.h>
       
    31 #include "authserver/authtypes.h"
       
    32 
       
    33 namespace AuthServer
       
    34 {
       
    35 
       
    36 /**
       
    37  * Provides a description of an authentication plugin's properties.
       
    38  **/
       
    39 NONSHARABLE_CLASS(CPluginDesc) : public CBase
       
    40 	{
       
    41 public:
       
    42 
       
    43 	IMPORT_C static CPluginDesc* NewL(
       
    44 		TPluginId aId, const TDesC& aName,
       
    45 		TAuthPluginType aType, TAuthTrainingStatus aTrainingStatus,
       
    46 		TEntropy aMinEntropy, TPercentage aFalsePositiveRate,
       
    47 		TPercentage aFalseNegativeRate);
       
    48 	IMPORT_C static CPluginDesc* NewLC(RReadStream& aIn);
       
    49 	
       
    50 	virtual ~CPluginDesc();
       
    51 	
       
    52 	IMPORT_C TPluginId           Id() const;
       
    53 	IMPORT_C const TDesC*        Name() const;
       
    54 	IMPORT_C TAuthPluginType     Type() const;
       
    55 	IMPORT_C TAuthTrainingStatus TrainingStatus() const;
       
    56 	IMPORT_C TEntropy            MinEntropy() const;
       
    57 	IMPORT_C TPercentage         FalsePositiveRate() const;
       
    58 	IMPORT_C TPercentage         FalseNegativeRate() const;
       
    59 
       
    60 	IMPORT_C void ExternalizeL(RWriteStream& aOut) const;
       
    61 		
       
    62 private:
       
    63 	static const TInt KMaxNameLength = 256;
       
    64 		
       
    65 	CPluginDesc(TPluginId           aId,
       
    66 				TAuthPluginType     aType,
       
    67 				TAuthTrainingStatus aTrainingStatus,
       
    68 				TEntropy            aMinEntropy,
       
    69 				TPercentage         aFalsePositiveRate,
       
    70 				TPercentage         aFalseNegativeRate);
       
    71 	void ConstructL(const TDesC& aName);
       
    72 
       
    73 	inline CPluginDesc();
       
    74 	void InternalizeL(RReadStream& aIn);
       
    75 
       
    76 	/// the id of the plugin
       
    77 	TPluginId           iId;
       
    78 	/// The name of the plugin
       
    79 	HBufC*              iName;
       
    80 	/// The type of plugin
       
    81 	TAuthPluginType     iType;
       
    82 	/// Indicates whether the plugin is trained for none, some or all
       
    83 	/// known identities.
       
    84 	TAuthTrainingStatus iTrainingStatus;
       
    85 	/// The minumum entropy provided by the plugin.
       
    86 	TEntropy            iMinEntropy;
       
    87 	/// The false positive rate of the plugin
       
    88 	TPercentage         iFalsePositiveRate;
       
    89 	/// The false negative rate of the plugin.
       
    90 	TPercentage         iFalseNegativeRate;
       
    91     };
       
    92 
       
    93 typedef RCPointerArray<const CPluginDesc> RPluginDescriptions;
       
    94 
       
    95 }   
       
    96 
       
    97 #include <authserver/plugindesc.inl>
       
    98 
       
    99 #endif // PLUGINDESC_H