// ReSharper disable UnusedMemberInSuper.Global // ReSharper disable UnusedMember.Global using System.Collections.Generic; using System.Drawing; using CUE.NET.Devices.Generic; using CUE.NET.Devices.Generic.Enums; using CUE.NET.Devices.Generic.EventArgs; using CUE.NET.Groups; namespace CUE.NET.Devices { /// /// Represents the event-handler of the Exception-event. /// /// The sender of the event. /// The arguments provided by the event. public delegate void ExceptionEventHandler(object sender, ExceptionEventArgs args); /// /// Represents the event-handler of the Updating-event. /// /// The sender of the event. /// The arguments provided by the event. public delegate void UpdatingEventHandler(object sender, UpdatingEventArgs args); /// /// Represents the event-handler of the Updated-event. /// /// The sender of the event. /// The arguments provided by the event. public delegate void UpdatedEventHandler(object sender, UpdatedEventArgs args); /// /// Represents the event-handler of the LedsUpdating-event. /// /// The sender of the event. /// The arguments provided by the event. public delegate void LedsUpdatingEventHandler(object sender, LedsUpdatingEventArgs args); /// /// Represents the event-handler of the LedsUpdated-event. /// /// The sender of the event. /// The arguments provided by the event. public delegate void LedsUpdatedEventHandler(object sender, LedsUpdatedEventArgs args); /// /// Represents a generic cue device. /// public interface ICueDevice : ILedGroup, IEnumerable { /// /// Gets generic information provided by CUE for the device. /// IDeviceInfo DeviceInfo { get; } /// /// Gets or sets the update-mode for the device. /// UpdateMode UpdateMode { get; set; } /// /// Gets or sets the update-frequency in seconds. (Calculate by using '1f / updates per second') /// float UpdateFrequency { get; set; } /// /// Gets the rectangle containing all LEDs of the device. /// RectangleF DeviceRectangle { get; } /// /// Gets a read-only collection containing the LEDs of the device. /// IEnumerable Leds { get; } /// /// Gets the with the specified ID. /// /// The ID of the LED to get. /// The LED with the specified ID or null if no LED is found. CorsairLed this[CorsairLedId ledId] { get; } /// /// Gets the at the given physical location. /// /// The point to get the location from. /// The LED at the given point or null if no location is found. CorsairLed this[PointF location] { get; } /// /// Gets a list of inside the given rectangle. /// /// The rectangle to check. /// The minimal percentage overlay a location must have with the to be taken into the list. /// IEnumerable this[RectangleF referenceRect, float minOverlayPercentage = 0.5f] { get; } // ReSharper disable EventNeverSubscribedTo.Global /// /// Occurs when a catched exception is thrown inside the device. /// event ExceptionEventHandler Exception; /// /// Occurs when the device starts updating. /// event UpdatingEventHandler Updating; /// /// Occurs when the device update is done. /// event UpdatedEventHandler Updated; /// /// Occurs when the device starts to update the leds. /// event LedsUpdatingEventHandler LedsUpdating; /// /// Occurs when the device updated the leds. /// event LedsUpdatedEventHandler LedsUpdated; // ReSharper restore EventNeverSubscribedTo.Global /// /// Perform an update for all dirty keys, or all keys if flushLeds is set to true. /// /// Specifies whether all keys (including clean ones) should be updated. void Update(bool flushLeds = false); bool AttachLedGroup(ILedGroup ledGroup); /// /// Detaches the given ledgroup. /// /// The ledgroup to detached. /// true if the ledgroup could be detached; otherwise, false. bool DetachLedGroup(ILedGroup ledGroup); } }