2 * Copyright(c) 2019 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.
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Binding;
21 namespace Tizen.NUI.Components
24 /// InputFieldAttributes is a class which saves InputField's ux data.
26 /// <since_tizen> 6 </since_tizen>
27 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public class InputFieldStyle : ControlStyle
31 static InputFieldStyle() { }
34 /// Creates a new instance of a InputFieldAttributes.
36 /// <since_tizen> 6 </since_tizen>
37 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 public InputFieldStyle() : base()
41 BackgroundImageAttributes = new ImageViewStyle();
42 InputBoxAttributes = new TextFieldStyle();
46 /// Creates a new instance of a InputFieldStyle with Style.
48 /// <param name="attrs">Create InputFieldStyle by Style customized by user.</param>
49 /// <since_tizen> 6 </since_tizen>
50 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public InputFieldStyle(InputFieldStyle attrs) : base(attrs)
59 BackgroundImageAttributes = new ImageViewStyle();
60 InputBoxAttributes = new TextFieldStyle();
62 if (null != attrs.BackgroundImageAttributes)
64 BackgroundImageAttributes.CopyFrom(attrs.BackgroundImageAttributes);
66 if (null != attrs.InputBoxAttributes)
68 InputBoxAttributes.CopyFrom(attrs.InputBoxAttributes);
70 if (null != attrs.Space)
77 /// Gets or sets background image attributes of input field.
79 /// <since_tizen> 6 </since_tizen>
80 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public ImageViewStyle BackgroundImageAttributes { get; set; }
85 /// Gets or sets input box attributes of input field.
87 /// <since_tizen> 6 </since_tizen>
88 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
89 [EditorBrowsable(EditorBrowsableState.Never)]
90 public TextFieldStyle InputBoxAttributes { get; set; }
93 /// Gets or sets space.
95 /// <since_tizen> 6 </since_tizen>
96 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
97 [EditorBrowsable(EditorBrowsableState.Never)]
98 public int? Space { get; set; }
101 /// Attributes's clone function.
103 /// <since_tizen> 6 </since_tizen>
104 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public override void CopyFrom(BindableObject bindableObject)
108 InputFieldStyle inputFieldAttributes = bindableObject as InputFieldStyle;
110 if (null != inputFieldAttributes)
112 Space = inputFieldAttributes.Space;
114 if (null != inputFieldAttributes.BackgroundImageAttributes)
116 BackgroundImageAttributes.CopyFrom(inputFieldAttributes.BackgroundImageAttributes);
119 if (null != inputFieldAttributes.InputBoxAttributes)
121 InputBoxAttributes.CopyFrom(inputFieldAttributes.InputBoxAttributes);