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);
94 /* This function will update of api-feature status.
95 * If status is true (feature rejected) plugin connected with this
96 * api feature mustn't be loaded durign widget launch.
98 void updateFeatureRejectStatus(const DbWidgetFeature &widgetFeature);
101 //Methods used during widget registering
102 static DbWidgetHandle registerWidgetInfo(
103 const WidgetRegisterInfo ®Info,
104 const IWacSecurity &wacSecurity);
105 static void registerWidgetExtendedInfo(
106 DbWidgetHandle widgetHandle,
107 const WidgetRegisterInfo ®Info);
108 static void registerWidgetLocalizedInfo(
109 DbWidgetHandle widgetHandle,
110 const WidgetRegisterInfo ®Info);
111 static void registerWidgetUserAgentLocales(
112 DbWidgetHandle widgetHandle,
113 const WidgetRegisterInfo &rInf,
114 const LanguageTagsList& languageTags);
115 static void registerWidgetIcons(
116 DbWidgetHandle widgetHandle,
117 const WidgetRegisterInfo ®Info);
118 static void registerWidgetStartFile(
119 DbWidgetHandle widgetHandle,
120 const WidgetRegisterInfo ®Info);
121 static void registerWidgetPreferences(
122 DbWidgetHandle widgetHandle,
123 const WidgetRegisterInfo ®Info);
124 static void registerWidgetFeatures(
125 DbWidgetHandle widgetHandle,
126 const WidgetRegisterInfo ®Info);
127 static void registerWidgetWindowModes(
128 DbWidgetHandle widgetHandle,
129 const WidgetRegisterInfo ®Info);
130 static void registerWidgetWarpInfo(
131 DbWidgetHandle widgetHandle,
132 const WidgetRegisterInfo ®Info);
133 static void registerWidgetCertificates(
134 DbWidgetHandle widgetHandle,
135 const IWacSecurity &wacSecurity);
136 static void registerLaunchCertificates(
137 DbWidgetHandle widgetHandle,
138 const CertificateChainList &list);
139 static void registerWidgetSettings(
140 DbWidgetHandle widgetHandle,
141 const WidgetRegisterInfo ®Info);
142 static void registerAppService(
143 DbWidgetHandle widgetHandle,
144 const WidgetRegisterInfo ®Info);
149 #endif // WIDGET_DAO_H