UserInterfaceProvider

Trait UserInterfaceProvider 

Source
pub trait UserInterfaceProvider:
    Environment
    + Send
    + Sync {
    // Required methods
    fn ShowMessage<'life0, 'async_trait>(
        &'life0 self,
        Severity: MessageSeverity,
        Message: String,
        Options: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn ShowOpenDialog<'life0, 'async_trait>(
        &'life0 self,
        Options: Option<OpenDialogOptionsDTO>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<PathBuf>>, CommonError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn ShowSaveDialog<'life0, 'async_trait>(
        &'life0 self,
        Options: Option<SaveDialogOptionsDTO>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>, CommonError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn ShowQuickPick<'life0, 'async_trait>(
        &'life0 self,
        Items: Vec<QuickPickItemDTO>,
        Options: Option<QuickPickOptionsDTO>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, CommonError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn ShowInputBox<'life0, 'async_trait>(
        &'life0 self,
        Options: Option<InputBoxOptionsDTO>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

An abstract service contract for an environment component that can perform UI interactions that require user input, such as showing dialogs, messages, and quick pick menus.

This trait is implemented by MountainEnvironment, and the methods are typically handled by sending events to the Sky frontend and awaiting a response.

Required Methods§

Source

fn ShowMessage<'life0, 'async_trait>( &'life0 self, Severity: MessageSeverity, Message: String, Options: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Shows a message to the user with a given severity and optional action buttons.

§Returns

A Result containing an Option<String> with the title of the clicked action button, or None if the message was dismissed.

Source

fn ShowOpenDialog<'life0, 'async_trait>( &'life0 self, Options: Option<OpenDialogOptionsDTO>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<PathBuf>>, CommonError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Shows a dialog for opening files or folders.

§Returns

A Result containing an Option<Vec<PathBuf>> with the selected paths, or None if the dialog was cancelled.

Source

fn ShowSaveDialog<'life0, 'async_trait>( &'life0 self, Options: Option<SaveDialogOptionsDTO>, ) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>, CommonError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Shows a dialog for saving a file.

§Returns

A Result containing the selected save path as an Option<PathBuf>, or None if the dialog was cancelled.

Source

fn ShowQuickPick<'life0, 'async_trait>( &'life0 self, Items: Vec<QuickPickItemDTO>, Options: Option<QuickPickOptionsDTO>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, CommonError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Shows a quick pick list to the user.

§Returns

A Result containing an Option<Vec<String>> with the labels of the selected items, or None if the quick pick was cancelled.

Source

fn ShowInputBox<'life0, 'async_trait>( &'life0 self, Options: Option<InputBoxOptionsDTO>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Shows an input box to solicit a string input from the user.

§Returns

A Result containing the string entered by the user as an Option<String>, or None if the input box was cancelled.

Trait Implementations§

Source§

impl Requires<dyn UserInterfaceProvider> for MountainEnvironment

Source§

fn Require(&self) -> Arc<dyn UserInterfaceProvider>

Returns the required capability from the environment, wrapped in an Arc for safe, shared ownership.

Implementors§