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