2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 * This file contains the declaration of widget dao class.
20 * @author Yang Jie (jie2.yang@samsung.com)
21 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22 * @author Pawel Sikorski (p.sikorski@samsung.com)
24 * @brief This file contains the declaration of widget dao
29 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
32 #include <dpl/exception.h>
33 #include <dpl/db/orm.h>
34 #include <dpl/wrt-dao-ro/config_parser_data.h>
35 #include <dpl/wrt-dao-rw/property_dao.h>
39 class WidgetDAO : public WidgetDAOReadOnly
42 typedef std::list<DPL::String> LanguageTagsList;
45 * This is a constructor.
47 * @param[in] widgetHandle application id of widget.
48 * @param[in] widgetGUID application guid of widget.
50 WidgetDAO(DbWidgetHandle widgetHandle);
51 WidgetDAO(DPL::OptionalString widgetGUID);
59 * This method registers the widget information to the DB when it is installed.
61 * @see WidgetRegisterInfo
62 * @see UnRegisterWidget()
63 * @param[in] pWidgetRegisterInfo Specified the widget's information needed to be registered.
64 * @return widget's app id issued by app manager; 0 represents a failure during register.
66 static DbWidgetHandle registerWidget(
67 const WidgetRegisterInfo &pWidgetRegisterInfo,
68 const IWacSecurity &wacSecurity,
69 const LanguageTagsList& languageTags);
72 * This method removes a widget's information from EmDB.
74 * @see RegisterWidget()
75 * @param[in] widgetHandle widget's app id
76 * @return true if succeed, false if fail.
78 static void unregisterWidget(DbWidgetHandle widgetHandle);
80 /* This method removes widget property
82 void removeProperty(const PropertyDAOReadOnly::WidgetPropertyKey &key);
84 /* This method sets widget property
86 void setProperty(const PropertyDAOReadOnly::WidgetPropertyKey &key,
87 const PropertyDAOReadOnly::WidgetPropertyValue &value,
88 bool readOnly = false);
92 void setPkgName(const DPL::OptionalString& pkgName);
95 //Methods used during widget registering
96 static DbWidgetHandle registerWidgetInfo(
97 const WidgetRegisterInfo ®Info,
98 const IWacSecurity &wacSecurity);
99 static void registerWidgetExtendedInfo(
100 DbWidgetHandle widgetHandle,
101 const WidgetRegisterInfo ®Info);
102 static void registerWidgetLocalizedInfo(
103 DbWidgetHandle widgetHandle,
104 const WidgetRegisterInfo ®Info);
105 static void registerWidgetUserAgentLocales(
106 DbWidgetHandle widgetHandle,
107 const WidgetRegisterInfo &rInf,
108 const LanguageTagsList& languageTags);
109 static void registerWidgetIcons(
110 DbWidgetHandle widgetHandle,
111 const WidgetRegisterInfo ®Info);
112 static void registerWidgetStartFile(
113 DbWidgetHandle widgetHandle,
114 const WidgetRegisterInfo ®Info);
115 static void registerWidgetPreferences(
116 DbWidgetHandle widgetHandle,
117 const WidgetRegisterInfo ®Info);
118 static void registerWidgetFeatures(
119 DbWidgetHandle widgetHandle,
120 const WidgetRegisterInfo ®Info);
121 static void registerWidgetWindowModes(
122 DbWidgetHandle widgetHandle,
123 const WidgetRegisterInfo ®Info);
124 static void registerWidgetWarpInfo(
125 DbWidgetHandle widgetHandle,
126 const WidgetRegisterInfo ®Info);
127 static void registerWidgetCertificates(
128 DbWidgetHandle widgetHandle,
129 const IWacSecurity &wacSecurity);
130 static void registerWidgetPowderData(
131 DbWidgetHandle widgetHandle,
132 const WidgetRegisterInfo ®Info);
133 static void registerLaunchCertificates(
134 DbWidgetHandle widgetHandle,
135 const CertificateChainList &list);
136 static void registerWidgetSettings(
137 DbWidgetHandle widgetHandle,
138 const WidgetRegisterInfo ®Info);
139 static void registerAppService(
140 DbWidgetHandle widgetHandle,
141 const WidgetRegisterInfo ®Info);
146 #endif // WIDGET_DAO_H