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>
44 WidgetStandard_Unknown,
48 typedef std::list<WarpIRI> WarpIRIList;
51 * @brief Execution phase according to BONDI
53 * WidgetExecutionPhase_Unknown:
54 * Execution state is not defined
56 * WidgetExecutionPhase_WidgetInstall:
57 * Applies to access control queries made by a Widget User Agent during the
58 * processing of a Widget Resource as part of an installation or update
61 * WidgetExecutionPhase_WidgetInstantiate:
62 * Applies to access control queries made by a Widget User Agent during the
63 * instantiation of a Widget
65 * WidgetExecutionPhase_WebkitBind:
66 * Applies to access control queries made in response to a call to
67 * requestFeature() in the course of execution of a Website
69 * WidgetExecutionPhase_Invoke:
70 * Applies to access control queries made in response to invocation of a
71 * JavaScript API in the course of execution of a Web Application
73 //enum WidgetExecutionPhase
75 // WidgetExecutionPhase_Unknown = 0,
76 // WidgetExecutionPhase_WidgetInstall = 1 << 0,
77 // WidgetExecutionPhase_WidgetInstantiate = 1 << 1,
78 // WidgetExecutionPhase_WebkitBind = 1 << 2,
79 // WidgetExecutionPhase_Invoke = 1 << 3
83 * Widget version is optional
85 typedef DPL::Optional<WidgetVersion> OptionalWidgetVersion;
89 class WidgetAccessList
94 WidgetAccessList(const WrtDB::WidgetAccessInfoList &widgetAccessInfoList);
96 bool getIsAccessAll() const;
98 const WarpIRIList* getWarpIRIList() const;
100 bool isRequiredIRI(const DPL::String &iri) const;
102 bool operator ==(const WidgetAccessList& other) const;
105 WarpIRIList m_warpIriList;
109 struct WidgetStorageSize
111 WidgetStorageSize() :
112 applicationStorage(0),
116 WidgetStorageSize(size_t pApplicationStorage,
117 size_t pDataStorage) :
118 applicationStorage(pApplicationStorage),
119 dataStorage(pDataStorage)
122 size_t applicationStorage;
126 static const DPL::String SETTING_NAME_SCREEN_ORIENTATION =
127 L"screen-orientation";
128 static const DPL::String SETTING_NAME_INDICATOR_PRESENCE =
129 L"indicator-presence";
130 static const DPL::String SETTING_NAME_BACKBUTTON_PRESENCE =
131 L"backbutton-presence";
132 #ifndef DEPRECATED_SETTING_STRING
133 static const DPL::String SETTING_NAME_CONTEXTMENU =
136 static const DPL::String SETTING_NAME_CONTEXT_MENU =
138 static const DPL::String SETTING_NAME_BACKGROUND_SUPPORT =
139 L"background-support";
140 static const DPL::String SETTING_VALUE_ENABLE =
142 static const DPL::String SETTING_VALUE_DISABLE =
144 static const DPL::String SETTING_NAME_ENCRYPTION=
146 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT =
148 static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE =
150 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_ENALBE =
152 static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_DISABLE =
154 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE =
156 static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE =
158 static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE =
160 static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE =
163 enum WidgetSettingScreenLock
165 Screen_Portrait, /* Default */
169 enum WidgetSettingIndicatorPresence
171 Indicator_Enable, /* Default */
175 enum WidgetSettingBackButtonPresence
178 BackButton_Disable /* Default */
181 enum WidgetSettingContextMenu
183 ContextMenu_Enable, /* Default */
187 enum WidgetSettingEncryption
190 Encryption_Disable /* Default */
193 enum WidgetSettingBackgroundSupport
195 BackgroundSupport_Enable,
196 BackgroundSupport_Disable /* Default */
199 class WidgetSettingList
204 WidgetSettingList(WidgetSettings &widgetSettings);
206 WidgetSettingScreenLock getRotationValue() const;
208 WidgetSettingIndicatorPresence getIndicatorPresence() const;
210 WidgetSettingBackButtonPresence getBackButtonPresence() const;
212 WidgetSettingContextMenu getContextMenu() const;
214 WidgetSettingEncryption getEncryption() const;
216 WidgetSettingBackgroundSupport getBackgroundSupport() const;
218 bool isEncrypted() const;
220 bool operator ==(const WidgetSettingList& other) const;
223 WidgetSettingScreenLock m_RotationLock;
224 WidgetSettingIndicatorPresence m_IndicatorPresence;
225 WidgetSettingBackButtonPresence m_BackButtonPresence;
226 WidgetSettingContextMenu m_ContextMenu;
227 WidgetSettingEncryption m_Encryption;
228 WidgetSettingBackgroundSupport m_BackgroundSupport;
231 #endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */