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
32 /// Creates a new instance of a InputFieldAttributes.
34 /// <since_tizen> 6 </since_tizen>
35 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public InputFieldStyle() : base()
39 BackgroundImageAttributes = new ImageViewStyle();
40 InputBoxAttributes = new TextFieldStyle();
44 /// Creates a new instance of a InputFieldStyle with Style.
46 /// <param name="attrs">Create InputFieldStyle by Style customized by user.</param>
47 /// <since_tizen> 6 </since_tizen>
48 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public InputFieldStyle(InputFieldStyle attrs) : base(attrs)
57 BackgroundImageAttributes = new ImageViewStyle();
58 InputBoxAttributes = new TextFieldStyle();
60 if (null != attrs.BackgroundImageAttributes)
62 BackgroundImageAttributes.CopyFrom(attrs.BackgroundImageAttributes);
64 if (null != attrs.InputBoxAttributes)
66 InputBoxAttributes.CopyFrom(attrs.InputBoxAttributes);
68 if (null != attrs.Space)
75 /// Gets or sets background image attributes of input field.
77 /// <since_tizen> 6 </since_tizen>
78 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
79 [EditorBrowsable(EditorBrowsableState.Never)]
80 public ImageViewStyle BackgroundImageAttributes { get; set; }
83 /// Gets or sets input box attributes of input field.
85 /// <since_tizen> 6 </since_tizen>
86 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public TextFieldStyle InputBoxAttributes { get; set; }
91 /// Gets or sets space.
93 /// <since_tizen> 6 </since_tizen>
94 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public int? Space { get; set; }
99 /// Attributes's clone function.
101 /// <since_tizen> 6 </since_tizen>
102 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
103 [EditorBrowsable(EditorBrowsableState.Never)]
104 public override void CopyFrom(BindableObject bindableObject)
106 InputFieldStyle inputFieldAttributes = bindableObject as InputFieldStyle;
108 if (null != inputFieldAttributes)
110 Space = inputFieldAttributes.Space;
112 if (null != inputFieldAttributes.BackgroundImageAttributes)
114 BackgroundImageAttributes.CopyFrom(inputFieldAttributes.BackgroundImageAttributes);
117 if (null != inputFieldAttributes.InputBoxAttributes)
119 InputBoxAttributes.CopyFrom(inputFieldAttributes.InputBoxAttributes);