2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <Commons/FunctionDefinition.h>
21 #include <Commons/FunctionDeclaration.h>
22 #include <Commons/Exception.h>
23 #include "plugin_config.h"
24 #include "plugin_config_impl.h"
26 #define SYSTEMSETTING_FEATURE_API "http://tizen.org/privilege/setting"
27 //#define SYSTEMSETTING_FEATURE_API_READ "http://tizen.org/privilege/setting.read"
28 //#define SYSTEMSETTING_FEATURE_API_WRITE "http://tizen.org/privilege/setting.write"
30 #define SYSTEMSETTING_DEVICE_CAP "setting"
31 //#define SYSTEMSETTING_DEVICE_CAP_READ "setting"
32 //#define SYSTEMSETTING_DEVICE_CAP_WRITE "setting"
36 namespace SystemSetting {
38 static WrtDeviceApis::Commons::FunctionMapping createSystemSettingFunctions();
40 static WrtDeviceApis::Commons::FunctionMapping SystemSettingFunctions =
41 createSystemSettingFunctions();
43 DEFINE_FUNCTION_GETTER(SystemSetting, SystemSettingFunctions);
45 static WrtDeviceApis::Commons::FunctionMapping createSystemSettingFunctions()
47 using namespace WrtDeviceApis::Commons;
53 ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SYSTEMSETTING, SYSTEMSETTING_DEVICE_CAP);
55 ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);
57 ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SYSTEMSETTING);
58 ACE_ADD_DEVICE_CAP(DEVICE_LIST_SYSTEMSETTING, DEVICE_CAP_SYSTEMSETTING);
64 ACE_CREATE_FEATURE(FEATURE_SYSTEMSETTING, SYSTEMSETTING_FEATURE_API);
66 ACE_CREATE_FEATURE_LIST(SYSTEMSETTING_FEATURES_SYSTEMSETTING);
67 ACE_ADD_API_FEATURE(SYSTEMSETTING_FEATURES_SYSTEMSETTING, FEATURE_SYSTEMSETTING);
73 FunctionMapping SystemSettingFunctions;
76 AceFunction getPropertyFunc = ACE_CREATE_FUNCTION(
77 FUNCTION_GET_PROPERTY,
78 SYSTEMSETTING_FUNCTION_API_GET_PROPERTY,
79 SYSTEMSETTING_FEATURES_SYSTEMSETTING,
80 DEVICE_LIST_SYSTEMSETTING);
82 SystemSettingFunctions.insert( std::make_pair(
83 SYSTEMSETTING_FUNCTION_API_GET_PROPERTY,
87 AceFunction setPropertyFunc = ACE_CREATE_FUNCTION(
88 FUNCTION_SET_PROPERTY,
89 SYSTEMSETTING_FUNCTION_API_SET_PROPERTY,
90 SYSTEMSETTING_FEATURES_SYSTEMSETTING,
91 DEVICE_LIST_SYSTEMSETTING);
93 SystemSettingFunctions.insert( std::make_pair(
94 SYSTEMSETTING_FUNCTION_API_SET_PROPERTY,
97 return SystemSettingFunctions;
102 #undef SYSTEMSETTING_FEATURE_API
103 #undef SYSTEMSETTING_DEVICE_CAP