// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System.Diagnostics.Contracts; using System; using System.Collections.Generic; using Perspex.Interactivity; namespace Perspex.Input { /// /// 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 a user typed some text while the control has focus. /// event EventHandler TextInput; /// /// 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 or sets the associated mouse cursor. /// Cursor Cursor { 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(); /// /// Gets the key bindings for the element. /// List KeyBindings { get; } } }