using DesktopMagicPluginAPI.Drawing; using DesktopMagicPluginAPI.Inputs; using System; using System.Drawing; namespace DesktopMagicPluginAPI { /// /// The plugin class. /// public abstract class Plugin { private IPluginData application = null; /// /// Informations about the main application. /// public IPluginData Application { get => application; set => application = application is null ? value : throw new InvalidOperationException($"You cannot set the value of the {nameof(Application)} property"); } /// /// Gets or sets the interval, expressed in milliseconds, at which to call the method. /// public virtual int UpdateInterval { get; set; } = 1000; /// /// Gets or sets the render quality of the bitmap image. /// public virtual RenderQuality RenderQuality { get; set; } = RenderQuality.High; /// /// Occurs once when the plugin gets activated. /// public virtual void Start() { } /// /// Occurs once when the plugin gets deactivated. /// public virtual void Stop() { } /// /// Occurs when the elapses. /// /// public abstract Bitmap Main(); /// /// Occurs when the window is clicked by the mouse. /// /// The x- and y-coordinates of the mouse pointer position relative to the plugin window. /// The button associated with the event. public virtual void OnMouseClick(Point position, MouseButton mouseButton) { } /// /// Occurs when the mouse pointer is moved over the control. /// /// The x- and y-coordinates of the mouse pointer position relative to the plugin window. public virtual void OnMouseMove(Point position) { } /// /// Occurs when the user rotates the mouse wheel while the mouse pointer is over this element. /// /// The x- and y-coordinates of the mouse pointer position relative to the plugin window. /// A value that indicates the amount that the mouse wheel has changed. public virtual void OnMouseWheel(Point position, int delta) { } } }