2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <tizen-web-engine-settings.h>
20 #include <ewk_settings.h>
21 #include <ewk_settings_product.h>
28 TizenWebEngineSettings::TizenWebEngineSettings( Ewk_Settings* settings )
29 : ewkSettings( settings )
33 TizenWebEngineSettings::~TizenWebEngineSettings()
37 void TizenWebEngineSettings::AllowMixedContents( bool allowed )
39 ewk_settings_mixed_contents_set( ewkSettings, allowed );
42 void TizenWebEngineSettings::EnableSpatialNavigation( bool enabled )
44 ewk_settings_spatial_navigation_enabled_set( ewkSettings, enabled );
47 uint32_t TizenWebEngineSettings::GetDefaultFontSize() const
49 return ewk_settings_default_font_size_get( ewkSettings );
52 void TizenWebEngineSettings::SetDefaultFontSize( uint32_t size )
54 ewk_settings_default_font_size_set( ewkSettings, size );
57 void TizenWebEngineSettings::EnableWebSecurity( bool enabled )
59 ewk_settings_web_security_enabled_set( ewkSettings, enabled );
62 void TizenWebEngineSettings::AllowFileAccessFromExternalUrl( bool allowed )
64 ewk_settings_allow_file_access_from_external_url_set( ewkSettings, allowed );
67 bool TizenWebEngineSettings::IsJavaScriptEnabled() const
69 return ewk_settings_javascript_enabled_get( ewkSettings );
72 void TizenWebEngineSettings::EnableJavaScript( bool enabled )
74 ewk_settings_javascript_enabled_set( ewkSettings, enabled );
77 void TizenWebEngineSettings::AllowScriptsOpenWindows( bool allowed )
79 ewk_settings_scripts_window_open_set( ewkSettings, allowed );
82 bool TizenWebEngineSettings::AreImagesLoadedAutomatically() const
84 return ewk_settings_loads_images_automatically_get( ewkSettings );
87 void TizenWebEngineSettings::AllowImagesLoadAutomatically( bool automatic )
89 ewk_settings_loads_images_automatically_set( ewkSettings, automatic );
92 std::string TizenWebEngineSettings::GetDefaultTextEncodingName() const
94 return std::string( ewk_settings_default_text_encoding_name_get( ewkSettings ) );
97 void TizenWebEngineSettings::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
99 ewk_settings_default_text_encoding_name_set( ewkSettings, defaultTextEncodingName.c_str() );
102 } // namespace Plugin