[NUI] Change WebView property (#6097)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WebView / WebViewBindableProperty.cs
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 using System.ComponentModel;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI.BaseComponents
22 {
23     public partial class WebView
24     {
25         /// <summary>
26         /// CacheModelProperty
27         /// </summary>
28         [EditorBrowsable(EditorBrowsableState.Never)]
29         public static readonly BindableProperty CacheModelProperty = null;
30
31         internal static void SetInternalCacheModelProperty(BindableObject bindable, object oldValue, object newValue)
32         {
33             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
34             if (newValue != null)
35             {
36                 instance.InternalCacheModel = (Tizen.NUI.CacheModel)newValue;
37             }
38         }
39
40         internal static object GetInternalCacheModelProperty(BindableObject bindable)
41         {
42             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
43             return instance.InternalCacheModel;
44         }
45
46         /// <summary>
47         /// CookieAcceptPolicyProperty
48         /// </summary>
49         [EditorBrowsable(EditorBrowsableState.Never)]
50         public static readonly BindableProperty CookieAcceptPolicyProperty = null;
51
52         internal static void SetInternalCookieAcceptPolicyProperty(BindableObject bindable, object oldValue, object newValue)
53         {
54             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
55             if (newValue != null)
56             {
57                 instance.InternalCookieAcceptPolicy = (Tizen.NUI.CookieAcceptPolicy)newValue;
58             }
59         }
60
61         internal static object GetInternalCookieAcceptPolicyProperty(BindableObject bindable)
62         {
63             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
64             return instance.InternalCookieAcceptPolicy;
65         }
66
67         /// <summary>
68         /// EnableJavaScriptProperty
69         /// </summary>
70         [EditorBrowsable(EditorBrowsableState.Never)]
71         public static readonly BindableProperty EnableJavaScriptProperty = null;
72
73         internal static void SetInternalEnableJavaScriptProperty(BindableObject bindable, object oldValue, object newValue)
74         {
75             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
76             if (newValue != null)
77             {
78                 instance.InternalEnableJavaScript = (bool)newValue;
79             }
80         }
81
82         internal static object GetInternalEnableJavaScriptProperty(BindableObject bindable)
83         {
84             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
85             return instance.InternalEnableJavaScript;
86         }
87
88         /// <summary>
89         /// LoadImagesAutomaticallyProperty
90         /// </summary>
91         [EditorBrowsable(EditorBrowsableState.Never)]
92         public static readonly BindableProperty LoadImagesAutomaticallyProperty = null;
93
94         internal static void SetInternalLoadImagesAutomaticallyProperty(BindableObject bindable, object oldValue, object newValue)
95         {
96             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
97             if (newValue != null)
98             {
99                 instance.InternalLoadImagesAutomatically = (bool)newValue;
100             }
101         }
102
103         internal static object GetInternalLoadImagesAutomaticallyProperty(BindableObject bindable)
104         {
105             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
106             return instance.InternalLoadImagesAutomatically;
107         }
108
109         /// <summary>
110         /// DefaultTextEncodingNameProperty
111         /// </summary>
112         [EditorBrowsable(EditorBrowsableState.Never)]
113         public static readonly BindableProperty DefaultTextEncodingNameProperty = null;
114
115         internal static void SetInternalDefaultTextEncodingNameProperty(BindableObject bindable, object oldValue, object newValue)
116         {
117             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
118             if (newValue != null)
119             {
120                 instance.InternalDefaultTextEncodingName = (string)newValue;
121             }
122         }
123
124         internal static object GetInternalDefaultTextEncodingNameProperty(BindableObject bindable)
125         {
126             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
127             return instance.InternalDefaultTextEncodingName;
128         }
129
130         /// <summary>
131         /// DefaultFontSizeProperty
132         /// </summary>
133         [EditorBrowsable(EditorBrowsableState.Never)]
134         public static readonly BindableProperty DefaultFontSizeProperty = null;
135
136         internal static void SetInternalDefaultFontSizeProperty(BindableObject bindable, object oldValue, object newValue)
137         {
138             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
139             if (newValue != null)
140             {
141                 instance.InternalDefaultFontSize = (int)newValue;
142             }
143         }
144
145         internal static object GetInternalDefaultFontSizeProperty(BindableObject bindable)
146         {
147             var instance = (Tizen.NUI.BaseComponents.WebView)bindable;
148             return instance.InternalDefaultFontSize;
149         }
150     }
151 }