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
25 #include <dpl/event/model.h>
26 #include <dpl/event/property.h>
27 #include <dpl/optional.h>
28 #include <dpl/optional_typedefs.h>
31 #include "widget_data_types.h"
33 #include <dpl/wrt-dao-ro/wrt_db_types.h> // definition of WidgetHandle
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 Current widget actual size
92 DPL::Event::Property<WidgetSize> ActualSize;
95 * @brief Current widget preferred size
97 DPL::Event::Property<WidgetSize,
98 DPL::Event::PropertyReadOnly,
99 DPL::Event::PropertyStorageDynamicCached>
103 * @brief Start URL for widget
105 DPL::Event::Property<DPL::OptionalString> StartURL;
108 * @brief Start URL information for widget
110 DPL::Event::Property<OptionalWidgetStartFileInfo> StartFileInfo;
113 * @brief Prefix URL for widget
115 * This is a prefix address of html file that widget is displaying.
116 * The whole address is PrefixURL + StartURL.
118 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PrefixURL;
121 * @brief Install path for widget
123 * Gets path in which files of widget are being kept
125 DPL::Event::Property<DPL::String,
126 DPL::Event::PropertyReadOnly,
127 DPL::Event::PropertyStorageDynamicCached> InstallPath;
130 * @brief Path to widget's persistent storage.
132 * Gets path in which widget may store its persistent private data.
134 DPL::Event::Property<DPL::String> PersistentStoragePath;
137 * @brief Path to widget's temporary storage.
139 * Gets path in which widget may store its temporary private data.
141 DPL::Event::Property<DPL::String> TemporaryStoragePath;
144 * @brief Widget defaultlocale
146 DPL::Event::Property<DPL::OptionalString,
147 DPL::Event::PropertyReadOnly,
148 DPL::Event::PropertyStorageDynamicCached>
154 DPL::Event::Property<DPL::OptionalString> Name;
157 * @brief Widget short name
159 DPL::Event::Property<DPL::OptionalString> ShortName;
162 * @brief Widget description
164 DPL::Event::Property<DPL::OptionalString> Description;
167 * @brief Widget license
169 DPL::Event::Property<DPL::OptionalString> License;
172 * @brief Widget license href
174 DPL::Event::Property<DPL::OptionalString> LicenseHref;
179 DPL::Event::Property<OptionalWidgetIcon> Icon;
182 * @brief Widget splash image src
184 DPL::Event::Property<DPL::OptionalString,
185 DPL::Event::PropertyReadOnly,
186 DPL::Event::PropertyStorageDynamicCached> SplashImg;
191 DPL::Event::Property<WrtDB::WindowModeList,
192 DPL::Event::PropertyReadOnly,
193 DPL::Event::PropertyStorageDynamic> WindowModes;
196 // * @brief Value of network element.
198 // DPL::Event::Property<bool,
199 // DPL::Event::PropertyReadOnly> AccessNetwork;
202 // * @brief Does widget contain WARP definitions.
204 // DPL::Event::Property<bool> WarpDefinitionEmpty;
207 * @brief Is back supported
209 DPL::Event::Property<bool,
210 DPL::Event::PropertyReadOnly,
211 DPL::Event::PropertyStorageDynamicCached>
215 * @brief Widget access list
217 DPL::Event::Property<WidgetAccessList> AccessList;
219 DPL::Event::Property<WidgetSettingList> SettingList;
222 * @brief Widget app-control list
224 DPL::Event::Property<WrtDB::WidgetAppControlList> AppControlList;
225 DPL::Event::Property<DPL::OptionalUInt> AppControlIndex;
227 DPL::Event::Property<WrtDB::WidgetSecurityModelVersion,
228 DPL::Event::PropertyReadOnly,
229 DPL::Event::PropertyStorageDynamicCached> SecurityModelVersion;
231 DPL::Event::Property<WrtDB::SettingsType,
232 DPL::Event::PropertyReadOnly,
233 DPL::Event::PropertyStorageDynamicCached> SecurePopupUsage;
234 DPL::Event::Property<WrtDB::SettingsType,
235 DPL::Event::PropertyReadOnly,
236 DPL::Event::PropertyStorageDynamicCached> GeolocationUsage;
237 DPL::Event::Property<WrtDB::SettingsType,
238 DPL::Event::PropertyReadOnly,
239 DPL::Event::PropertyStorageDynamicCached> WebNotificationUsage;
240 DPL::Event::Property<WrtDB::SettingsType,
241 DPL::Event::PropertyReadOnly,
242 DPL::Event::PropertyStorageDynamicCached> WebStorageUsage;
244 WidgetModel(const std::string &tizenId);
247 DPL::String getTizenId() const;
250 #endif // SRC_DOMAIN_WIDGET_MODEL_H