using System.Threading.Tasks; using ElectronNET.API.Entities; namespace ElectronNET.API.Interfaces { /// /// Display native system dialogs for opening and saving files, alerting, etc. /// public interface IDialog { /// /// Note: On Windows and Linux an open dialog can not be both a file selector /// and a directory selector, so if you set properties to ['openFile', 'openDirectory'] /// on these platforms, a directory selector will be shown. /// /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. /// /// An array of file paths chosen by the user Task ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialogOptions options); /// /// Dialog for save files. /// /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. /// /// Returns String, the path of the file chosen by the user, if a callback is provided it returns an empty string. Task ShowSaveDialogAsync(BrowserWindow browserWindow, SaveDialogOptions options); /// /// Shows a message box, it will block the process until the message box is closed. /// It returns the index of the clicked button. The browserWindow argument allows /// the dialog to attach itself to a parent window, making it modal. If a callback /// is passed, the dialog will not block the process.The API call will be /// asynchronous and the result will be passed via callback(response). /// /// /// The API call will be asynchronous and the result will be passed via MessageBoxResult. Task ShowMessageBoxAsync(string message); /// /// Shows a message box, it will block the process until the message box is closed. /// It returns the index of the clicked button. The browserWindow argument allows /// the dialog to attach itself to a parent window, making it modal. If a callback /// is passed, the dialog will not block the process.The API call will be /// asynchronous and the result will be passed via callback(response). /// /// /// The API call will be asynchronous and the result will be passed via MessageBoxResult. Task ShowMessageBoxAsync(MessageBoxOptions messageBoxOptions); /// /// Shows a message box, it will block the process until the message box is closed. /// It returns the index of the clicked button. If a callback /// is passed, the dialog will not block the process. /// /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. /// /// The API call will be asynchronous and the result will be passed via MessageBoxResult. Task ShowMessageBoxAsync(BrowserWindow browserWindow, string message); /// /// Shows a message box, it will block the process until the message box is closed. /// It returns the index of the clicked button. If a callback /// is passed, the dialog will not block the process. /// /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. /// /// The API call will be asynchronous and the result will be passed via MessageBoxResult. Task ShowMessageBoxAsync(BrowserWindow browserWindow, MessageBoxOptions messageBoxOptions); /// /// Displays a modal dialog that shows an error message. /// /// This API can be called safely before the ready event the app module emits, /// it is usually used to report errors in early stage of startup.If called /// before the app readyevent on Linux, the message will be emitted to stderr, /// and no GUI dialog will appear. /// /// The title to display in the error box. /// The text content to display in the error box. void ShowErrorBox(string title, string content); /// /// On macOS, this displays a modal dialog that shows a message and certificate information, /// and gives the user the option of trusting/importing the certificate. If you provide a /// browserWindow argument the dialog will be attached to the parent window, making it modal. /// /// /// Task ShowCertificateTrustDialogAsync(CertificateTrustDialogOptions options); /// /// On macOS, this displays a modal dialog that shows a message and certificate information, /// and gives the user the option of trusting/importing the certificate. If you provide a /// browserWindow argument the dialog will be attached to the parent window, making it modal. /// /// /// /// Task ShowCertificateTrustDialogAsync(BrowserWindow browserWindow, CertificateTrustDialogOptions options); } }