2
// IScrollAdjustmentBackend.cs
5
// Lluis Sanchez <lluis@xamarin.com>
7
// Copyright (c) 2012 Xamarin Inc
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
namespace Xwt.Backends
31
/// A backend for a scrollbar
33
public interface IScrollAdjustmentBackend: IBackend
36
/// Called to initialize the backend
38
/// <param name='eventSink'>
39
/// The event sink to be used to report events
41
void Initialize (IScrollAdjustmentEventSink eventSink);
44
/// Gets or sets the current position of the scrollbar.
50
/// Value is the position of top coordinate of the visible rect (or left for horizontal scrollbars).
51
/// So for example, if you set Value=35 and PageSize=100, the visible range will be 35 to 135.
52
/// Value must be >= LowerValue and <= (UpperValue - PageSize).
54
double Value { get; set; }
57
/// Gets or sets the lowest value of the scroll range.
62
/// <remarks>It must be <= UpperValue</remarks>
63
double LowerValue { get; set; }
66
/// Gets or sets the highest value of the scroll range
71
/// <remarks>It must be >= LowerValue</remarks>
72
double UpperValue { get; set; }
75
/// How much Value will be incremented when you click on the scrollbar to move
76
/// to the next page (when the scrollbar supports it)
79
/// The page increment.
81
double PageIncrement { get; set; }
84
/// How much the Value is incremented/decremented when you click on the down/up button in the scrollbar
87
/// The step increment.
89
double StepIncrement { get; set; }
92
/// Size of the visible range
95
/// For example, if LowerValue=0, UpperValue=100, Value=25 and PageSize=50, the visible range will be 25 to 75
97
double PageSize { get; set; }
100
public interface IScrollAdjustmentEventSink
103
/// Raised when the position of the scrollbar changes
105
void OnValueChanged ();
108
public enum ScrollAdjustmentEvent