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 Current widget actual size
76 DPL::Event::Property<WidgetSize> ActualSize;
79 * @brief Current widget preferred size
81 DPL::Event::Property<WidgetSize,
82 DPL::Event::PropertyReadOnly,
83 DPL::Event::PropertyStorageDynamicCached> PreferredSize;
86 * @brief Start URL for widget
88 DPL::Event::Property<DPL::OptionalString> StartURL;
91 * @brief Start URL information for widget
93 DPL::Event::Property<OptionalWidgetStartFileInfo> StartFileInfo;
96 * @brief Prefix URL for widget
98 * This is a prefix address of html file that widget is displaying.
99 * The whole address is PrefixURL + StartURL.
101 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PrefixURL;
104 * @brief Install path for widget
106 * Gets path in which files of widget are being kept
108 DPL::Event::Property<DPL::String,
109 DPL::Event::PropertyReadOnly,
110 DPL::Event::PropertyStorageDynamicCached> InstallPath;
113 * @brief Path to widget's persistent storage.
115 * Gets path in which widget may store its persistent private data.
117 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PersistentStoragePath;
120 * @brief Path to widget's temporary storage.
122 * Gets path in which widget may store its temporary private data.
124 DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> TemporaryStoragePath;
127 * @brief Widget defaultlocale
129 DPL::Event::Property<DPL::OptionalString,
130 DPL::Event::PropertyReadOnly,
131 DPL::Event::PropertyStorageDynamicCached> defaultlocale;
136 DPL::Event::Property<DPL::OptionalString> Name;
139 * @brief Widget short name
141 DPL::Event::Property<DPL::OptionalString> ShortName;
144 * @brief Widget description
146 DPL::Event::Property<DPL::OptionalString> Description;
149 * @brief Widget license
151 DPL::Event::Property<DPL::OptionalString> License;
154 * @brief Widget license href
156 DPL::Event::Property<DPL::OptionalString> LicenseHref;
161 DPL::Event::Property<OptionalWidgetIcon> Icon;
164 * @brief Widget splash image src
166 DPL::Event::Property<DPL::OptionalString,
167 DPL::Event::PropertyReadOnly,
168 DPL::Event::PropertyStorageDynamicCached> SplashImg;
173 DPL::Event::Property<WrtDB::WindowModeList,
174 DPL::Event::PropertyReadOnly,
175 DPL::Event::PropertyStorageDynamic> WindowModes;
178 // * @brief Value of network element.
180 // DPL::Event::Property<bool,
181 // DPL::Event::PropertyReadOnly> AccessNetwork;
184 // * @brief Does widget contain WARP definitions.
186 // DPL::Event::Property<bool> WarpDefinitionEmpty;
189 * @brief Is back supported
191 DPL::Event::Property<bool,
192 DPL::Event::PropertyReadOnly,
193 DPL::Event::PropertyStorageDynamicCached> BackSupported;
196 * @brief Widget access list
198 DPL::Event::Property<WidgetAccessList> AccessList;
201 * @brief Is this DeveloperWidget
203 DPL::Event::Property<bool,
204 DPL::Event::PropertyReadOnly,
205 DPL::Event::PropertyStorageDynamicCached> IsTestWidget;
208 DPL::Event::Property<WidgetSettingList> SettingList;
211 * @brief Widget Application Service list
213 DPL::Event::Property<WidgetApplicationServiceList> AppServiceList;
215 WidgetModel(const std::string &tizenId);
218 // Custom read write delegates
219 static DPL::String getTimestamp();
221 DPL::String getTizenId() const;
224 #endif // SRC_DOMAIN_WIDGET_MODEL_H