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
32 /// Creates a new instance of a ScrollBarStyle.
34 /// <since_tizen> 6 </since_tizen>
35 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public ScrollBarStyle() : base()
40 Direction = ScrollBar.DirectionType.Horizontal;
44 /// Creates a new instance of a ScrollBarStyle with style.
46 /// <param name="style">Create ScrollBarStyle by style customized by user.</param>
47 /// <since_tizen> 6 </since_tizen>
48 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public ScrollBarStyle(ScrollBarStyle style) : base(style)
52 if (null == style) return;
60 /// Get or set track image style
62 /// <since_tizen> 6 </since_tizen>
63 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
64 [EditorBrowsable(EditorBrowsableState.Never)]
65 public ImageViewStyle Track
72 /// Get or set thumb image style
74 /// <since_tizen> 6 </since_tizen>
75 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
76 [EditorBrowsable(EditorBrowsableState.Never)]
77 public ImageViewStyle Thumb
84 /// Get or set direction type
86 /// <since_tizen> 6 </since_tizen>
87 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
88 [EditorBrowsable(EditorBrowsableState.Never)]
89 public ScrollBar.DirectionType? Direction
96 /// Get or set duration
98 /// <since_tizen> 6 </since_tizen>
99 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
100 [EditorBrowsable(EditorBrowsableState.Never)]
108 /// Attributes's clone function.
110 /// <since_tizen> 6 </since_tizen>
111 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
112 [EditorBrowsable(EditorBrowsableState.Never)]
113 public override void CopyFrom(BindableObject bindableObject)
115 base.CopyFrom(bindableObject);
117 ScrollBarStyle scrollBarStyle = bindableObject as ScrollBarStyle;
119 if (null != scrollBarStyle)
121 if (null != scrollBarStyle.Track)
123 Track.CopyFrom(scrollBarStyle.Track);
126 if (null != scrollBarStyle.Thumb)
128 Thumb.CopyFrom(scrollBarStyle.Thumb);
131 Direction = scrollBarStyle.Direction;
132 Duration = scrollBarStyle.Duration;
136 private void InitSubStyle()
138 Track = new ImageViewStyle()
140 PositionUsesPivotPoint = true,
141 ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
142 PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
143 WidthResizePolicy = ResizePolicyType.FillToParent,
144 HeightResizePolicy = ResizePolicyType.FillToParent
147 Thumb = new ImageViewStyle()
149 PositionUsesPivotPoint = true,
150 ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
151 PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
152 WidthResizePolicy = ResizePolicyType.Fixed,
153 HeightResizePolicy = ResizePolicyType.Fixed