// 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 { #region EventHandler /// /// 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); #endregion /// /// Represents a generic cue device. /// public interface ICueDevice : ILedGroup, IEnumerable { #region Properties /// /// Gets generic information provided by CUE for the device. /// IDeviceInfo DeviceInfo { get; } /// /// 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; } #endregion #region Indexer /// /// 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; } #endregion #region Events // 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 #endregion #region Methods /// /// Initializes the device. /// void Initialize(); /// /// Performs 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. /// Only updates the hardware-leds skippin effects and the render-pass. Only use this if you know what that means! void Update(bool flushLeds = false, bool noRender = false); /// /// Reads the currently active colors from the device and sync them with the internal state. /// void SyncColors(); /// /// Saves the currently active colors from the device. /// void SaveColors(); /// /// Restores the last saved colors. /// void RestoreColors(); /// /// Attaches the given ledgroup. /// /// The ledgroup to attach. /// true if the ledgroup could be attached; otherwise, 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); #endregion } }