using Avalonia.Metadata;
using Avalonia.VisualTree;
namespace Avalonia.Layout
{
///
/// Defines layout-related functionality for a control.
///
[NotClientImplementable]
public interface ILayoutable : IVisual
{
///
/// Gets the size that this element computed during the measure pass of the layout process.
///
Size DesiredSize { get; }
///
/// Gets the width of the element.
///
double Width { get; }
///
/// Gets the height of the element.
///
double Height { get; }
///
/// Gets the minimum width of the element.
///
double MinWidth { get; }
///
/// Gets the maximum width of the element.
///
double MaxWidth { get; }
///
/// Gets the minimum height of the element.
///
double MinHeight { get; }
///
/// Gets the maximum height of the element.
///
double MaxHeight { get; }
///
/// Gets the margin around the element.
///
Thickness Margin { get; }
///
/// Gets the element's preferred horizontal alignment in its parent.
///
HorizontalAlignment HorizontalAlignment { get; }
///
/// Gets the element's preferred vertical alignment in its parent.
///
VerticalAlignment VerticalAlignment { get; }
///
/// Gets a value indicating whether the control's layout measure is valid.
///
bool IsMeasureValid { get; }
///
/// Gets a value indicating whether the control's layouts arrange is valid.
///
bool IsArrangeValid { get; }
///
/// Gets the available size passed in the previous layout pass, if any.
///
Size? PreviousMeasure { get; }
///
/// Gets the layout rect passed in the previous layout pass, if any.
///
Rect? PreviousArrange { get; }
///
/// Creates the visual children of the control, if necessary
///
void ApplyTemplate();
///
/// Carries out a measure of the control.
///
/// The available size for the control.
void Measure(Size availableSize);
///
/// Arranges the control and its children.
///
/// The control's new bounds.
void Arrange(Rect rect);
///
/// Invalidates the measurement of the control and queues a new layout pass.
///
void InvalidateMeasure();
///
/// Invalidates the arrangement of the control and queues a new layout pass.
///
void InvalidateArrange();
///
/// Called when a child control's desired size changes.
///
/// The child control.
void ChildDesiredSizeChanged(ILayoutable control);
///
/// Used by the to notify the control that its effective
/// viewport is changed.
///
/// The viewport information.
void EffectiveViewportChanged(EffectiveViewportChangedEventArgs e);
}
}