d1d3cfc44666011c4c237019c206753cbb0b44bc
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-settings.h
1 #ifndef DALI_WEB_ENGINE_SETTINGS_H
2 #define DALI_WEB_ENGINE_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
23 namespace Dali
24 {
25 /**
26  * @brief A class WebEngineSettings for settings of web engine.
27  */
28 class WebEngineSettings
29 {
30 public:
31   /**
32    * @brief Constructor.
33    */
34   WebEngineSettings() = default;
35
36   /**
37    * @brief Destructor.
38    */
39   virtual ~WebEngineSettings() = default;
40
41   /**
42    *@brief Allow running mixed contents or not.
43    *
44    * @param[in] allowed if true, allow to run mixed contents,
45    *      otherwise not allow
46    */
47   virtual void AllowMixedContents(bool allowed) = 0;
48
49   /**
50    * @brief Enable the spatial navigation or not.
51    *
52    * @param[in] enabled if true, use spatial navigation,
53    *       otherwise to disable
54    */
55   virtual void EnableSpatialNavigation(bool enabled) = 0;
56
57   /**
58    * @brief Get the default font size.
59    *
60    * @return defaut font size.
61    */
62   virtual uint32_t GetDefaultFontSize() const = 0;
63
64   /**
65    * @brief Set the default font size.
66    *
67    * @param[in] size a new default font size to set
68    */
69   virtual void SetDefaultFontSize(uint32_t size) = 0;
70
71   /**
72    * @brief Enables/disables web security.
73    *
74    * @param[in] enabled if true, to enable the web security
75    *       otherwise to disable
76    */
77   virtual void EnableWebSecurity(bool enabled) = 0;
78
79   /**
80    * @brief Allow/Disallow file access from external url
81    *
82    * @param[in] allowed if true, to allow file access from external url
83    *       otherwise to disallow
84    */
85   virtual void AllowFileAccessFromExternalUrl(bool allowed) = 0;
86
87   /**
88    * @brief Check if javascript is enabled or not.
89    *
90    * @return true if enabled, false if disabled.
91    */
92   virtual bool IsJavaScriptEnabled() const = 0;
93
94   /**
95    * @brief Enable/Disable javascript
96    *
97    * @param[in] enabled if true, to enable javascript
98    *       otherwise to disable
99    */
100   virtual void EnableJavaScript(bool enabled) = 0;
101
102   /**
103    * @brief Allow if the scripts can open new windows.
104    *
105    * @param[in] allowed if true, the scripts can open new windows,
106    *       otherwise not
107    */
108   virtual void AllowScriptsOpenWindows(bool allowed) = 0;
109
110   /**
111    * @brief Check if images are loaded automatically or not.
112    *
113    * @return true if enabled, false if disabled.
114    */
115   virtual bool AreImagesLoadedAutomatically() const = 0;
116
117   /**
118    * @brief Allow to load images automatically
119    *
120    * @param[in] automatic if true, to load images automatically,
121    *       otherwise not
122    */
123   virtual void AllowImagesLoadAutomatically(bool automatic) = 0;
124
125   /**
126    * @brief Get the default encoding name.
127    *
128    * @return defaut encoding name.
129    */
130   virtual std::string GetDefaultTextEncodingName() const = 0;
131
132   /**
133    * @brief Set the default encoding name.
134    *
135    * @param[in] defaultTextEncodingName a default encoding name to set
136    */
137   virtual void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName) = 0;
138 };
139
140 } // namespace Dali
141
142 #endif // DALI_WEB_ENGINE_SETTINGS_H