Update change log and spec for wrt-plugins-tizen_0.4.13
[framework/web/wrt-plugins-tizen.git] / src / SecureElement / plugin_config.cpp
1 /*
2  * Copyright (c) 2011 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
19 #include <map>
20 #include <utility>
21 #include <Commons/FunctionDefinition.h>
22 #include <Commons/FunctionDeclaration.h>
23 #include <Commons/Exception.h>
24
25 #include "plugin_config.h"
26
27 #define SECUREELEMENT_FEATURE_API_SECUREELEMENT "http://tizen.org/privilege/secureelement"
28 #define SECUREELEMENT_FEATURE_API_SE "http://tizen.org/privilege/se"
29
30 #define SECUREELEMENT_DEVICE_CAP_SECUREELEMENT "secureelement"
31 #define SECUREELEMENT_DEVICE_CAP_SE "se"
32
33 namespace DeviceAPI {
34 namespace SecureElement {
35
36 static WrtDeviceApis::Commons::FunctionMapping createSecureElementFunctions();
37
38 static WrtDeviceApis::Commons::FunctionMapping SecureElementFunctions =
39     createSecureElementFunctions();
40
41 DEFINE_FUNCTION_GETTER(SecureElement, SecureElementFunctions);
42
43 static WrtDeviceApis::Commons::FunctionMapping createSecureElementFunctions()
44 {
45     using namespace WrtDeviceApis::Commons;
46
47     /**
48      * Device capabilities
49      */
50     ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SECUREELEMENT, SECUREELEMENT_DEVICE_CAP_SECUREELEMENT);
51         ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SE, SECUREELEMENT_DEVICE_CAP_SE);
52
53     ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SECUREELEMENT);
54     ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECUREELEMENT, DEVICE_CAP_SECUREELEMENT);
55         ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECUREELEMENT, DEVICE_CAP_SE);
56
57     /**
58      * API features
59      */
60     ACE_CREATE_FEATURE(FEATURE_SECUREELEMENT, SECUREELEMENT_FEATURE_API_SECUREELEMENT);
61         ACE_CREATE_FEATURE(FEATURE_SE, SECUREELEMENT_FEATURE_API_SE);
62
63     ACE_CREATE_FEATURE_LIST(SECUREELEMENT_FEATURES_SECUREELEMENT);
64     ACE_ADD_API_FEATURE(SECUREELEMENT_FEATURES_SECUREELEMENT, FEATURE_SECUREELEMENT);
65         ACE_ADD_API_FEATURE(SECUREELEMENT_FEATURES_SECUREELEMENT, FEATURE_SE);
66
67     /**
68      * Functions
69      */
70
71     FunctionMapping SecureElementFunctions;
72
73         AceFunction seFunctions = ACE_CREATE_FUNCTION(
74             FUNCTION_SECUREELEMENT_FUNCTIONS,
75             SECUREELEMENT_FUNCTION_API_FUNCS,
76             SECUREELEMENT_FEATURES_SECUREELEMENT,
77             DEVICE_LIST_SECUREELEMENT);
78
79     SecureElementFunctions.insert(std::make_pair(
80                                SECUREELEMENT_FUNCTION_API_FUNCS,
81                                seFunctions));
82
83     return SecureElementFunctions;
84 }
85
86
87
88 #undef SECUREELEMENT_FEATURE_API_SE
89 #undef SECUREELEMENT_FEATURE_API_SECUREELEMENT
90 #undef SECUREELEMENT_DEVICE_CAP_SE
91 #undef SECUREELEMENT_DEVICE_CAP_SECUREELEMENT