Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / property_dao_read_only.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  * property_dao_read_only.h
18  *
19  *  Created on: Nov 16, 2011
20  *      Author: Krzysztof Jackiewicz(k.jackiewicz@samsung.com)
21  */
22
23 #ifndef PROPERTY_DAO_READ_ONLY_H_
24 #define PROPERTY_DAO_READ_ONLY_H_
25
26 #include <list>
27 #include <dpl/string.h>
28 #include <dpl/exception.h>
29 #include <dpl/db/orm.h>
30 #include <dpl/wrt-dao-ro/common_dao_types.h>
31
32 namespace WrtDB {
33 namespace PropertyDAOReadOnly {
34
35 typedef DPL::String WidgetPropertyKey;
36 typedef DPL::OptionalString WidgetPropertyValue;
37
38 typedef std::list<WidgetPropertyKey> WidgetPropertyKeyList;
39
40 struct WidgetPreferenceRow {
41     WidgetPkgName       pkgname;
42     WidgetPropertyKey   key_name;
43     WidgetPropertyValue key_value;
44     DPL::OptionalInt    readonly;
45 };
46
47 typedef std::list<WidgetPreferenceRow> WidgetPreferenceList;
48
49 /**
50  * PropertyDAO Exception classes
51  */
52 class Exception
53 {
54   public:
55     DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
56     DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
57     DECLARE_EXCEPTION_TYPE(Base, ReadOnlyProperty)
58 };
59
60 //deprecated
61 /* This method checks read only flag for given property
62  */
63 DPL::OptionalInt CheckPropertyReadFlag(DbWidgetHandle widgetHandle,
64                                   const WidgetPropertyKey &key)
65                                         __attribute__((deprecated));
66
67 /* This method checks read only flag for given property
68  */
69 DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName,
70                                   const WidgetPropertyKey &key);
71
72 //deprecated
73 /* This method gets widget property key list
74  */
75 WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle)
76                             __attribute__((deprecated));
77
78 /* This method gets widget property key list
79  */
80 WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName);
81
82 //deprecated
83 /* This method gets widget property list
84  */
85 WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle)
86                             __attribute__((deprecated));
87
88 /* This method gets widget property list
89  */
90 WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName);
91
92 //deprecated
93 /* This method get widget property value
94  */
95 WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle,
96                                      const WidgetPropertyKey &key);
97
98 /* This method get widget property value
99  */
100 WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName,
101                                      const WidgetPropertyKey &key);
102
103 } // PropertyDAOReadOnly
104 } // namespace WrtDB
105
106 #endif /* PROPERTY_DAO_READ_ONLY_H_ */