Skip to main content

ShellProvider

Trait ShellProvider 

Source
pub trait ShellProvider:
    Send
    + Sync
    + 'static {
Show 15 methods // Provided methods fn request_redraw(&self) { ... } fn set_cursor(&self, icon: Option<CursorIcon>) { ... } fn set_window_title(&self, title: String) { ... } fn set_ime_enabled(&self, is_enabled: bool) { ... } fn set_ime_cursor_area(&self, x: f32, y: f32, width: f32, height: f32) { ... } fn get_clipboard_text(&self) -> Result<String, ClipboardError> { ... } fn set_clipboard_text(&self, text: String) -> Result<(), ClipboardError> { ... } fn set_clipboard_html( &self, html: String, text: String, ) -> Result<(), ClipboardError> { ... } fn open_file_dialog( &self, multiple: bool, filter: Option<FileDialogFilter>, ) -> Vec<PathBuf> { ... } fn request_window_close(&self) { ... } fn set_window_minimized(&self, minimized: bool) { ... } fn set_window_maximized(&self, maximized: bool) { ... } fn is_window_maximized(&self) -> bool { ... } fn set_window_decorations(&self, decorations: bool) { ... } fn drag_window(&self) { ... }
}
Expand description

Abstraction over windowing / operating system (“shell”) functionality that allows a Blitz document to access that functionality without depending on a specific shell environment.

Provided Methods§

Source

fn request_redraw(&self)

Source

fn set_cursor(&self, icon: Option<CursorIcon>)

Source

fn set_window_title(&self, title: String)

Source

fn set_ime_enabled(&self, is_enabled: bool)

Source

fn set_ime_cursor_area(&self, x: f32, y: f32, width: f32, height: f32)

Source

fn get_clipboard_text(&self) -> Result<String, ClipboardError>

Source

fn set_clipboard_text(&self, text: String) -> Result<(), ClipboardError>

Source

fn set_clipboard_html( &self, html: String, text: String, ) -> Result<(), ClipboardError>

Put a selection on the clipboard as both rich text and plain text.

Two payloads, one copy. A target that understands HTML takes the markup and keeps the bold, the links and the code spans; everything else takes text, which is what a plain set_clipboard_text would have written on its own. Pasting formatted text out of a Blitz window was impossible before this, because plain text was the only thing ever offered.

Defaults to the plain path so a shell that has not implemented it still copies, rather than silently putting nothing on the clipboard.

Source

fn open_file_dialog( &self, multiple: bool, filter: Option<FileDialogFilter>, ) -> Vec<PathBuf>

Source

fn request_window_close(&self)

Source

fn set_window_minimized(&self, minimized: bool)

Source

fn set_window_maximized(&self, maximized: bool)

Source

fn is_window_maximized(&self) -> bool

Source

fn set_window_decorations(&self, decorations: bool)

Source

fn drag_window(&self)

Begin an interactive user-driven move of the window (call from a mousedown handler on a drag region)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§