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 * This file have been implemented in compliance with W3C WARP SPEC.
18 * but there are some patent issue between W3C WARP SPEC and APPLE.
19 * so if you want to use this file, refer to the README file in root directory
22 * @file widget_data_types.h
23 * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
28 #ifndef WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_
29 #define WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_
34 #include <dpl/utils/warp_iri.h>
35 #include <dpl/utils/widget_version.h>
36 #include <dpl/optional_typedefs.h>
37 #include <dpl/wrt-dao-ro/common_dao_types.h>
39 // WidgetIcon, LanguageTagsList, OptionalWidgetStartFileInfo,
40 // WidgetStartFileInfo
41 #include <dpl/localization/localization_utils.h>
43 typedef std::list<WarpIRI> WarpIRIList;
46 * @brief Execution phase according to BONDI
48 * WidgetExecutionPhase_Unknown:
49 * Execution state is not defined
51 * WidgetExecutionPhase_WidgetInstall:
52 * Applies to access control queries made by a Widget User Agent during the
53 * processing of a Widget Resource as part of an installation or update
56 * WidgetExecutionPhase_WidgetInstantiate:
57 * Applies to access control queries made by a Widget User Agent during the
58 * instantiation of a Widget
60 * WidgetExecutionPhase_WebkitBind:
61 * Applies to access control queries made in response to a call to
62 * requestFeature() in the course of execution of a Website
64 * WidgetExecutionPhase_Invoke:
65 * Applies to access control queries made in response to invocation of a
66 * JavaScript API in the course of execution of a Web Application
68 //enum WidgetExecutionPhase
70 // WidgetExecutionPhase_Unknown = 0,
71 // WidgetExecutionPhase_WidgetInstall = 1 << 0,
72 // WidgetExecutionPhase_WidgetInstantiate = 1 << 1,
73 // WidgetExecutionPhase_WebkitBind = 1 << 2,
74 // WidgetExecutionPhase_Invoke = 1 << 3
79 class WidgetAccessList
84 WidgetAccessList(const WrtDB::WidgetAccessInfoList &widgetAccessInfoList);
86 bool getIsAccessAll() const;
88 const WarpIRIList* getWarpIRIList() const;
90 bool isRequiredIRI(const DPL::String &iri) const;
92 bool operator ==(const WidgetAccessList& other) const;
95 WarpIRIList m_warpIriList;
99 static const DPL::String SETTING_NAME_SCREEN_ORIENTATION =
100 L"screen-orientation";
101 static const DPL::String SETTING_NAME_INDICATOR_PRESENCE =
102 L"indicator-presence";
103 static const DPL::String SETTING_NAME_BACKBUTTON_PRESENCE =
104 L"backbutton-presence";
105 static const DPL::String SETTING_NAME_CONTEXT_MENU =
107 static const DPL::String SETTING_NAME_BACKGROUND_SUPPORT =
108 L"background-support";
109 static const DPL::String SETTING_NAME_USER_AGENT =
111 static const DPL::String SETTING_NAME_PROGRESSBAR_PRESENCE =
112 L"progressbar-presence";
113 static const DPL::String SETTING_NAME_HWKEY_EVENT =
115 static const DPL::String SETTING_VALUE_ENABLE =
117 static const DPL::String SETTING_VALUE_DISABLE =
119 static const DPL::String SETTING_NAME_ENCRYPTION =
121 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT =
123 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE =
125 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_AUTO_ROTATION =
127 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_ENALBE =
129 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_DISABLE =
131 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE =
133 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE =
135 static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE =
137 static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE =
139 static const DPL::String SETTING_VALUE_PROGRESSBAR_PRESENCE_ENABLE =
141 static const DPL::String SETTING_VALUE_PROGRESSBAR_PRESENCE_DISABLE =
143 static const DPL::String SETTING_VALUE_HWKEY_EVENT_ENABLE =
145 static const DPL::String SETTING_VALUE_HWKEY_EVENT_DISABLE =
148 enum WidgetSettingScreenLock
150 Screen_Portrait, /* Default */
155 enum WidgetSettingIndicatorPresence
157 Indicator_Enable, /* Default */
161 enum WidgetSettingBackButtonPresence
164 BackButton_Disable /* Default */
167 enum WidgetSettingContextMenu
169 ContextMenu_Enable, /* Default */
173 enum WidgetSettingEncryption
176 Encryption_Disable /* Default */
179 enum WidgetSettingBackgroundSupport
181 BackgroundSupport_Enable,
182 BackgroundSupport_Disable /* Default */
185 enum WidgetSettingProgressBarPresence
188 ProgressBar_Disable /* Default */
191 enum WidgetSettingHWkeyEventPresence
193 HWkeyEvent_Enable, /* Default */
197 class WidgetSettingList
202 WidgetSettingList(WrtDB::WidgetSettings &widgetSettings);
204 WidgetSettingScreenLock getRotationValue() const;
206 WidgetSettingIndicatorPresence getIndicatorPresence() const;
208 WidgetSettingBackButtonPresence getBackButtonPresence() const;
210 WidgetSettingContextMenu getContextMenu() const;
212 WidgetSettingEncryption getEncryption() const;
214 WidgetSettingBackgroundSupport getBackgroundSupport() const;
216 bool isEncrypted() const;
218 std::string getUserAgent() const;
220 WidgetSettingProgressBarPresence getProgressBarPresence() const;
222 WidgetSettingHWkeyEventPresence getHWkeyEvent() const;
224 bool operator ==(const WidgetSettingList& other) const;
227 WidgetSettingScreenLock m_RotationLock;
228 WidgetSettingIndicatorPresence m_IndicatorPresence;
229 WidgetSettingBackButtonPresence m_BackButtonPresence;
230 WidgetSettingContextMenu m_ContextMenu;
231 WidgetSettingEncryption m_Encryption;
232 WidgetSettingBackgroundSupport m_BackgroundSupport;
233 WidgetSettingProgressBarPresence m_ProgressbarPresence;
234 WidgetSettingHWkeyEventPresence m_HWkeyEvent;
235 std::string m_UserAgent;
237 typedef std::shared_ptr<WidgetSettingList> WidgetSettingListPtr;
239 namespace OrientationAngle {
242 const int PRIMARY = 0;
243 const int SECONDARY = 180;
244 } // namespace Portrait
245 namespace Landscape {
246 const int PRIMARY = 90;
247 const int SECONDARY = -90;
248 } // namespace Landscape
252 const int PRIMARY = 0;
253 const int SECONDARY = 180;
254 } // namespace Portrait
255 namespace Landscape {
256 const int PRIMARY = 270;
257 const int SECONDARY = 90;
258 } // namespace Landscape
259 const int UNLOCK = -1;
260 } // namespace Window
261 } // namespace OrientationAngle
263 #endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */