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_
33 #include <dpl/utils/warp_iri.h>
34 #include <dpl/utils/widget_version.h>
35 #include <dpl/optional_typedefs.h>
36 #include <dpl/wrt-dao-ro/common_dao_types.h>
38 // WidgetIcon, LanguageTagsList, OptionalWidgetStartFileInfo,
39 // WidgetStartFileInfo
40 #include <dpl/localization/localization_utils.h>
42 typedef std::list<WarpIRI> WarpIRIList;
45 * @brief Execution phase according to BONDI
47 * WidgetExecutionPhase_Unknown:
48 * Execution state is not defined
50 * WidgetExecutionPhase_WidgetInstall:
51 * Applies to access control queries made by a Widget User Agent during the
52 * processing of a Widget Resource as part of an installation or update
55 * WidgetExecutionPhase_WidgetInstantiate:
56 * Applies to access control queries made by a Widget User Agent during the
57 * instantiation of a Widget
59 * WidgetExecutionPhase_WebkitBind:
60 * Applies to access control queries made in response to a call to
61 * requestFeature() in the course of execution of a Website
63 * WidgetExecutionPhase_Invoke:
64 * Applies to access control queries made in response to invocation of a
65 * JavaScript API in the course of execution of a Web Application
67 //enum WidgetExecutionPhase
69 // WidgetExecutionPhase_Unknown = 0,
70 // WidgetExecutionPhase_WidgetInstall = 1 << 0,
71 // WidgetExecutionPhase_WidgetInstantiate = 1 << 1,
72 // WidgetExecutionPhase_WebkitBind = 1 << 2,
73 // WidgetExecutionPhase_Invoke = 1 << 3
78 class WidgetAccessList
83 WidgetAccessList(const WrtDB::WidgetAccessInfoList &widgetAccessInfoList);
85 bool getIsAccessAll() const;
87 const WarpIRIList* getWarpIRIList() const;
89 bool isRequiredIRI(const DPL::String &iri) const;
91 bool operator ==(const WidgetAccessList& other) const;
94 WarpIRIList m_warpIriList;
98 static const DPL::String SETTING_NAME_SCREEN_ORIENTATION =
99 L"screen-orientation";
100 static const DPL::String SETTING_NAME_INDICATOR_PRESENCE =
101 L"indicator-presence";
102 static const DPL::String SETTING_NAME_BACKBUTTON_PRESENCE =
103 L"backbutton-presence";
104 #ifndef DEPRECATED_SETTING_STRING
105 static const DPL::String SETTING_NAME_CONTEXTMENU =
108 static const DPL::String SETTING_NAME_CONTEXT_MENU =
110 static const DPL::String SETTING_NAME_BACKGROUND_SUPPORT =
111 L"background-support";
112 static const DPL::String SETTING_NAME_USER_AGENT =
114 static const DPL::String SETTING_VALUE_ENABLE =
116 static const DPL::String SETTING_VALUE_DISABLE =
118 static const DPL::String SETTING_NAME_ENCRYPTION =
120 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT =
122 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE =
124 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_ENALBE =
126 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_DISABLE =
128 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE =
130 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE =
132 static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE =
134 static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE =
137 enum WidgetSettingScreenLock
139 Screen_Portrait, /* Default */
143 enum WidgetSettingIndicatorPresence
145 Indicator_Enable, /* Default */
149 enum WidgetSettingBackButtonPresence
152 BackButton_Disable /* Default */
155 enum WidgetSettingContextMenu
157 ContextMenu_Enable, /* Default */
161 enum WidgetSettingEncryption
164 Encryption_Disable /* Default */
167 enum WidgetSettingBackgroundSupport
169 BackgroundSupport_Enable,
170 BackgroundSupport_Disable /* Default */
173 class WidgetSettingList
178 WidgetSettingList(WidgetSettings &widgetSettings);
180 WidgetSettingScreenLock getRotationValue() const;
182 WidgetSettingIndicatorPresence getIndicatorPresence() const;
184 WidgetSettingBackButtonPresence getBackButtonPresence() const;
186 WidgetSettingContextMenu getContextMenu() const;
188 WidgetSettingEncryption getEncryption() const;
190 WidgetSettingBackgroundSupport getBackgroundSupport() const;
192 bool isEncrypted() const;
194 std::string getUserAgent() const;
196 bool operator ==(const WidgetSettingList& other) const;
199 WidgetSettingScreenLock m_RotationLock;
200 WidgetSettingIndicatorPresence m_IndicatorPresence;
201 WidgetSettingBackButtonPresence m_BackButtonPresence;
202 WidgetSettingContextMenu m_ContextMenu;
203 WidgetSettingEncryption m_Encryption;
204 WidgetSettingBackgroundSupport m_BackgroundSupport;
205 std::string m_UserAgent;
208 #endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */