wim/Scard/inc/ScardAccessControlRegistry.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003 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 "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:  Handles the creation and destruction of individual access 
       
    15 *                controllers
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CSCARDACCESSCONTROLREGISTRY_H
       
    22 #define CSCARDACCESSCONTROLREGISTRY_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include "ScardBase.h"
       
    26 #include "ScardDefs.h"
       
    27 
       
    28 //  FORWARD DECLARATIONS
       
    29 class CScardAccessControl;
       
    30 class CScardServer;
       
    31 class MScardReader;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  Handles the creation and destruction of individual access controllers.
       
    37 *
       
    38 *  @lib Scard.lib
       
    39 *  @since Series60 2.1
       
    40 */
       
    41 class CScardAccessControlRegistry : public CBase
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44             
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         * @param aServer Pointer to server object
       
    48         */
       
    49         static CScardAccessControlRegistry* NewL( CScardServer* aServer );
       
    50     
       
    51         /**
       
    52         * Destructor
       
    53         */
       
    54         virtual ~CScardAccessControlRegistry();
       
    55 
       
    56     public: // New functions
       
    57 
       
    58         /**
       
    59         * Give pointer to the actual access control object for the 
       
    60         * spesified reader
       
    61         * @param aReaderID ReaderID
       
    62         * @return Pointer to found ScardAccessControl object
       
    63         */
       
    64         CScardAccessControl* FindAccessController( const TReaderID aReaderID );
       
    65         
       
    66         /**
       
    67         * Return access controller object
       
    68         * @param aReaderID ReaderID
       
    69         * @return Pointer to CScardAccessControl object
       
    70         */
       
    71         CScardAccessControl* AccessController( const TReaderID aReaderID );
       
    72 
       
    73         /**
       
    74         * Used by the server to get a Reader object
       
    75         * @param aReaderID ReaderID
       
    76         * @return Pointer to MScardReader object
       
    77         */
       
    78         MScardReader* Reader( const TReaderID aReaderID ) const;
       
    79     
       
    80         /**
       
    81         * Check if this reader has a controller loaded
       
    82         * @param aReaderID ReaderID
       
    83         * @return ETrue if reader loaded, EFalse if not
       
    84         */
       
    85         TBool ReaderHandlerLoaded( const TReaderID aReaderID ) const;
       
    86 
       
    87         /**
       
    88         * Return pointer to CScardServer
       
    89         * @return Pointer to CScardServer object
       
    90         */
       
    91         CScardServer* Server();
       
    92 
       
    93         /**
       
    94         * An access controller has been disconnected
       
    95         * @param aControl Pointer to CScardAccessControl object
       
    96         * @return void
       
    97         */
       
    98         void ControllerRetired( CScardAccessControl* aControl );
       
    99 
       
   100     private:
       
   101         /**
       
   102         * C++ default constructor.
       
   103         */
       
   104         CScardAccessControlRegistry();
       
   105 
       
   106         /**
       
   107         * By default Symbian 2nd phase constructor is private.
       
   108         * @param aServer Pointer to server object
       
   109         */
       
   110         void ConstructL( CScardServer* aServer );
       
   111 
       
   112         //  
       
   113         /**
       
   114         * Destroy a handler object from the registry
       
   115         * @param aIndex Index of access controller in registry
       
   116         * @return void
       
   117         */
       
   118         //  
       
   119         void RemoveAccessController( const TInt aIndex );
       
   120 
       
   121     private:    //Data
       
   122         // Array of AccessControllers. Owned.
       
   123         CArrayFixFlat<CScardAccessControl*>* iAccessControllers;
       
   124         // Pointer to Server object. Not owned.
       
   125         CScardServer*                        iServer;
       
   126     };
       
   127 
       
   128 #endif      // CSCARDACCESSCONTROLREGISTRY_H
       
   129 
       
   130 // End of File