Trait webkitten::ui::ApplicationUI
[−]
[src]
pub trait ApplicationUI<S>: Sized where
S: ScriptingEngine, { fn new(engine: Engine) -> Option<Self>; fn run(&self); fn copy(&self, text: &str); fn execute_command(&self, window_index: Option<u32>, text: &str); fn focused_window_index(&self) -> Option<u32>; fn window_count(&self) -> u32; fn open_window<U, B>(&self, uri: Option<U>, config: Option<B>) -> u32
where
U: Into<String>,
B: BrowserConfiguration; fn close_window(&self, index: u32); fn focus_window(&self, index: u32); fn focus_window_area(&self, index: u32, area: WindowArea); fn toggle_window(&self, index: u32, visible: bool); fn resize_window(&self, window_index: u32, width: u32, height: u32); fn command_field_text(&self, window_index: u32) -> String; fn set_command_field_text(&self, window_index: u32, text: &str); fn command_field_visible(&self, window_index: u32) -> bool; fn set_command_field_visible(&self, window_index: u32, visible: bool); fn window_title(&self, window_index: u32) -> String; fn set_window_title(&self, window_index: u32, title: &str); fn focused_webview_index(&self, window_index: u32) -> Option<u32>; fn webview_count(&self, window_index: u32) -> u32; fn open_webview<'a, U, B>(
&self,
window_index: u32,
uri: Option<U>,
config: Option<B>
)
where
U: Into<String>,
B: BrowserConfiguration; fn close_webview(&self, window_index: u32, webview_index: u32); fn focus_webview(&self, window_index: u32, webview_index: u32); fn reload_webview(
&self,
window_index: u32,
webview_index: u32,
disable_filters: bool
); fn set_uri(&self, window_index: u32, webview_index: u32, uri: &str); fn go_back(&self, window_index: u32, webview_index: u32) -> bool; fn go_forward(&self, window_index: u32, webview_index: u32) -> bool; fn uri(&self, window_index: u32, webview_index: u32) -> String; fn find_string(&self, window_index: u32, webview_index: u32, query: &str); fn hide_find_results(&self, window_index: u32, webview_index: u32); fn webview_title(&self, window_index: u32, webview_index: u32) -> String; fn run_javascript(
&self,
window_index: u32,
webview_index: u32,
script: &str
); fn apply_styles(&self, window_index: u32, webview_index: u32, styles: &str); }
Required Methods
fn new(engine: Engine) -> Option<Self>
Create a new UI
fn run(&self)
Initialize all needed UI functions
fn copy(&self, text: &str)
Copy text to the system clipboard
fn execute_command(&self, window_index: Option<u32>, text: &str)
Send a command to the event handler to be run in a particular window
fn focused_window_index(&self) -> Option<u32>
The index of the focused window
fn window_count(&self) -> u32
Number of open windows
fn open_window<U, B>(&self, uri: Option<U>, config: Option<B>) -> u32 where
U: Into<String>,
B: BrowserConfiguration,
U: Into<String>,
B: BrowserConfiguration,
Open a new window
fn close_window(&self, index: u32)
Close a window
fn focus_window(&self, index: u32)
Focus window at index
fn focus_window_area(&self, index: u32, area: WindowArea)
Capture keyboard input in given area
fn toggle_window(&self, index: u32, visible: bool)
Set window visibility
fn resize_window(&self, window_index: u32, width: u32, height: u32)
Change the dimensions of a specified window
fn command_field_text(&self, window_index: u32) -> String
Text in the command bar of a specified window
fn set_command_field_text(&self, window_index: u32, text: &str)
Set the text in the command bar of a specified window
fn command_field_visible(&self, window_index: u32) -> bool
true
if the command bar of a specified window is visible
fn set_command_field_visible(&self, window_index: u32, visible: bool)
Set the visibility in the command bar of a specified window
fn window_title(&self, window_index: u32) -> String
Title of a specified window
fn set_window_title(&self, window_index: u32, title: &str)
Set the title of a specified window
fn focused_webview_index(&self, window_index: u32) -> Option<u32>
Index of the webview currently visible in a specified window
fn webview_count(&self, window_index: u32) -> u32
Number of webviews in a window
fn open_webview<'a, U, B>(
&self,
window_index: u32,
uri: Option<U>,
config: Option<B>
) where
U: Into<String>,
B: BrowserConfiguration,
&self,
window_index: u32,
uri: Option<U>,
config: Option<B>
) where
U: Into<String>,
B: BrowserConfiguration,
Open a new webview in a specified window
fn close_webview(&self, window_index: u32, webview_index: u32)
Close a webview in a specified window
fn focus_webview(&self, window_index: u32, webview_index: u32)
Focus a webview in a specified window, hiding the current webview
fn reload_webview(
&self,
window_index: u32,
webview_index: u32,
disable_filters: bool
)
&self,
window_index: u32,
webview_index: u32,
disable_filters: bool
)
Reload a webview in a specified window
fn set_uri(&self, window_index: u32, webview_index: u32, uri: &str)
Load a URI in a webview
fn go_back(&self, window_index: u32, webview_index: u32) -> bool
Go back to the previously loaded resource in a webview
fn go_forward(&self, window_index: u32, webview_index: u32) -> bool
Go forward to the next loaded resource in a webview
fn uri(&self, window_index: u32, webview_index: u32) -> String
Get the currently loaded URI or empty string
fn find_string(&self, window_index: u32, webview_index: u32, query: &str)
Find a string within the selected web view
fn hide_find_results(&self, window_index: u32, webview_index: u32)
Hide results from a previous find invocation (if applicable)
fn webview_title(&self, window_index: u32, webview_index: u32) -> String
Get the title of the currently loaded URI or empty string
fn run_javascript(&self, window_index: u32, webview_index: u32, script: &str)
Run a JavaScript snippet in a webview
fn apply_styles(&self, window_index: u32, webview_index: u32, styles: &str)
Apply a stylesheet to a webview