Trait webkitten::ui::BrowserConfiguration
[−]
[src]
pub trait BrowserConfiguration: Sized { fn parse(raw_input: &str) -> Option<Self>; fn lookup_bool<'a>(&'a self, key: &'a str) -> Option<bool>; fn lookup_str<'a>(&'a self, key: &'a str) -> Option<String>; fn lookup_integer<'a>(&'a self, key: &'a str) -> Option<i64>; fn lookup_raw_str<'a>(&'a self, key: &'a str) -> Option<String>; fn lookup_str_vec(&self, key: &str) -> Option<Vec<String>>; fn lookup_str_table(&self, key: &str) -> Option<HashMap<String, String>>; fn start_page(&self) -> Option<String> { ... } fn new_frame_uses_focused_window(&self) -> bool { ... } fn config_dir(&self) -> Option<String> { ... } fn command_interpreter(&self) -> Option<String> { ... } fn resolved_command_name(&self, name: &str) -> Option<String> { ... } fn bar_font(&self) -> Option<(String, i64)> { ... } fn command_matching_prefix(&self, text: &str) -> Option<String> { ... } fn command_keybindings(&self) -> HashMap<String, (char, usize)> { ... } fn command_disabled(&self, name: &str) -> bool { ... } fn content_filter_path(&self) -> Option<String> { ... } fn skip_content_filter(&self, uri: &str) -> bool { ... } fn use_private_browsing(&self, uri: &str) -> bool { ... } fn use_javascript(&self, uri: &str) -> bool { ... } fn use_plugins(&self, uri: &str) -> bool { ... } fn command_search_paths(&self) -> Vec<String> { ... } fn default_command(&self) -> Option<String> { ... } fn on_buffer_event_commands(&self, event: &BufferEvent) -> Vec<String> { ... } fn lookup_site_bool<'a>(&'a self, uri: &str, key: &'a str) -> Option<bool> { ... } fn lookup_site_str<'a>(&'a self, uri: &str, key: &'a str) -> Option<String> { ... } fn lookup_site_str_vec<'a>(
&'a self,
uri: &str,
key: &'a str
) -> Option<Vec<String>> { ... } }
Required Methods
fn parse(raw_input: &str) -> Option<Self>
Parse a string literal into a BrowserConfiguration
fn lookup_bool<'a>(&'a self, key: &'a str) -> Option<bool>
Look up the bool value of a configuration option matching key
fn lookup_str<'a>(&'a self, key: &'a str) -> Option<String>
Look up the string value of a configuration option matching key, replacing string variables where possible
fn lookup_integer<'a>(&'a self, key: &'a str) -> Option<i64>
Look up the integer value of a configuration option matching key
fn lookup_raw_str<'a>(&'a self, key: &'a str) -> Option<String>
Look up the string value of a configuration option without any substitutions
fn lookup_str_vec(&self, key: &str) -> Option<Vec<String>>
Look up the string vector value of a configuration option matching key
fn lookup_str_table(&self, key: &str) -> Option<HashMap<String, String>>
Look up the string table value of a configuration option matching key
Provided Methods
fn start_page(&self) -> Option<String>
The page opened with each new window or empty buffer based on
window.start-page
fn new_frame_uses_focused_window(&self) -> bool
Whether to open a buffer in the focused window or a new window when
requesting a new frame. Defaults to false
, always opening a new
window.
fn config_dir(&self) -> Option<String>
The directory to replace instances of CONFIG_DIR in the configuration file
fn command_interpreter(&self) -> Option<String>
The name of the scripting engine to use for evaluating command files. Defaults to "lua".
fn resolved_command_name(&self, name: &str) -> Option<String>
The name of a command resolving any matching alias in commands.aliases
fn bar_font(&self) -> Option<(String, i64)>
Font to use in the command bar
fn command_matching_prefix(&self, text: &str) -> Option<String>
Find the command to automatically run for a given text prefix
fn command_keybindings(&self) -> HashMap<String, (char, usize)>
Mapping of commands to keybindings by name to key and modifier mask
fn command_disabled(&self, name: &str) -> bool
Whether a command is disabled based on commands.disabled
fn content_filter_path(&self) -> Option<String>
The path to the content filter used in buffers based on
general.content-filter
fn skip_content_filter(&self, uri: &str) -> bool
Whether to skip content filtering based on the site-specific option
sites."[HOST]".general.skip-content-filter
. Defaults to false
.
fn use_private_browsing(&self, uri: &str) -> bool
Whether to enable private browsing based on the global option
general.private-browsing
and site-specific option
sites."[HOST]".general.private-browsing
. Defaults to false
.
fn use_javascript(&self, uri: &str) -> bool
Whether to allow JavaScript to run in a buffer based on the global
option general.allow-javascript
and site-specific option
sites."[HOST]".general.allow-javascript
. Defaults to true
.
fn use_plugins(&self, uri: &str) -> bool
Whether to allow browser plugins to run in a buffer based on the global
option general.allow-plugins
and site-specific option
sites."[HOST]".general.allow-plugins
. Defaults to false
.
fn command_search_paths(&self) -> Vec<String>
Paths to search for command scripts using configuration option
command.search-paths
fn default_command(&self) -> Option<String>
Command to run when no other commands are matched using configuration
option commands.default
fn on_buffer_event_commands(&self, event: &BufferEvent) -> Vec<String>
Commands triggered by a buffer event
Events
Load
: invokes all commands listed incommands.on-load-uri
Request
: invokes all commands listed incommands.on-request-uri
Focus
: invokes all commands listed incommands.on-focus-uri
Fail
: invokes all commands listed incommands.on-fail-uri
fn lookup_site_bool<'a>(&'a self, uri: &str, key: &'a str) -> Option<bool>
Look up the bool value of a configuration option matching key
formatted as sites."[HOST]".[key]
, falling back to [key]
if no
match is found.
fn lookup_site_str<'a>(&'a self, uri: &str, key: &'a str) -> Option<String>
Look up the string value of a configuration option matching key
formatted as sites."[HOST]".[key]
, falling back to [key]
if no
match is found.
fn lookup_site_str_vec<'a>(
&'a self,
uri: &str,
key: &'a str
) -> Option<Vec<String>>
&'a self,
uri: &str,
key: &'a str
) -> Option<Vec<String>>
Look up the string vector value of a configuration option matching key
formatted as sites."[HOST]".[key]
, falling back to [key]
if no
match is found.
Implementors
impl BrowserConfiguration for Config