Trait browser_window::prelude::BrowserWindowExt
source · pub trait BrowserWindowExt: Copy {
// Required methods
fn cookie_jar(&self) -> CookieJarImpl;
fn eval_js(
&self,
js: &str,
callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>),
callback_data: *mut ()
);
fn eval_js_threadsafe(
&self,
js: &str,
callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>),
callback_data: *mut ()
);
fn navigate(&self, uri: &str);
fn new(
app: ApplicationImpl,
parent: WindowImpl,
source: cbw_BrowserWindowSource,
title: &str,
width: Option<u32>,
height: Option<u32>,
window_options: &cbw_WindowOptions,
browser_window_options: &cbw_BrowserWindowOptions,
handler: unsafe fn(_: BrowserWindowImpl, _: &str, _: Vec<String>),
user_data: *mut (),
creation_callback: unsafe fn(_: BrowserWindowImpl, _: *mut ()),
callback_data: *mut ()
);
fn user_data(&self) -> *mut ();
fn url<'a>(&'a self) -> Cow<'a, str>;
fn window(&self) -> WindowImpl;
}
Required Methods§
sourcefn eval_js(
&self,
js: &str,
callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>),
callback_data: *mut ()
)
fn eval_js( &self, js: &str, callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>), callback_data: *mut () )
Executes the given JavaScript string. The result will be provided by invoking the callback function.
sourcefn eval_js_threadsafe(
&self,
js: &str,
callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>),
callback_data: *mut ()
)
fn eval_js_threadsafe( &self, js: &str, callback: unsafe fn(_: BrowserWindowImpl, _: *mut (), _: Result<String, JsEvaluationError>), callback_data: *mut () )
Like eval_js
, except it can be called from any thread.
Causes the browser to navigate to the given URI.
sourcefn new(
app: ApplicationImpl,
parent: WindowImpl,
source: cbw_BrowserWindowSource,
title: &str,
width: Option<u32>,
height: Option<u32>,
window_options: &cbw_WindowOptions,
browser_window_options: &cbw_BrowserWindowOptions,
handler: unsafe fn(_: BrowserWindowImpl, _: &str, _: Vec<String>),
user_data: *mut (),
creation_callback: unsafe fn(_: BrowserWindowImpl, _: *mut ()),
callback_data: *mut ()
)
fn new( app: ApplicationImpl, parent: WindowImpl, source: cbw_BrowserWindowSource, title: &str, width: Option<u32>, height: Option<u32>, window_options: &cbw_WindowOptions, browser_window_options: &cbw_BrowserWindowOptions, handler: unsafe fn(_: BrowserWindowImpl, _: &str, _: Vec<String>), user_data: *mut (), creation_callback: unsafe fn(_: BrowserWindowImpl, _: *mut ()), callback_data: *mut () )
Creates a new browser window asynchronously.
The BrowserWindowImpl
handle to the new browser window will be passed via a callback.
§Arguments
app
- The application handle
parent
- An handle for another window that this window will be a child of. Use WindowImpl::default() for no parent.
source
- The content that will be displayed by the browser.
title
- The title that the window will have.
width
- The width of the window.
height
- The height of the window.
window_options
- Options for the window.
browser_window_options
- Some extra browser related options.
handler
- A handler function that can be invoked from within JavaScript code.
user_data
- Could be set to point to some extra data that this browser window will store.
creation_callback
- Will be invoked when the browser window is created. It provided the BrowserWindowImpl
handle.
callback_data
- The data that will be provided to the creation_callback
.
fn user_data(&self) -> *mut ()
fn url<'a>(&'a self) -> Cow<'a, str>
sourcefn window(&self) -> WindowImpl
fn window(&self) -> WindowImpl
Gives a handle to the underlying window.