Merge "Make AccessibilityManager::SetCurrentFocusActor more usable" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-settings.h
1 #ifndef DALI_TOOLKIT_WEB_SETTINGS_H
2 #define DALI_TOOLKIT_WEB_SETTINGS_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/public-api/dali-toolkit-common.h>
26
27 namespace Dali
28 {
29 class WebEngineSettings;
30
31 namespace Toolkit
32 {
33 /**
34  * @addtogroup dali_toolkit_controls_web_view
35  * @{
36  */
37
38 /**
39  * @brief WebEngineSettings is a control for settings of WebView.
40  *
41  *
42  * For working WebEngineSettings, a WebView should be provided.
43  *
44  */
45 class DALI_TOOLKIT_API WebSettings
46 {
47 public:
48   /**
49    * @brief Creates a WebEngineSettings.
50    *
51    * @param[in] settings A settings of web engine.
52    */
53   WebSettings(Dali::WebEngineSettings& settings);
54
55   /**
56    * @brief Destructor.
57    */
58   virtual ~WebSettings() final;
59
60   /**
61    *@brief Allow running mixed contents or not.
62    *
63    * @param[in] allowed if true, allow to run mixed contents,
64    *      otherwise not allow
65    */
66   void AllowMixedContents(bool allowed);
67
68   /**
69    * @brief Enable the spatial navigation or not.
70    *
71    * @param[in] enabled if true, use spatial navigation,
72    *       otherwise to disable
73    */
74   void EnableSpatialNavigation(bool enabled);
75
76   /**
77    * @brief Returns the default font size in pixel. The default value is 16.
78    *
79    * @return The default font size
80    */
81   int GetDefaultFontSize() const;
82
83   /**
84    * @brief Sets the default font size in pixel. The default value is 16.
85    *
86    * @param[in] defaultFontSize A new default font size to set
87    */
88   void SetDefaultFontSize(int defaultFontSize);
89
90   /**
91    * @brief Enables/disables web security.
92    *
93    * @param[in] enabled if true, to enable the web security
94    *       otherwise to disable
95    */
96   void EnableWebSecurity(bool enabled);
97
98   /**
99    * @brief Enables/disables cache builder.
100    *
101    * @param[in] enabled if true, to enable the cache builder
102    *       otherwise to disable
103    */
104   void EnableCacheBuilder( bool enabled );
105
106   /**
107    * @brief Used/Unused uses scrollbar thumb focus notifications. The default is used.
108    *
109    * @param[in] used True if uses scrollbar thumb focus notifications, false otherwise
110    */
111   void UseScrollbarThumbFocusNotifications ( bool used );
112
113   /**
114    * @brief Enable/disables do not track executing.
115    *
116    * @param[in] enabled if true, to enable do not track
117    *        otherwise to disable
118    */
119   void EnableDoNotTrack( bool enabled );
120
121   /**
122    * @brief Allow/Disallow file access from external url
123    *
124    * @param[in] allowed if true, to allow file access from external url
125    *       otherwise to disallow
126    */
127   void AllowFileAccessFromExternalUrl(bool allowed);
128
129   /**
130    * @brief Returns whether JavaScript can be executable. The default is true.
131    *
132    * @return true if JavaScript executing is enabled, false otherwise
133    */
134   bool IsJavaScriptEnabled() const;
135
136   /**
137    * @brief Enables/disables JavaScript executing. The default is enabled.
138    *
139    * @param[in] enabled True if JavaScript executing is enabled, false otherwise
140    */
141   void EnableJavaScript(bool enabled);
142
143   /**
144    * @brief Returns whether auto fitting can be executable. The default is true.
145    *
146    * @return true if auto fitting executing is enabled, false otherwise
147    */
148   bool IsAutoFittingEnabled() const;
149
150    /**
151    * @brief Enables/disables auto fitting executing. The default is enabled.
152    *
153    * @param[in] enabled True if auto fitting executing is enabled, false otherwise
154    */
155   void EnableAutoFitting( bool enabled );
156
157   /**
158    * @brief Returns whether plugins can be executable. The default is true.
159    *
160    * @return true if plugins executing is enabled, false otherwise
161    */
162   bool ArePluginsEnabled() const;
163
164    /**
165    * @brief Enables/disables Plugins executing. The default is enabled.
166    *
167    * @param[in] enabled True if Plugins executing is enabled, false otherwise
168    */
169   void EnablePlugins( bool enabled );
170
171   /**
172    * @brief Returns whether private browsing can be executable. The default is true.
173    *
174    * @return true if private browsing executing is enabled, false otherwise
175    */
176   bool IsPrivateBrowsingEnabled() const;
177
178   /**
179    * @brief Enables/disables private browsing executing. The default is enabled.
180    *
181    * @param[in] enabled True if private browsing executing is enabled, false otherwise
182    */
183   void EnablePrivateBrowsing( bool enabled );
184
185   /**
186    * @brief Returns whether link magnifier can be executable. The default is true.
187    *
188    * @return true if link magnifier executing is enabled, false otherwise
189    */
190   bool IsLinkMagnifierEnabled() const;
191
192   /**
193    * @brief Enables/disables link magnifier executing. The default is enabled.
194    *
195    * @param[in] enabled True if link magnifier executing is enabled, false otherwise
196    */
197   void EnableLinkMagnifier( bool enabled );
198
199   /**
200    * @brief Returns whether uses keypad without user action can be executable. The default is true.
201    *
202    * @return true if keypad without user action executing is used, false otherwise
203    */
204   bool IsKeypadWithoutUserActionUsed() const;
205
206   /**
207    * @brief Uses/Unused keypad without user action executing. The default is used.
208    *
209    * @param[in] used True if keypad without user action executing is used, false otherwise
210    */
211   void UseKeypadWithoutUserAction( bool used );
212
213   /**
214    * @brief Returns whether autofill password form can be executable. The default is true.
215    *
216    * @return true if autofill password form executing is enabled, false otherwise
217    */
218   bool IsAutofillPasswordFormEnabled() const;
219
220   /**
221    * @brief Enables/disables autofill password form executing. The default is enabled.
222    *
223    * @param[in] enabled True if autofill password form executing is enabled, false otherwise
224    */
225   void EnableAutofillPasswordForm( bool enabled );
226
227   /**
228    * @brief Returns whether form candidate data can be executable. The default is true.
229    *
230    * @return true if form candidate data executing is enabled, false otherwise
231    */
232   bool IsFormCandidateDataEnabled() const;
233
234   /**
235    * @brief Enables/disables form candidate data executing. The default is enabled.
236    *
237    * @param[in] enabled True if form candidate data executing is enabled, false otherwise
238    */
239   void EnableFormCandidateData( bool enabled );
240
241   /**
242    * @brief Returns whether text selection can be executable. The default is true.
243    *
244    * @return true if text selection executing is enabled, false otherwise
245    */
246   bool IsTextSelectionEnabled() const;
247
248   /**
249    * brief Enables/disables text selection executing. The default is enabled.
250    *
251    * @param[in] enabled True if text selection executing is enabled, false otherwise
252    */
253   void EnableTextSelection( bool enabled );
254
255   /**
256    * @brief Returns whether text autosizing can be executable. The default is true.
257    *
258    * @return true if text autosizing executing is enabled, false otherwise
259    */
260   bool IsTextAutosizingEnabled() const;
261
262   /**
263    * @brief Enables/disables text autosizing executing. The default is enabled.
264    *
265    * @param[in] enabled True if text autosizing executing is enabled, false otherwise
266    */
267   void EnableTextAutosizing( bool enabled );
268
269   /**
270    * @brief Returns whether arrow scroll can be executable. The default is true.
271    *
272    * @return true if arrow scroll executing is enabled, false otherwise
273    */
274   bool IsArrowScrollEnabled() const;
275
276   /**
277    * @brief Enables/disables arrow scroll executing. The default is enabled.
278    *
279    * @param[in] enabled True if arrow scroll executing is enabled, false otherwise
280    */
281   void EnableArrowScroll( bool enabled );
282
283   /**
284    * @brief Returns whether clipboard can be executable. The default is true.
285    *
286    * @return true if clipboard executing is enabled, false otherwise
287    */
288   bool IsClipboardEnabled() const;
289
290   /**
291    * @brief Enables/disables clipboard executing. The default is enabled.
292    *
293    * @param[in] enabled True if clipboard is enabled, false otherwise
294    */
295   void EnableClipboard( bool enabled );
296
297   /**
298    * @brief Returns whether ime panel can be executable. The default is true.
299    *
300    * @return true if ime panel executing is enabled, false otherwise
301    */
302   bool IsImePanelEnabled() const;
303
304   /**
305    * @brief Enables/disables ime panel executing. The default is enabled.
306    *
307    * @param[in] enabled True if ime panel executing is enabled, false otherwise
308    */
309   void EnableImePanel( bool enabled );
310
311   /**
312    * @brief Allow if the scripts can open new windows.
313    *
314    * @param[in] allowed if true, the scripts can open new windows,
315    *       otherwise not
316    */
317   void AllowScriptsOpenWindows(bool allowed);
318
319   /**
320    * @brief Returns whether images can be loaded automatically. The default is true.
321    *
322    * @return true if images are loaded automatically, false otherwise
323    */
324   bool AreImagesLoadedAutomatically() const;
325
326   /**
327    * @brief Enables/disables auto loading of images. The default is enabled.
328    *
329    * @param[in] automatic True if images are loaded automatically, false otherwise
330    */
331   void AllowImagesLoadAutomatically(bool automatic);
332
333   /**
334    * @brief Gets the default text encoding name (e.g. UTF-8).
335    *
336    * @return The default text encoding name
337    */
338   std::string GetDefaultTextEncodingName() const;
339
340   /**
341    * @brief Sets the default text encoding name (e.g. UTF-8).
342    *
343    * @param[in] defaultTextEncodingName The default text encoding name
344    */
345   void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
346
347 private:
348   Dali::WebEngineSettings& mWebEngineSettings;
349 };
350
351 /**
352  * @}
353  */
354
355 } // namespace Toolkit
356
357 } // namespace Dali
358
359 #endif // DALI_TOOLKIT_WEB_SETTINGS_H