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