// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Input { using System; using Perspex.Interactivity; /// /// Defines input-related functionality for a control. /// public interface IInputElement : IInteractive, IVisual { /// /// Occurs when the control receives focus. /// event EventHandler GotFocus; /// /// Occurs when the control loses focus. /// event EventHandler LostFocus; /// /// Occurs when a key is pressed while the control has focus. /// event EventHandler KeyDown; /// /// Occurs when a key is released while the control has focus. /// event EventHandler KeyUp; /// /// Occurs when the pointer enters the control. /// event EventHandler PointerEnter; /// /// Occurs when the pointer leaves the control. /// event EventHandler PointerLeave; /// /// Occurs when the pointer is pressed over the control. /// event EventHandler PointerPressed; /// /// Occurs when the pointer moves over the control. /// event EventHandler PointerMoved; /// /// Occurs when the pointer is released over the control. /// event EventHandler PointerReleased; /// /// Occurs when the mouse wheen is scrolled over the control. /// event EventHandler PointerWheelChanged; /// /// Gets or sets a value indicating whether the control can receive keyboard focus. /// bool Focusable { get; } /// /// Gets or sets a value indicating whether the control is enabled for user interaction. /// bool IsEnabled { get; } /// /// Gets a value indicating whether the control is effectively enabled for user interaction. /// /// /// The property is used to toggle the enabled state for individual /// controls. The property takes into account the /// value of this control and its parent controls. /// bool IsEnabledCore { get; } /// /// Gets or sets a value indicating whether the control is focused. /// bool IsFocused { get; } /// /// Gets or sets a value indicating whether the control is considered for hit testing. /// bool IsHitTestVisible { get; } /// /// Gets or sets a value indicating whether the pointer is currently over the control. /// bool IsPointerOver { get; } /// /// Focuses the control. /// void Focus(); /// /// Returns the input element that can be found within the current control at the specified /// position. /// /// The position, in control coordinates. /// The at the specified position. IInputElement InputHitTest(Point p); } }