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 * @file widget_model.h
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20 * @brief Header file for widget model
22 #ifndef SRC_DOMAIN_WIDGET_MODEL_H
23 #define SRC_DOMAIN_WIDGET_MODEL_H
28 #include <dpl/event/model.h>
29 #include <dpl/event/property.h>
30 #include <dpl/optional_typedefs.h>
31 #include <dpl/wrt-dao-ro/wrt_db_types.h> // definition of WidgetHandle
33 #include "widget_data_types.h"
38 * Widget model is the core object that hold information about
39 * properties of widget. After wrt launch each widget contained in database is
40 * mapped to WidgetModel.
42 * Widget model is a type of MVC model, so it is possible to listen for it's
46 class WidgetModel : public DPL::Event::Model
53 * ex> "TizenIDabc.appname"
55 * - TizenId / AppId : "TizenIDabc.appname"
56 * - TzPkgId : "TizenIDabc"
57 * - App name : "appname"
61 DPL::Event::Property<WrtDB::TizenPkgId,
62 DPL::Event::PropertyReadOnly,
63 DPL::Event::PropertyStorageDynamicCached> TzPkgId;
68 * Note: This is a readonly property
70 DPL::Event::Property<WrtDB::WidgetType,
71 DPL::Event::PropertyReadOnly,
72 DPL::Event::PropertyStorageDynamicCached> Type;
75 * @brief Config file based csp policy
77 DPL::Event::Property<DPL::OptionalString,
78 DPL::Event::PropertyReadOnly,
79 DPL::Event::PropertyStorageDynamicCached> CspPolicy;
82 * @brief Config file based csp policy - report only
84 DPL::Event::Property<DPL::OptionalString,
85 DPL::Event::PropertyReadOnly,
86 DPL::Event::PropertyStorageDynamicCached>
90 * @brief Start URL for widget
92 DPL::Event::Property<DPL::OptionalString> StartURL;
95 * @brief Start URL information for widget
97 DPL::Event::Property<OptionalWidgetStartFileInfo> StartFileInfo;
100 * @brief Prefix URL for widget
102 * This is a prefix address of html file that widget is displaying.
103 * The whole address is PrefixURL + StartURL.
105 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PrefixURL;
108 * @brief Install path for widget
110 * Gets path in which files of widget are being kept
112 DPL::Event::Property<DPL::String,
113 DPL::Event::PropertyReadOnly,
114 DPL::Event::PropertyStorageDynamicCached> InstallPath;
117 * @brief Path to widget's persistent storage.
119 * Gets path in which widget may store its persistent private data.
121 DPL::Event::Property<DPL::String> PersistentStoragePath;
124 * @brief Path to widget's temporary storage.
126 * Gets path in which widget may store its temporary private data.
128 DPL::Event::Property<DPL::String> TemporaryStoragePath;
131 * @brief Widget defaultlocale
133 DPL::Event::Property<DPL::OptionalString,
134 DPL::Event::PropertyReadOnly,
135 DPL::Event::PropertyStorageDynamicCached>
141 DPL::Event::Property<DPL::OptionalString> Name;
144 * @brief Widget short name
146 DPL::Event::Property<DPL::OptionalString> ShortName;
149 * @brief Widget description
151 DPL::Event::Property<DPL::OptionalString> Description;
154 * @brief Widget license
156 DPL::Event::Property<DPL::OptionalString> License;
159 * @brief Widget license href
161 DPL::Event::Property<DPL::OptionalString> LicenseHref;
166 DPL::Event::Property<OptionalWidgetIcon> Icon;
169 * @brief Widget splash image src
171 DPL::Event::Property<DPL::OptionalString,
172 DPL::Event::PropertyReadOnly,
173 DPL::Event::PropertyStorageDynamicCached> SplashImg;
176 * @brief Widget TizenRequired(minimum) Version
178 DPL::Event::Property<DPL::OptionalString,
179 DPL::Event::PropertyReadOnly,
180 DPL::Event::PropertyStorageDynamicCached> RequiredVersion;
185 DPL::Event::Property<WrtDB::WindowModeList,
186 DPL::Event::PropertyReadOnly,
187 DPL::Event::PropertyStorageDynamic> WindowModes;
190 // * @brief Value of network element.
192 // DPL::Event::Property<bool,
193 // DPL::Event::PropertyReadOnly> AccessNetwork;
196 // * @brief Does widget contain WARP definitions.
198 // DPL::Event::Property<bool> WarpDefinitionEmpty;
201 * @brief Is back supported
203 DPL::Event::Property<bool,
204 DPL::Event::PropertyReadOnly,
205 DPL::Event::PropertyStorageDynamicCached>
209 * @brief Widget access list
211 DPL::Event::Property<WidgetAccessList> AccessList;
213 DPL::Event::Property<WidgetSettingList> SettingList;
216 * @brief Widget app-control list
218 DPL::Event::Property<WrtDB::WidgetAppControlList> AppControlList;
221 * @brief Widget Privilege list
223 DPL::Event::Property<WrtDB::PrivilegeList,
224 DPL::Event::PropertyReadOnly,
225 DPL::Event::PropertyStorageDynamic> WidgetPrivilegeList;
227 DPL::Event::Property<WrtDB::WidgetSecurityModelVersion,
228 DPL::Event::PropertyReadOnly,
229 DPL::Event::PropertyStorageDynamicCached> SecurityModelVersion;
231 WidgetModel(const std::string &tizenId);
234 DPL::String getTizenId() const;
236 typedef std::shared_ptr<WidgetModel> WidgetModelPtr;
238 #endif // SRC_DOMAIN_WIDGET_MODEL_H