summaryrefslogtreecommitdiff
path: root/mobile_src/Tizen/plugin_config.cpp
blob: 367e4166ac0a81eeb022c5c3fd851e56c7cce504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// Tizen Web Device API
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

/**
 * @file        plugin_config.cpp
 * @version     0.1
 * @brief
 */

#include <map>
#include <utility>
#include <Commons/FunctionDefinition.h>
#include <Commons/FunctionDeclaration.h>
#include <Commons/Exception.h>

#define TIZEN_FEATURE_API "http://tizen.org/privilege/tizen"

namespace DeviceAPI {
namespace Tizen {

const char* TIZEN_FUNCTION_API_LIST_AVAIL_FEATURES =
    "listAvailableFeatures";
const char* TIZEN_FUNCTION_API_LIST_ACTIV_FEATURES =
    "listActivatedFeatures";

static WrtDeviceApis::Commons::FunctionMapping createDeviceApisFunctions();

static WrtDeviceApis::Commons::FunctionMapping DeviceApisFunctions =
    createDeviceApisFunctions();

DEFINE_FUNCTION_GETTER(DeviceApis, DeviceApisFunctions);

static WrtDeviceApis::Commons::FunctionMapping createDeviceApisFunctions()
{
    ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);

    //
    // --- features ----
    //

    ACE_CREATE_FEATURE(FEATURE_TIZEN,TIZEN_FEATURE_API);

    ACE_CREATE_FEATURE_LIST(FEATURE_LIST_TIZEN);
    ACE_ADD_API_FEATURE(FEATURE_LIST_TIZEN,FEATURE_TIZEN);

    //
    // --- functions ---
    //

    WrtDeviceApis::Commons::FunctionMapping DeviceApisMapping;

    //LIST_AVAIL
    WrtDeviceApis::Commons::AceFunction listAvailableFeaturesFuncs = ACE_CREATE_FUNCTION(
        FUNCTION_LIST_AVAILABLE_FEATURES,
        TIZEN_FUNCTION_API_LIST_AVAIL_FEATURES,
        FEATURE_LIST_TIZEN,
        EMPTY_DEVICE_LIST);

    DeviceApisMapping.insert(
        std::make_pair(
        TIZEN_FUNCTION_API_LIST_AVAIL_FEATURES,
        listAvailableFeaturesFuncs));

    //LIST_ACTIV
    WrtDeviceApis::Commons::AceFunction listActivatedFeaturesFunc = ACE_CREATE_FUNCTION(
        FUNCTION_LIST_ACTIVATED_FEATURES,
        TIZEN_FUNCTION_API_LIST_ACTIV_FEATURES,
        FEATURE_LIST_TIZEN,
        EMPTY_DEVICE_LIST);

    DeviceApisMapping.insert(
        std::make_pair(
        TIZEN_FUNCTION_API_LIST_ACTIV_FEATURES,
        listActivatedFeaturesFunc));

    return DeviceApisMapping;
}

} // Tizen
} // DeviceAPI

#undef TIZEN_FEATURE_API
#undef TIZEN_FUNCTION_API_LIST_ACTIV_FEATURES
#undef TIZEN_FUNCTION_API_LIST_AVAIL_FEATURES