wim/Scard/inc/ScardAccessControl.inl
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:  Inline functions for smart card access control
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 //  INCLUDES
       
    21 #include "ScardMessageStack.h"
       
    22 #include "ScardSession.h"
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CScardAccessControl::ReaderID
       
    28 // Return reader ID
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 inline const TReaderID CScardAccessControl::ReaderID() const 
       
    32     {
       
    33     return iReaderID;
       
    34     }
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CScardAccessControl::Reader
       
    38 // Return reader object
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 inline MScardReader* CScardAccessControl::Reader() const
       
    42     {
       
    43     return iReader;
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CScardAccessControl::CancelByTimeOut
       
    48 // Cancel operations by timeout
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 void CScardAccessControl::CancelByTimeOut( CScardCommandTimer* aTimer )
       
    52     {
       
    53     iManager->CancelByTimeOut( aTimer );
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CScardAccessControl::ChannelStatus
       
    58 // Return channel status
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 inline TUint16 CScardAccessControl::ChannelStatus()
       
    62     {
       
    63     return iManager->ChannelStatus();
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CScardAccessControl::ChannelOpenedYet
       
    68 // Is channel opened yet. Return ETrue/EFalse
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 inline const TBool CScardAccessControl::ChannelOpenedYet( const TInt8 aChannel )
       
    72     {
       
    73     return iManager->ChannelOpenedYet( aChannel );
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CScardAccessControl::AddSessionToChannelL
       
    78 // Add session to the channel
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 inline const TBool CScardAccessControl::AddSessionToChannelL(
       
    82     const TInt8 aChannel,
       
    83     const TInt aSessionID )
       
    84     {
       
    85     return iManager->AddSessionToChannelL( aChannel, aSessionID );
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CScardAccessControl::UnreservedLogicalChannel
       
    90 // Return unreserved logical channel
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 inline const TInt8 CScardAccessControl::UnreservedLogicalChannel() const
       
    94     {
       
    95     return iManager->UnreservedLogicalChannel();
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // CScardAccessControl::RemoveSessionFromChannelL
       
   100 // Remove Session From Channel
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 inline const TBool CScardAccessControl::RemoveSessionFromChannelL(
       
   104     const TInt8 aChannel,
       
   105     const TInt aSessionID )
       
   106     {
       
   107     return iManager->RemoveSessionL( aChannel, aSessionID );
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CScardAccessControl::ValidateChannelL
       
   112 // Validate channel
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 inline void CScardAccessControl::ValidateChannelL(
       
   116     const TInt8 aChannel, 
       
   117     const TInt aSessionID )
       
   118     {
       
   119     iManager->ValidateChannelL( aChannel, aSessionID );
       
   120     }
       
   121 
       
   122 // -----------------------------------------------------------------------------
       
   123 // CScardAccessControl::HandleNextMessageL
       
   124 // Handle Next Message
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 inline void CScardAccessControl::HandleNextMessageL(
       
   128     const TMessageHandle& aHandle )
       
   129     {
       
   130     if ( aHandle.iSessionID != ENoSession )
       
   131         {
       
   132         ( SessionBase( aHandle.iSessionID ) )->ServiceL( aHandle );
       
   133         }
       
   134     }
       
   135 
       
   136 // End of File