From: Jihoon Chung Date: Sat, 29 Dec 2012 03:08:56 +0000 (+0900) Subject: Add path builder for vconf key X-Git-Tag: submit/trunk/20121229.050449~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4030099fb2d213fd62c1648a64be3ee82428e2dd;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Add path builder for vconf key [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Current realization is define const to each source code for vconf key which is used in the setting value. This commit create common inline function for vconf key path builder. [SCMRequest] N/A Change-Id: I9f37edb3262d5967c522bdb4ba58fab624d551c6 --- diff --git a/modules/widget_dao/CMakeLists.txt b/modules/widget_dao/CMakeLists.txt index fca9cba..cf1034f 100644 --- a/modules/widget_dao/CMakeLists.txt +++ b/modules/widget_dao/CMakeLists.txt @@ -126,11 +126,12 @@ INSTALL(FILES include/dpl/wrt-dao-ro/plugin_dao_read_only.h include/dpl/wrt-dao-ro/property_dao_read_only.h include/dpl/wrt-dao-ro/widget_config.h + include/dpl/wrt-dao-ro/vconf_config.h include/dpl/wrt-dao-ro/widget_dao_read_only.h include/dpl/wrt-dao-ro/wrt_db_types.h include/dpl/wrt-dao-ro/WrtDatabase.h DESTINATION include/dpl-efl/dpl/wrt-dao-ro - ) + ) INSTALL(FILES include/dpl/wrt-dao-rw/feature_dao.h diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h index 2721214..87bf9d6 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h @@ -284,6 +284,37 @@ inline const char* GetTempInstallInfoPath() { return "/opt/share/widget/temp_info"; } + +inline const char* GetVconfKeyPrefixPath() +{ + return "file/private"; +} + +inline const char* GetVconfKeyPopupUsagePath() +{ + return "/popup_usage"; +} + +inline const char* GetVconfKeyGeolocationUsagePath() +{ + return "/geolocation_usage"; +} + +inline const char* GetVconfKeyWebNotificationUsagePath() +{ + return "/web_notification_usage"; +} + +inline const char* GetVconfKeyWebDatabaseUsagePath() +{ + return "/web_database_usage"; +} + +inline const char* GetVconfKeyFilesystemUsagePath() +{ + return "/filesystem_usage"; +} + } // namespace GlobalConfig } // namespace WrtDB diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h b/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h new file mode 100644 index 0000000..4a3c2cb --- /dev/null +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 vconf_config.h + * @author Jihoon Chung (jihoon.chung@samsung.com) + * @version 1.0 + * @brief Implementation file for vconf key config. + */ +#ifndef SRC_DOMAIN_VCONF_CONFIG_H +#define SRC_DOMAIN_VCONF_CONFIG_H + +#include +#include + +#include +#include + +namespace WrtDB { +namespace VconfConfig { +inline std::string GetVconfKeyRootPath(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .GetFullPath(); +} + +inline std::string GetVconfKeyPopupUsage(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .Concat(GlobalConfig::GetVconfKeyPopupUsagePath()) + .GetFullPath(); +} + +inline std::string GetVconfKeyGeolocationUsage(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .Concat(GlobalConfig::GetVconfKeyGeolocationUsagePath()) + .GetFullPath(); +} + +inline std::string GetVconfKeyWebNotificationUsage(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .Concat(GlobalConfig::GetVconfKeyWebNotificationUsagePath()) + .GetFullPath(); +} + +inline std::string GetVconfKeyWebDatabaseUsage(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .Concat(GlobalConfig::GetVconfKeyWebDatabaseUsagePath()) + .GetFullPath(); +} + +inline std::string GetVconfKeyFilesystemUsage(DPL::String pkgName) +{ + return PathBuilder() + .Append(GlobalConfig::GetVconfKeyPrefixPath()) + .Append(DPL::ToUTF8String(pkgName)) + .Concat(GlobalConfig::GetVconfKeyFilesystemUsagePath()) + .GetFullPath(); +} + +} // namespace VconfConfig +} // namespace WrtDB + +#endif