// -----------------------------------------------------------------------
//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Layout
{
using System;
using System.Reactive;
///
/// Manages measuring and arranging of controls.
///
///
/// Each layout root element such as a window has its own LayoutManager that is responsible
/// for laying out its child controls. When a layout is required the
/// observable will fire and the root element should respond by calling
/// at the earliest opportunity to carry out the layout.
///
public interface ILayoutManager
{
///
/// Gets or sets the root element that the manager is attached to.
///
///
/// This must be set before the layout manager can be used.
///
ILayoutRoot Root { get; set; }
///
/// Gets an observable that is fired when a layout pass is needed.
///
IObservable LayoutNeeded { get; }
///
/// Gets an observable that is fired when a layout pass is completed.
///
IObservable LayoutCompleted { get; }
///
/// Gets a value indicating whether a layout is queued.
///
///
/// Returns true when has been fired, but
/// has not yet been called.
///
bool LayoutQueued { get; }
///
/// Executes a layout pass.
///
void ExecuteLayoutPass();
///
/// Notifies the layout manager that a control requires a measure.
///
/// The control.
/// The control's distance from the layout root.
void InvalidateMeasure(ILayoutable control, int distance);
///
/// Notifies the layout manager that a control requires an arrange.
///
/// The control.
/// The control's distance from the layout root.
void InvalidateArrange(ILayoutable control, int distance);
}
}