using System; using System.Collections.Generic; using System.Threading.Tasks; using ElectronNET.API.Entities; namespace ElectronNET.API.Interfaces { /// /// Add icons and context menus to the system's notification area. /// public interface ITray { /// /// Emitted when the tray icon is clicked. /// event Action OnClick; /// /// macOS, Windows: Emitted when the tray icon is right clicked. /// event Action OnRightClick; /// /// macOS, Windows: Emitted when the tray icon is double clicked. /// event Action OnDoubleClick; /// /// Windows: Emitted when the tray balloon shows. /// event Action OnBalloonShow; /// /// Windows: Emitted when the tray balloon is clicked. /// event Action OnBalloonClick; /// /// Windows: Emitted when the tray balloon is closed /// because of timeout or user manually closes it. /// event Action OnBalloonClosed; /// /// Gets the menu items. /// /// /// The menu items. /// IReadOnlyCollection MenuItems { get; } /// /// Shows the Traybar. /// /// The image. /// The menu item. void Show(string image, MenuItem menuItem); /// /// Shows the Traybar. /// /// The image. /// The menu items. void Show(string image, MenuItem[] menuItems); /// /// Shows the Traybar (empty). /// /// The image. void Show(string image); /// /// Destroys the tray icon immediately. /// void Destroy(); /// /// Sets the image associated with this tray icon. /// /// void SetImage(string image); /// /// Sets the image associated with this tray icon when pressed on macOS. /// /// void SetPressedImage(string image); /// /// Sets the hover text for this tray icon. /// /// void SetToolTip(string toolTip); /// /// macOS: Sets the title displayed aside of the tray icon in the status bar. /// /// void SetTitle(string title); /// /// Windows: Displays a tray balloon. /// /// void DisplayBalloon(DisplayBalloonOptions options); /// /// Whether the tray icon is destroyed. /// /// Task IsDestroyedAsync(); /// /// Subscribe to an unmapped event on the module. /// /// The event name /// The handler void On(string eventName, Action fn); /// /// Subscribe to an unmapped event on the module. /// /// The event name /// The handler void On(string eventName, Action fn); /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler void Once(string eventName, Action fn); /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler void Once(string eventName, Action fn); } }