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 /// ScrollBarStyle is a class which saves Scrollbar's ux data.
26 /// <since_tizen> 6 </since_tizen>
27 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public class ScrollBarStyle : ControlStyle
31 static ScrollBarStyle() { }
34 /// Creates a new instance of a ScrollBarStyle.
36 /// <since_tizen> 6 </since_tizen>
37 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 public ScrollBarStyle() : base()
42 Direction = ScrollBar.DirectionType.Horizontal;
46 /// Creates a new instance of a ScrollBarStyle with style.
48 /// <param name="style">Create ScrollBarStyle by style customized by user.</param>
49 /// <since_tizen> 6 </since_tizen>
50 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public ScrollBarStyle(ScrollBarStyle style) : base(style)
54 if (null == style) return;
62 /// Get or set track image style
64 /// <since_tizen> 6 </since_tizen>
65 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public ImageViewStyle Track
74 /// Get or set thumb image style
76 /// <since_tizen> 6 </since_tizen>
77 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public ImageViewStyle Thumb
86 /// Get or set direction type
88 /// <since_tizen> 6 </since_tizen>
89 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
90 [EditorBrowsable(EditorBrowsableState.Never)]
91 public ScrollBar.DirectionType? Direction
98 /// Get or set duration
100 /// <since_tizen> 6 </since_tizen>
101 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
102 [EditorBrowsable(EditorBrowsableState.Never)]
110 /// Attributes's clone function.
112 /// <since_tizen> 6 </since_tizen>
113 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public override void CopyFrom(BindableObject bindableObject)
117 base.CopyFrom(bindableObject);
119 ScrollBarStyle scrollBarStyle = bindableObject as ScrollBarStyle;
121 if (null != scrollBarStyle)
123 if (null != scrollBarStyle.Track)
125 Track.CopyFrom(scrollBarStyle.Track);
128 if (null != scrollBarStyle.Thumb)
130 Thumb.CopyFrom(scrollBarStyle.Thumb);
133 Direction = scrollBarStyle.Direction;
134 Duration = scrollBarStyle.Duration;
138 private void InitSubStyle()
140 Track = new ImageViewStyle()
142 PositionUsesPivotPoint = true,
143 ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
144 PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
145 WidthResizePolicy = ResizePolicyType.FillToParent,
146 HeightResizePolicy = ResizePolicyType.FillToParent
149 Thumb = new ImageViewStyle()
151 PositionUsesPivotPoint = true,
152 ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
153 PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
154 WidthResizePolicy = ResizePolicyType.Fixed,
155 HeightResizePolicy = ResizePolicyType.Fixed