|
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 function for smart card server. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "ScardSession.h" |
|
22 #include "ScardNotifyRegistry.h" |
|
23 #include "ScardAccessControl.h" |
|
24 #include "ScardAccessControlRegistry.h" |
|
25 #include "ScardReaderRegistry.h" |
|
26 #include "ScardResourceRegistry.h" |
|
27 #include "ScardConnectionRegistry.h" |
|
28 |
|
29 |
|
30 // ============================ MEMBER FUNCTIONS =============================== |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CScardServer::NotifyRegistry |
|
34 // return pointer to registry |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 inline CScardNotifyRegistry* CScardServer::NotifyRegistry() const |
|
38 { |
|
39 return iNotifyRegistry; |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CScardServer::FindAccessControl |
|
44 // Return the access controller for the reader |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 inline CScardAccessControl* CScardServer::FindAccessControl( |
|
48 const TReaderID aReaderID ) const |
|
49 { |
|
50 return iControlRegistry->FindAccessController( aReaderID ); |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CScardServer::FactoryRegistry |
|
55 // Return factory register |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 inline CScardReaderRegistry* CScardServer::FactoryRegistry() const |
|
59 { |
|
60 return iReaderFactoryRegistry; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CScardServer::ConnectionRegistry |
|
65 // Return pointer to CScardConnectionRegistry |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 inline CScardConnectionRegistry* CScardServer::ConnectionRegistry() const |
|
69 { |
|
70 return iConnectionRegistry; |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CScardServer::NotifyObserver |
|
75 // Return pointer to observer |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 inline MScardNotifyObserver* CScardServer::NotifyObserver() |
|
79 { |
|
80 return iNotifyRegistry; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CScardServer::ReaderService |
|
85 // Return service pointer |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 inline MScardReaderService* CScardServer::ReaderService() |
|
89 { |
|
90 return this; |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CScardServer::ReaderID |
|
95 // Scan database to see ID belonging to this name |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 inline const TReaderID CScardServer::ReaderID( |
|
99 const TScardReaderName& aFriendlyName ) const |
|
100 { |
|
101 return iReaderFactoryRegistry->ReaderID( aFriendlyName ); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CScardServer::FriendlyName |
|
106 // Scan the database for the name belonging to this ID |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 inline const TScardReaderName CScardServer::FriendlyName( |
|
110 const TReaderID aReaderID ) const |
|
111 { |
|
112 return iReaderFactoryRegistry->FriendlyName( aReaderID ); |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CScardServer::ReaderSupported |
|
117 // Scan the database to see if we support this reader type |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 inline const TBool CScardServer::ReaderSupported( |
|
121 const TScardReaderName& aReaderName ) const |
|
122 { |
|
123 return iReaderFactoryRegistry->IsSupported( aReaderName ); |
|
124 } |
|
125 |
|
126 // ----------------------------------------------------------------------------- |
|
127 // CScardServer::AccessRegistry |
|
128 // Return pointer to CScardAccessControlRegistry |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 inline CScardAccessControlRegistry* CScardServer::AccessRegistry() const |
|
132 { |
|
133 return iControlRegistry; |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // CScardServer::ReaderRegistry |
|
138 // Return pointer to server's CScardReaderRegistry |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 inline CScardReaderRegistry* CScardServer::ReaderRegistry() const |
|
142 { |
|
143 return iReaderFactoryRegistry; |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // CScardServer::ConnectToReaderL |
|
148 // Connect to reader |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 inline void CScardServer::ConnectToReaderL( |
|
152 CScardSession* aSession, |
|
153 const RMessage2& aMessage ) |
|
154 { |
|
155 iConnectionRegistry->ConnectToReaderL( aSession, aMessage ); |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CScardServer::CardEvent |
|
160 // Handle card event |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 inline void CScardServer::CardEvent( |
|
164 const TScardServiceStatus aEvent, |
|
165 const TReaderID aReaderID ) |
|
166 { |
|
167 iResourceRegistry->CardEvent( aEvent, aReaderID ); |
|
168 } |
|
169 |
|
170 // End of File |