tizen 2.3.1 release
[framework/web/wearable/wrt-plugins-tizen.git] / src / Badge / plugin_config.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2014 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.h"
27
28 #define BADGE_FEATURE_API_BADGE  "http://tizen.org/privilege/notification"
29
30 #define BADGE_DEVICE_CAP_BADGE "notification"
31
32 using namespace WrtDeviceApis::Commons;
33
34 namespace DeviceAPI {
35 namespace Badge {
36
37 static FunctionMapping createBadgeFunctions();
38
39 static FunctionMapping BadgeFunctions =
40     createBadgeFunctions();
41
42 DEFINE_FUNCTION_GETTER(BADGE, BadgeFunctions);
43
44 static FunctionMapping createBadgeFunctions()
45 {
46     /**
47      * Device capabilities
48      */
49     ACE_CREATE_DEVICE_CAP(DEVICE_CAP_BADGE, BADGE_DEVICE_CAP_BADGE);
50
51     ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);
52
53     ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_BADGE);
54     ACE_ADD_DEVICE_CAP(DEVICE_LIST_BADGE, DEVICE_CAP_BADGE);
55
56     /**
57      * Api Features
58      */
59     ACE_CREATE_FEATURE(FEATURE_BADGE, BADGE_FEATURE_API_BADGE);
60
61     ACE_CREATE_FEATURE_LIST(BADGE_FEATURES_BADGE);
62     ACE_ADD_API_FEATURE(BADGE_FEATURES_BADGE, FEATURE_BADGE);
63
64     /**
65      * Functions
66      */
67
68     FunctionMapping BadgeMapping;
69
70     AceFunction BadgeFunc = ACE_CREATE_FUNCTION(
71             FUNCTION_API_BADGE,
72             BADGE_FUNCTION_API,
73             BADGE_FEATURES_BADGE,
74             DEVICE_LIST_BADGE);
75
76     BadgeMapping.insert(std::make_pair(
77                                BADGE_FUNCTION_API,
78                                BadgeFunc));
79
80
81
82     return BadgeMapping;
83 }
84
85 }
86 }
87