ferroui_base/input/i_access_key_handler.rs
1use super::{IMainMenu, InputElement};
2use crate::Ref;
3use std::rc::Rc;
4
5/// Defines the interface for classes that handle access keys for a window.
6pub trait IAccessKeyHandler {
7 /// The window's main menu.
8 fn main_menu(&self) -> Option<Rc<dyn IMainMenu>>;
9
10 /// Sets the window's main menu.
11 fn set_main_menu(&self, value: Option<Rc<dyn IMainMenu>>);
12
13 /// Sets the owner of the access key handler.
14 ///
15 /// This method can only be called once, typically by the owner itself
16 /// on creation.
17 fn set_owner(&self, owner: &Ref<InputElement>);
18
19 /// Registers an input element to be associated with an access key.
20 fn register(&self, access_key: &str, element: &Ref<InputElement>);
21
22 /// Unregisters the access keys associated with the input element.
23 fn unregister(&self, element: &InputElement);
24}