using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using ElectronNET.API.Entities; namespace ElectronNET.API.Interfaces { /// /// Control your app in the macOS dock. /// public interface IDock { /// /// When is passed, the dock icon will bounce until either the application becomes /// active or the request is canceled. When is passed, the dock icon will bounce /// for one second. However, the request remains active until either the application becomes active or the request is canceled. /// /// Note: This method can only be used while the app is not focused; when the app is focused it will return -1. /// /// Can be critical or informational. The default is informational. /// The cancellation token. /// Return an ID representing the request. Task BounceAsync(DockBounceType type, CancellationToken cancellationToken = default); /// /// Cancel the bounce of id. /// /// Id of the request. void CancelBounce(int id); /// /// Bounces the Downloads stack if the filePath is inside the Downloads folder. /// /// void DownloadFinished(string filePath); /// /// Sets the string to be displayed in the dock’s badging area. /// /// void SetBadge(string text); /// /// Gets the string to be displayed in the dock’s badging area. /// /// The cancellation token. /// The badge string of the dock. Task GetBadgeAsync(CancellationToken cancellationToken = default); /// /// Hides the dock icon. /// void Hide(); /// /// Shows the dock icon. /// void Show(); /// /// Whether the dock icon is visible. The app.dock.show() call is asynchronous /// so this method might not return true immediately after that call. /// /// The cancellation token. /// Whether the dock icon is visible. Task IsVisibleAsync(CancellationToken cancellationToken = default); /// /// Gets the dock menu items. /// /// /// The menu items. /// IReadOnlyCollection MenuItems { get; } /// /// Sets the application's dock menu. /// void SetMenu(MenuItem[] menuItems); /// /// TODO: Menu (macOS) still to be implemented /// Gets the application's dock menu. /// Task GetMenu(CancellationToken cancellationToken = default); /// /// Sets the image associated with this dock icon. /// /// void SetIcon(string image); } }