Skip to main content

ferroui_base/input/
i_clickable_control.rs

1use crate::interactivity::RoutedEventArgs;
2use crate::reactive::IDisposable;
3use std::rc::Rc;
4
5/// A control that can be clicked: what the access key and hot key handling
6/// needs from a button-like control.
7pub trait IClickableControl {
8    /// Raised when the control is clicked. Disposing the returned handle
9    /// unsubscribes.
10    fn click(&self, handler: Rc<dyn Fn(&RoutedEventArgs)>) -> Rc<dyn IDisposable>;
11
12    /// Raises the click of the control.
13    fn raise_click(&self);
14
15    /// Gets a value indicating whether this control and all its parents are
16    /// enabled.
17    fn is_effectively_enabled(&self) -> bool;
18}