Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Alarm / plugin_config.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #include <Commons/FunctionDefinition.h>
20 #include <Commons/FunctionDeclaration.h>
21 #include <iostream>
22 #include <Commons/Exception.h>
23 #include <dpl/exception.h>
24 #include <map>
25
26 #include "plugin_config_impl.h"
27 #include "plugin_config.h"
28
29 #define ALARM_FEATURE_API "http://tizen.org/privilege/alarm"
30
31 #define ALARM_DEVICE_CAP "alarm"
32
33 using namespace WrtDeviceApis::Commons;
34
35 namespace DeviceAPI {
36 namespace Alarm {
37
38 static FunctionMapping createAlarmFunctions();
39
40 static FunctionMapping AlarmFunctions =
41     createAlarmFunctions();
42
43 DEFINE_FUNCTION_GETTER(Alarm, AlarmFunctions);
44
45 static FunctionMapping createAlarmFunctions()
46 {
47     /**
48      * Device capabilities
49      */ 
50     ACE_CREATE_DEVICE_CAP(DEVICE_CAP_ALARM, ALARM_DEVICE_CAP);
51
52     ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_ALARM);
53     ACE_ADD_DEVICE_CAP(DEVICE_LIST_ALARM, DEVICE_CAP_ALARM);
54
55     /**
56      * Api Features
57      */
58     ACE_CREATE_FEATURE(FEATURE_ALARM, ALARM_FEATURE_API);
59
60     ACE_CREATE_FEATURE_LIST(ALARM_FEATURES);
61     ACE_ADD_API_FEATURE(ALARM_FEATURES, FEATURE_ALARM);
62
63     /**
64      * Functions
65      */
66     FunctionMapping alarmMapping;
67
68     // add
69     AceFunction addFunc = ACE_CREATE_FUNCTION(
70             FUNCTION_ADD,
71             ALARM_FUNCTION_API_ADD,
72             ALARM_FEATURES,
73             DEVICE_LIST_ALARM);
74     
75     alarmMapping.insert(std::make_pair(
76                                 ALARM_FUNCTION_API_ADD,
77                                 addFunc));
78
79     // remove
80     AceFunction removeFunc = ACE_CREATE_FUNCTION(
81             FUNCTION_REMOVE,
82             ALARM_FUNCTION_API_REMOVE,
83             ALARM_FEATURES,
84             DEVICE_LIST_ALARM);
85     
86     alarmMapping.insert(std::make_pair(
87                                 ALARM_FUNCTION_API_REMOVE,
88                                 removeFunc));
89
90
91     // removeAll
92     AceFunction removeAllFunc = ACE_CREATE_FUNCTION(
93             FUNCTION_REMOVE_ALL,
94             ALARM_FUNCTION_API_REMOVE_ALL,
95             ALARM_FEATURES,
96             DEVICE_LIST_ALARM);
97     
98     alarmMapping.insert(std::make_pair(
99                                 ALARM_FUNCTION_API_REMOVE_ALL,
100                                 removeAllFunc));
101
102     return alarmMapping;
103 }
104
105 }
106 }