Update source
[platform/core/connectivity/smartcard-service.git] / common / include / ReaderHelper.h
1 /*
2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef READERHELPER_H_
19 #define READERHELPER_H_
20
21 /* standard library header */
22 #include <vector>
23
24 /* SLP library header */
25
26 /* local header */
27 #include "Synchronous.h"
28 #include "SessionHelper.h"
29
30 using namespace std;
31
32 namespace smartcard_service_api
33 {
34         class SEServiceHelper;
35
36         typedef void (*openSessionCallback)(SessionHelper *session, int error, void *userData);
37
38         class ReaderHelper : public Synchronous
39         {
40         protected:
41                 char name[30];
42                 vector<SessionHelper *> sessions;
43                 SEServiceHelper *seService;
44
45                 ReaderHelper();
46
47         public:
48                 ~ReaderHelper();
49
50                 const char *getName();
51                 SEServiceHelper *getSEService();
52                 bool isSecureElementPresent();
53                 
54                 virtual void closeSessions() = 0;
55
56                 virtual int openSession(openSessionCallback callback, void *userData) = 0;
57                 virtual SessionHelper *openSessionSync() = 0;
58         };
59
60 } /* namespace smartcard_service_api */
61 #endif /* READERHELPER_H_ */