Updated all cpp files to new format
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-settings.cpp
1 /*
2  * Copyright (c) 2021 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 WebSettings::WebSettings(Dali::WebEngineSettings& settings)
29 : mWebEngineSettings(settings)
30 {
31 }
32
33 WebSettings::~WebSettings()
34 {
35 }
36
37 void WebSettings::AllowMixedContents(bool allowed)
38 {
39   mWebEngineSettings.AllowMixedContents(allowed);
40 }
41
42 void WebSettings::EnableSpatialNavigation(bool enabled)
43 {
44   mWebEngineSettings.AllowMixedContents(enabled);
45 }
46
47 int WebSettings::GetDefaultFontSize() const
48 {
49   return mWebEngineSettings.GetDefaultFontSize();
50 }
51
52 void WebSettings::SetDefaultFontSize(int defaultFontSize)
53 {
54   mWebEngineSettings.SetDefaultFontSize(defaultFontSize);
55 }
56
57 void WebSettings::EnableWebSecurity(bool enabled)
58 {
59   mWebEngineSettings.EnableWebSecurity(enabled);
60 }
61
62 void WebSettings::AllowFileAccessFromExternalUrl(bool allowed)
63 {
64   mWebEngineSettings.AllowFileAccessFromExternalUrl(allowed);
65 }
66
67 bool WebSettings::IsJavaScriptEnabled() const
68 {
69   return mWebEngineSettings.IsJavaScriptEnabled();
70 }
71
72 void WebSettings::EnableJavaScript(bool enabled)
73 {
74   mWebEngineSettings.EnableJavaScript(enabled);
75 }
76
77 void WebSettings::AllowScriptsOpenWindows(bool allowed)
78 {
79   mWebEngineSettings.AllowScriptsOpenWindows(allowed);
80 }
81
82 bool WebSettings::AreImagesLoadedAutomatically() const
83 {
84   return mWebEngineSettings.AreImagesLoadedAutomatically();
85 }
86
87 void WebSettings::AllowImagesLoadAutomatically(bool automatic)
88 {
89   mWebEngineSettings.AllowImagesLoadAutomatically(automatic);
90 }
91
92 std::string WebSettings::GetDefaultTextEncodingName() const
93 {
94   return mWebEngineSettings.GetDefaultTextEncodingName();
95 }
96
97 void WebSettings::SetDefaultTextEncodingName(const std::string& defaultTextEncodingName)
98 {
99   mWebEngineSettings.SetDefaultTextEncodingName(defaultTextEncodingName);
100 }
101
102 } // namespace Toolkit
103
104 } // namespace Dali