Implement some new ewk apis in web view.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-settings.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28
29 WebSettings::WebSettings( Dali::WebEngineSettings& settings )
30 : mWebEngineSettings( settings )
31 {
32 }
33
34 WebSettings::~WebSettings()
35 {
36 }
37
38 void WebSettings::AllowMixedContents( bool allowed )
39 {
40   mWebEngineSettings.AllowMixedContents( allowed );
41 }
42
43 void WebSettings::EnableSpatialNavigation( bool enabled )
44 {
45   mWebEngineSettings.AllowMixedContents( enabled );
46 }
47
48 int WebSettings::GetDefaultFontSize() const
49 {
50   return mWebEngineSettings.GetDefaultFontSize();
51 }
52
53 void WebSettings::SetDefaultFontSize( int defaultFontSize )
54 {
55   mWebEngineSettings.SetDefaultFontSize( defaultFontSize );
56 }
57
58 void WebSettings::EnableWebSecurity( bool enabled )
59 {
60   mWebEngineSettings.EnableWebSecurity( enabled );
61 }
62
63 void WebSettings::AllowFileAccessFromExternalUrl( bool allowed )
64 {
65   mWebEngineSettings.AllowFileAccessFromExternalUrl( allowed );
66 }
67
68 bool WebSettings::IsJavaScriptEnabled() const
69 {
70   return mWebEngineSettings.IsJavaScriptEnabled();
71 }
72
73 void WebSettings::EnableJavaScript( bool enabled )
74 {
75   mWebEngineSettings.EnableJavaScript( enabled );
76 }
77
78 void WebSettings::AllowScriptsOpenWindows( bool allowed )
79 {
80   mWebEngineSettings.AllowScriptsOpenWindows( allowed );
81 }
82
83 bool WebSettings::AreImagesLoadedAutomatically() const
84 {
85   return mWebEngineSettings.AreImagesLoadedAutomatically();
86 }
87
88 void WebSettings::AllowImagesLoadAutomatically( bool automatic )
89 {
90   mWebEngineSettings.AllowImagesLoadAutomatically( automatic );
91 }
92
93 std::string WebSettings::GetDefaultTextEncodingName() const
94 {
95   return mWebEngineSettings.GetDefaultTextEncodingName();
96 }
97
98 void WebSettings::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
99 {
100   mWebEngineSettings.SetDefaultTextEncodingName( defaultTextEncodingName );
101 }
102
103 } // namespace Toolkit
104
105 } // namespace Dali