using System;
using Chernobyl.Mathematics.Movement;
namespace Chernobyl.Interface.Input
{
///
/// An interface for a type that can control the pointer based interface of
/// the application in some form. This interface is used for mice, touch
/// based interfaces, etc. (i.e., controls which can point at the screen and
/// instruct the code to do something to the thing being pointed at).
/// Additionally, this interface can be used to represent more than one
/// control of different types. For example it can be used to represent a
/// mouse and two fingers (touch based control).
///
public interface IPointerControl
{
///
/// An event that is raised each time the control mechanism is pressed
/// down. This mechanism can only be once per
/// mechanism's pointer. The mechanism must raise
/// for a pointer prior to that pointer raising
/// again. For example, a mouse can only raise
/// once and then it must raise
/// to allow to be raised. A touch screen on
/// the other hand can invoke for each finger
/// that touches the screen but must invoke for each
/// finger.
///
event EventHandler PressedDown;
///
/// An event that is raised each time the control mechanism is let up.
/// See for more information on this topic.
///
event EventHandler LetUp;
}
///
/// An instance used to contain data related to
/// pointer operations such as pressing a pointer down or letting it up.
///
public class PointerEventArgs : EventArgs
{
///
/// Prevents a default instance of the
/// class from being created.
///
/// The device that is pointing to some position
/// on the screen when the event was invoked.
public PointerEventArgs(ITransform pointer)
{
Pointer = pointer;
}
///
/// The device that is pointing to some position on the screen when the
/// event was invoked.
///
public ITransform Pointer { get; private set; }
}
}