~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/xwt/Xwt/Xwt.Backends/IScrollAdjustmentBackend.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// 
 
2
// IScrollAdjustmentBackend.cs
 
3
//  
 
4
// Author:
 
5
//       Lluis Sanchez <lluis@xamarin.com>
 
6
// 
 
7
// Copyright (c) 2012 Xamarin Inc
 
8
// 
 
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:
 
15
// 
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
// 
 
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
 
25
// THE SOFTWARE.
 
26
using System;
 
27
 
 
28
namespace Xwt.Backends
 
29
{
 
30
        /// <summary>
 
31
        /// A backend for a scrollbar
 
32
        /// </summary>
 
33
        public interface IScrollAdjustmentBackend: IBackend
 
34
        {
 
35
                /// <summary>
 
36
                /// Called to initialize the backend
 
37
                /// </summary>
 
38
                /// <param name='eventSink'>
 
39
                /// The event sink to be used to report events
 
40
                /// </param>
 
41
                void Initialize (IScrollAdjustmentEventSink eventSink);
 
42
                
 
43
                /// <summary>
 
44
                /// Gets or sets the current position of the scrollbar.
 
45
                /// </summary>
 
46
                /// <value>
 
47
                /// The position
 
48
                /// </value>
 
49
                /// <remarks>
 
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).
 
53
                /// </remarks>
 
54
                double Value { get; set; }
 
55
                
 
56
                /// <summary>
 
57
                /// Gets or sets the lowest value of the scroll range.
 
58
                /// </summary>
 
59
                /// <value>
 
60
                /// The lower value.
 
61
                /// </value>
 
62
                /// <remarks>It must be <= UpperValue</remarks>
 
63
                double LowerValue { get; set; }
 
64
                
 
65
                /// <summary>
 
66
                /// Gets or sets the highest value of the scroll range
 
67
                /// </summary>
 
68
                /// <value>
 
69
                /// The upper value.
 
70
                /// </value>
 
71
                /// <remarks>It must be >= LowerValue</remarks>
 
72
                double UpperValue { get; set; }
 
73
                
 
74
                /// <summary>
 
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)
 
77
                /// </summary>
 
78
                /// <value>
 
79
                /// The page increment.
 
80
                /// </value>
 
81
                double PageIncrement { get; set; }
 
82
                
 
83
                /// <summary>
 
84
                /// How much the Value is incremented/decremented when you click on the down/up button in the scrollbar
 
85
                /// </summary>
 
86
                /// <value>
 
87
                /// The step increment.
 
88
                /// </value>
 
89
                double StepIncrement { get; set; }
 
90
                
 
91
                /// <summary>
 
92
                /// Size of the visible range
 
93
                /// </summary>
 
94
                /// <remarks>
 
95
                /// For example, if LowerValue=0, UpperValue=100, Value=25 and PageSize=50, the visible range will be 25 to 75
 
96
                /// </remarks>
 
97
                double PageSize { get; set; }
 
98
        }
 
99
 
 
100
        public interface IScrollAdjustmentEventSink
 
101
        {
 
102
                /// <summary>
 
103
                /// Raised when the position of the scrollbar changes
 
104
                /// </summary>
 
105
                void OnValueChanged ();
 
106
        }
 
107
        
 
108
        public enum ScrollAdjustmentEvent
 
109
        {
 
110
                ValueChanged
 
111
        }
 
112
}
 
113