5
// Lluis Sanchez <lluis@xamarin.com>
7
// Copyright (c) 2011 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
using System.Collections.Generic;
32
public interface IWidgetSurface
36
SizeRequestMode SizeRequestMode { get; }
39
/// Gets the preferred width of the widget (includes the margin)
42
/// The preferred width.
44
WidgetSize GetPreferredWidth ();
47
/// Gets the preferred height of the widget (includes the margin)
50
/// The preferred height.
52
WidgetSize GetPreferredHeight ();
55
/// Gets the preferred height for a given width (includes the margin). Called only when using HeightForWidth size request mode.
58
/// The preferred height
60
/// <param name='width'>
63
WidgetSize GetPreferredHeightForWidth (double width);
66
/// Gets the preferred width for a given height (includes the margin). Called only when using WidthForHeight size request mode.
69
/// The preferred width
71
/// <param name='height'>
75
WidgetSize GetPreferredWidthForHeight (double height);
77
object NativeWidget { get; }
78
IEnumerable<Widget> Children { get; }