2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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
8 * http://floralicense.org/license/
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.
17 #include <dpl/foreach.h>
18 #include "wac_feature.h"
20 #include <ace-settings/ace_api_settings.h>
22 namespace WebAppDetailSetting {
24 const char *WacFeature::m_feature[] = {
25 "http://wacapps.net/api/accelerometer",
26 "http://wacapps.net/api/orientation",
27 "http://wacapps.net/api/camera",
28 "http://wacapps.net/api/devicestatus",
29 "http://wacapps.net/api/filesystem",
30 "http://wacapps.net/api/messaging",
31 "http://www.w3.org/TR/geolocation-API/",
32 "http://wacapps.net/api/pim.contact",
33 "http://wacapps.net/api/pim.calendar",
34 "http://wacapps.net/api/pim.task",
35 "http://wacapps.net/api/deviceinteraction",
39 const char *WacFeature::m_featureName[] = {
50 N_("Device interaction"),
53 std::map<int, Feature> WacFeature::getFeatureMap(
54 WrtDB::DbWidgetFeatureSet &features,
58 std::map<int, Feature> featureMap;
61 FOREACH(feature, features) {
62 for (i = 0; i < sizeof(m_feature) / sizeof(*m_feature); i++) {
63 if (featureMap.find(i) != featureMap.end())
66 uri = DPL::ToUTF8String(feature->name);
70 featureMap[i] = Feature(m_featureName[i],
72 ace_preference_t perm;
73 ace_get_widget_resource_preference(
75 const_cast<char *>(m_feature[i]),
77 featureMap[i].setPerm(perm);
87 } /* WebAppDetailSetting */