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,
135 DPL::Event::PropertyReadOnly> PersistentStoragePath;
138 * @brief Path to widget's temporary storage.
140 * Gets path in which widget may store its temporary private data.
142 DPL::Event::Property<DPL::String,
143 DPL::Event::PropertyReadOnly> TemporaryStoragePath;
146 * @brief Widget defaultlocale
148 DPL::Event::Property<DPL::OptionalString,
149 DPL::Event::PropertyReadOnly,
150 DPL::Event::PropertyStorageDynamicCached>
156 DPL::Event::Property<DPL::OptionalString> Name;
159 * @brief Widget short name
161 DPL::Event::Property<DPL::OptionalString> ShortName;
164 * @brief Widget description
166 DPL::Event::Property<DPL::OptionalString> Description;
169 * @brief Widget license
171 DPL::Event::Property<DPL::OptionalString> License;
174 * @brief Widget license href
176 DPL::Event::Property<DPL::OptionalString> LicenseHref;
181 DPL::Event::Property<OptionalWidgetIcon> Icon;
184 * @brief Widget splash image src
186 DPL::Event::Property<DPL::OptionalString,
187 DPL::Event::PropertyReadOnly,
188 DPL::Event::PropertyStorageDynamicCached> SplashImg;
193 DPL::Event::Property<WrtDB::WindowModeList,
194 DPL::Event::PropertyReadOnly,
195 DPL::Event::PropertyStorageDynamic> WindowModes;
198 // * @brief Value of network element.
200 // DPL::Event::Property<bool,
201 // DPL::Event::PropertyReadOnly> AccessNetwork;
204 // * @brief Does widget contain WARP definitions.
206 // DPL::Event::Property<bool> WarpDefinitionEmpty;
209 * @brief Is back supported
211 DPL::Event::Property<bool,
212 DPL::Event::PropertyReadOnly,
213 DPL::Event::PropertyStorageDynamicCached>
217 * @brief Widget access list
219 DPL::Event::Property<WidgetAccessList> AccessList;
222 * @brief Is this DeveloperWidget
224 DPL::Event::Property<bool,
225 DPL::Event::PropertyReadOnly,
226 DPL::Event::PropertyStorageDynamicCached> IsTestWidget;
228 DPL::Event::Property<WidgetSettingList> SettingList;
231 * @brief Widget app-control list
233 DPL::Event::Property<WrtDB::WidgetAppControlList> AppControlList;
234 DPL::Event::Property<DPL::OptionalUInt> AppControlIndex;
236 WidgetModel(const std::string &tizenId);
239 // Custom read write delegates
240 static DPL::String getTimestamp();
242 DPL::String getTizenId() const;
245 #endif // SRC_DOMAIN_WIDGET_MODEL_H