Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / vconf_config.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file    vconf_config.h
18  * @author  Jihoon Chung (jihoon.chung@samsung.com)
19  * @version 1.0
20  * @brief   Implementation file for vconf key config.
21  */
22 #ifndef SRC_DOMAIN_VCONF_CONFIG_H
23 #define SRC_DOMAIN_VCONF_CONFIG_H
24
25 #include <string>
26 #include <dpl/string.h>
27
28 #include <dpl/wrt-dao-ro/global_config.h>
29 #include <dpl/wrt-dao-ro/path_builder.h>
30
31 namespace WrtDB {
32 namespace VconfConfig {
33 inline std::string GetVconfKeyRootPath(DPL::String pkgName)
34 {
35     return PathBuilder()
36                .Append(GlobalConfig::GetVconfKeyPrefixPath())
37                .Append(DPL::ToUTF8String(pkgName))
38                .GetFullPath();
39 }
40
41 inline std::string GetVconfKeyPopupUsage(DPL::String pkgName)
42 {
43     return PathBuilder()
44                .Append(GlobalConfig::GetVconfKeyPrefixPath())
45                .Append(DPL::ToUTF8String(pkgName))
46                .Concat(GlobalConfig::GetVconfKeyPopupUsagePath())
47                .GetFullPath();
48 }
49
50 inline std::string GetVconfKeyGeolocationUsage(DPL::String pkgName)
51 {
52     return PathBuilder()
53                .Append(GlobalConfig::GetVconfKeyPrefixPath())
54                .Append(DPL::ToUTF8String(pkgName))
55                .Concat(GlobalConfig::GetVconfKeyGeolocationUsagePath())
56                .GetFullPath();
57 }
58
59 inline std::string GetVconfKeyWebNotificationUsage(DPL::String pkgName)
60 {
61     return PathBuilder()
62                .Append(GlobalConfig::GetVconfKeyPrefixPath())
63                .Append(DPL::ToUTF8String(pkgName))
64                .Concat(GlobalConfig::GetVconfKeyWebNotificationUsagePath())
65                .GetFullPath();
66 }
67
68 inline std::string GetVconfKeyWebDatabaseUsage(DPL::String pkgName)
69 {
70     return PathBuilder()
71                .Append(GlobalConfig::GetVconfKeyPrefixPath())
72                .Append(DPL::ToUTF8String(pkgName))
73                .Concat(GlobalConfig::GetVconfKeyWebDatabaseUsagePath())
74                .GetFullPath();
75 }
76
77 inline std::string GetVconfKeyFilesystemUsage(DPL::String pkgName)
78 {
79     return PathBuilder()
80                .Append(GlobalConfig::GetVconfKeyPrefixPath())
81                .Append(DPL::ToUTF8String(pkgName))
82                .Concat(GlobalConfig::GetVconfKeyFilesystemUsagePath())
83                .GetFullPath();
84 }
85
86 inline std::string GetVconfKeyMemorySavingMode(DPL::String pkgName)
87 {
88     return PathBuilder()
89                .Append(GlobalConfig::GetVconfKeyPrefixPath())
90                .Append(DPL::ToUTF8String(pkgName))
91                .Concat(GlobalConfig::GetVconfKeyMemorySavingModePath())
92                .GetFullPath();
93 }
94
95 } // namespace VconfConfig
96 } // namespace WrtDB
97
98 #endif