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>
30 #include "widget_data_types.h"
32 #include <dpl/wrt-dao-ro/wrt_db_types.h> // definition of WidgetHandle
37 * Widget model is the core object that hold information about
38 * properties of widget. After wrt launch each widget contained in database is
39 * mapped to WidgetModel.
41 * Widget model is a type of MVC model, so it is possible to listen for it's
45 class WidgetModel : public DPL::Event::Model
52 * ex> "TizenIDabc.appname"
54 * - TizenId / AppId : "TizenIDabc.appname"
55 * - TzPkgId : "TizenIDabc"
56 * - App name : "appname"
60 DPL::Event::Property<WrtDB::TizenPkgId,
61 DPL::Event::PropertyReadOnly,
62 DPL::Event::PropertyStorageDynamicCached> TzPkgId;
67 * Note: This is a readonly property
69 DPL::Event::Property<WrtDB::WidgetType,
70 DPL::Event::PropertyReadOnly,
71 DPL::Event::PropertyStorageDynamicCached> Type;
74 * @brief Config file based csp policy
76 DPL::Event::Property<DPL::OptionalString,
77 DPL::Event::PropertyReadOnly,
78 DPL::Event::PropertyStorageDynamicCached> CspPolicy;
81 * @brief Current widget actual size
83 DPL::Event::Property<WidgetSize> ActualSize;
86 * @brief Current widget preferred size
88 DPL::Event::Property<WidgetSize,
89 DPL::Event::PropertyReadOnly,
90 DPL::Event::PropertyStorageDynamicCached>
94 * @brief Start URL for widget
96 DPL::Event::Property<DPL::OptionalString> StartURL;
99 * @brief Start URL information for widget
101 DPL::Event::Property<OptionalWidgetStartFileInfo> StartFileInfo;
104 * @brief Prefix URL for widget
106 * This is a prefix address of html file that widget is displaying.
107 * The whole address is PrefixURL + StartURL.
109 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PrefixURL;
112 * @brief Install path for widget
114 * Gets path in which files of widget are being kept
116 DPL::Event::Property<DPL::String,
117 DPL::Event::PropertyReadOnly,
118 DPL::Event::PropertyStorageDynamicCached> InstallPath;
121 * @brief Path to widget's persistent storage.
123 * Gets path in which widget may store its persistent private data.
125 DPL::Event::Property<DPL::String,
126 DPL::Event::PropertyReadOnly> PersistentStoragePath;
129 * @brief Path to widget's temporary storage.
131 * Gets path in which widget may store its temporary private data.
133 DPL::Event::Property<DPL::String,
134 DPL::Event::PropertyReadOnly> TemporaryStoragePath;
137 * @brief Widget defaultlocale
139 DPL::Event::Property<DPL::OptionalString,
140 DPL::Event::PropertyReadOnly,
141 DPL::Event::PropertyStorageDynamicCached>
147 DPL::Event::Property<DPL::OptionalString> Name;
150 * @brief Widget short name
152 DPL::Event::Property<DPL::OptionalString> ShortName;
155 * @brief Widget description
157 DPL::Event::Property<DPL::OptionalString> Description;
160 * @brief Widget license
162 DPL::Event::Property<DPL::OptionalString> License;
165 * @brief Widget license href
167 DPL::Event::Property<DPL::OptionalString> LicenseHref;
172 DPL::Event::Property<OptionalWidgetIcon> Icon;
175 * @brief Widget splash image src
177 DPL::Event::Property<DPL::OptionalString,
178 DPL::Event::PropertyReadOnly,
179 DPL::Event::PropertyStorageDynamicCached> SplashImg;
184 DPL::Event::Property<WrtDB::WindowModeList,
185 DPL::Event::PropertyReadOnly,
186 DPL::Event::PropertyStorageDynamic> WindowModes;
189 // * @brief Value of network element.
191 // DPL::Event::Property<bool,
192 // DPL::Event::PropertyReadOnly> AccessNetwork;
195 // * @brief Does widget contain WARP definitions.
197 // DPL::Event::Property<bool> WarpDefinitionEmpty;
200 * @brief Is back supported
202 DPL::Event::Property<bool,
203 DPL::Event::PropertyReadOnly,
204 DPL::Event::PropertyStorageDynamicCached>
208 * @brief Widget access list
210 DPL::Event::Property<WidgetAccessList> AccessList;
213 * @brief Is this DeveloperWidget
215 DPL::Event::Property<bool,
216 DPL::Event::PropertyReadOnly,
217 DPL::Event::PropertyStorageDynamicCached> IsTestWidget;
219 DPL::Event::Property<WidgetSettingList> SettingList;
222 * @brief Widget Application Service list
224 DPL::Event::Property<WidgetApplicationServiceList> AppServiceList;
226 WidgetModel(const std::string &tizenId);
229 // Custom read write delegates
230 static DPL::String getTimestamp();
232 DPL::String getTizenId() const;
235 #endif // SRC_DOMAIN_WIDGET_MODEL_H