[NFC][Non-ACR] Fix NFC Csharp TC failed issue (#1849)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / ScrollbarBase.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI.Components
20 {
21     /// <summary>
22     /// The ScrollbarBase is an abstract class that can be linked to the scrollable objects
23     /// indicating the current scrolled position of the scrollable object.
24     /// This only contains non-graphical functionalities of basic scrollbar.
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public abstract class ScrollbarBase : Control
28     {
29         private bool mScrollEnabled = true;
30
31         #region Constructors
32
33         /// <summary>
34         /// Create an empty ScrollbarBase.
35         /// </summary>
36         public ScrollbarBase() : base()
37         {
38         }
39
40         /// <summary>
41         /// Create an empty Scrollbar with a ControlStyle instance to set style properties.
42         /// </summary>
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public ScrollbarBase(ControlStyle style) : base(style)
45         {
46         }
47
48         /// <summary>
49         /// Static constructor to initialize bindable properties when loading.
50         /// </summary>
51         static ScrollbarBase()
52         {
53         }
54
55         #endregion Constructors
56
57
58         #region Methods
59
60         /// <summary>
61         /// Update content length and position at once.
62         /// </summary>
63         /// <param name="contentLength">The total length of the content.</param>
64         /// <param name="position">The destination position of the View in content length. This is the View's top position if the scroller is vertical, otherwise, View's left position.</param>
65         /// <param name="durationMs">The time it takes to scroll in milliseconds.</param>
66         /// <param name="alphaFunction">The timing function used in animation. It describes the rate of change of the animation parameter over time. (e.g. EaseOut)</param>
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         public abstract void Update(float contentLength, float position, uint durationMs = 0, AlphaFunction alphaFunction = null);
69
70         /// <summary>
71         /// Scroll content to a specific position.
72         /// </summary>
73         /// <param name="position">The destination to scroll.</param>
74         /// <param name="durationMs">The time it takes to scroll in milliseconds.</param>
75         /// <param name="alphaFunction">The timing function used in animation. It describes the rate of change of the animation parameter over time. (e.g. EaseOut)</param>
76         [EditorBrowsable(EditorBrowsableState.Never)]
77         public abstract void ScrollTo(float position, uint durationMs = 0, AlphaFunction alphaFunction = null);
78
79         /// <summary>
80         /// Initialize the scroll bar.
81         /// </summary>
82         /// <param name="contentLength">The length of the scrollable content area.</param>
83         /// <param name="viewportLength">The length of the viewport representing the amount of visible content.</param>
84         /// <param name="currentPosition">The current position of the viewport in scrollable content area. This is the viewport's top position if the scroller is vertical, otherwise, left.</param>
85         /// <param name="isHorizontal">Whether the direction of scrolling is horizontal or not. It is vertical by default.</param>
86         [EditorBrowsable(EditorBrowsableState.Never)]
87         public abstract void Initialize(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false);
88
89         /// <summary>
90         /// Enable or disable scrolling.
91         /// </summary>
92         [EditorBrowsable(EditorBrowsableState.Never)]
93         public abstract bool ScrollEnabled { get; set; }
94
95         #endregion Methods
96     }
97 }