pub trait NavigationExt {
// Required methods
fn enter_hint_mode(&self) -> Result<()>;
fn exit_nav_mode(&self) -> Result<()>;
fn register_focusable(&self, region: PluginFocusable) -> Result<u64>;
fn unregister_focusable(&self, id: u64) -> Result<()>;
}Expand description
Navigation extension trait for plugin contexts
Provides navigation-related operations that plugins can perform, such as entering/exiting navigation modes and registering focusable regions.
This trait is automatically implemented for PluginContext when the
navigation feature is enabled.
Required Methods§
Sourcefn enter_hint_mode(&self) -> Result<()>
fn enter_hint_mode(&self) -> Result<()>
Sourcefn register_focusable(&self, region: PluginFocusable) -> Result<u64>
fn register_focusable(&self, region: PluginFocusable) -> Result<u64>
Register a custom focusable region
Allows plugins to register custom navigation targets that will appear in hint mode alongside auto-detected URLs, file paths, etc.
Returns a unique ID for this focusable that can be used to unregister it later.
§Arguments
region- The focusable region to register
§Returns
Unique ID for this focusable region
§Example
ⓘ
let id = ctx.register_focusable(PluginFocusable {
x: 10,
y: 5,
width: 20,
height: 1,
label: "Click me".to_string(),
action: PluginFocusableAction::Custom("my_action".to_string()),
})?;