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 /// TabStyle is a class which saves Tab'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 TabStyle : ControlStyle
34 /// Creates a new instance of a TabStyle.
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 TabStyle() : base()
41 ItemPadding = new Extents(0, 0, 0, 0);
42 UseTextNaturalSize = false;
45 UnderLine = new ViewStyle();
46 Text = new TextLabelStyle();
50 /// Creates a new instance of a TabStyle with style.
52 /// <param name="style">Create TabStyle by style customized by user.</param>
53 /// <since_tizen> 6 </since_tizen>
54 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public TabStyle(TabStyle style) : base(style)
58 UnderLine = new ViewStyle();
59 Text = new TextLabelStyle();
66 if (style.UnderLine != null)
68 UnderLine.CopyFrom(style.UnderLine);
71 if (style.Text != null)
73 Text.CopyFrom(style.Text);
76 if (style.ItemPadding != null)
78 ItemPadding = new Extents(style.ItemPadding.Start, style.ItemPadding.End, style.ItemPadding.Top, style.ItemPadding.Bottom);
82 ItemPadding = new Extents(0, 0, 0, 0);
84 ItemSpace = style.ItemSpace;
85 UseTextNaturalSize = style.UseTextNaturalSize;
87 if (null != style.UnderLine)
89 UnderLine.CopyFrom(style.UnderLine);
92 if (null != style.Text)
94 Text.CopyFrom(style.Text);
99 /// UnderLine's attributes.
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 ViewStyle UnderLine { get; set; }
107 /// Text's attributes.
109 /// <since_tizen> 6 </since_tizen>
110 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
111 [EditorBrowsable(EditorBrowsableState.Never)]
112 public TextLabelStyle Text { get; set; }
115 /// Flag to decide if item is fill with item text's natural width.
117 /// <since_tizen> 6 </since_tizen>
118 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
119 [EditorBrowsable(EditorBrowsableState.Never)]
120 public bool UseTextNaturalSize { get; set; }
123 /// Gap between items.
125 /// <since_tizen> 6 </since_tizen>
126 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 public int ItemSpace { get; set; }
133 /// <since_tizen> 6 </since_tizen>
134 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
135 [EditorBrowsable(EditorBrowsableState.Never)]
136 public Extents ItemPadding { get; set; }
139 /// Attributes's clone function.
141 /// <since_tizen> 6 </since_tizen>
142 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
143 [EditorBrowsable(EditorBrowsableState.Never)]
144 public override void CopyFrom(BindableObject bindableObject)
146 base.CopyFrom(bindableObject);
147 TabStyle tabStyle = bindableObject as TabStyle;
149 if (null != tabStyle)
151 if (null != tabStyle.ItemPadding)
153 ItemPadding.CopyFrom(tabStyle.ItemPadding);
156 ItemSpace = tabStyle.ItemSpace;
157 UseTextNaturalSize = tabStyle.UseTextNaturalSize;
159 if (null != tabStyle.UnderLine)
161 UnderLine.CopyFrom(tabStyle.UnderLine);
164 if (null != tabStyle.Text)
166 Text.CopyFrom(tabStyle.Text);