pub enum Event {
Show 79 variants
Device(DeviceEvent),
Gesture(GestureEvent),
Keyboard(KeyboardEvent),
Key(KeyKind),
Open(Box<Info>),
OpenHtml(String, Option<String>),
LoadPixmap(usize),
Update(UpdateMode),
RefreshBookPreview(PathBuf, Option<PathBuf>),
Invalid(PathBuf),
Notification(NotificationEvent),
Notify(String),
Page(CycleDir),
ResultsPage(CycleDir),
GoTo(usize),
GoToLocation(Location),
ResultsGoTo(usize),
CropMargins(Box<Margin>),
Chapter(CycleDir),
SelectDirectory(PathBuf),
ToggleSelectDirectory(PathBuf),
NavigationBarResized(i32),
Focus(Option<ViewId>),
Select(EntryId),
PropagateSelect(EntryId),
EditLanguages,
Define(String),
Submit(ViewId, String),
Slider(SliderId, f32, FingerStatus),
ToggleNear(ViewId, Rectangle),
ToggleInputHistoryMenu(ViewId, Rectangle),
ToggleBookMenu(Rectangle, usize),
TogglePresetMenu(Rectangle, usize),
SubMenu(Rectangle, Vec<EntryKind>),
OpenSettingsCategory(Category),
SelectSettingsCategory(Category),
UpdateSettings(Box<Settings>),
EditLibrary(usize),
UpdateLibrary(usize, Box<LibrarySettings>),
AddLibrary,
DeleteLibrary(usize),
ProcessLine(LineOrigin, String),
History(CycleDir, bool),
Toggle(ViewId),
NewToggle(ToggleEvent),
Show(ViewId),
Close(ViewId),
CloseSub(ViewId),
Search(String),
SearchResult(usize, Vec<Boundary>),
FetcherAddDocument(u32, Box<Info>),
FetcherRemoveDocument(u32, PathBuf),
FetcherSearch {
id: u32,
path: Option<PathBuf>,
query: Option<String>,
sort_by: Option<(SortMethod, bool)>,
},
CheckFetcher(u32),
EndOfSearch,
Finished,
ClockTick,
BatteryTick,
ToggleFrontlight,
Load(PathBuf),
LoadPreset(usize),
Scroll(i32),
Save,
Guess,
CheckBattery,
SetWifi(bool),
MightSuspend,
PrepareSuspend,
Suspend,
Share,
PrepareShare,
Validate,
Cancel,
Reseed,
Back,
Quit,
WakeUp,
Hold(EntryId),
FileChooserClosed(Option<PathBuf>),
}Variants§
Device(DeviceEvent)
Gesture(GestureEvent)
Keyboard(KeyboardEvent)
Key(KeyKind)
Open(Box<Info>)
OpenHtml(String, Option<String>)
LoadPixmap(usize)
Update(UpdateMode)
RefreshBookPreview(PathBuf, Option<PathBuf>)
Invalid(PathBuf)
Notification(NotificationEvent)
Notify(String)
👎Deprecated: Use Event::Notification(NotificationEvent::Show) instead
Page(CycleDir)
ResultsPage(CycleDir)
GoTo(usize)
GoToLocation(Location)
ResultsGoTo(usize)
CropMargins(Box<Margin>)
Chapter(CycleDir)
SelectDirectory(PathBuf)
ToggleSelectDirectory(PathBuf)
Focus(Option<ViewId>)
Manages input focus state for focusable views like InputField.
This event controls which view currently receives keyboard input.
It is not a navigation event — use Event::Show to transition
between screens or display new UI components.
§Variants
Focus(Some(view_id))— Grants focus to the view matchingview_id. The focused view will receiveEvent::Keyboardevents. Parent views typically use this to show the on-screen keyboard.Focus(None)— Clears focus from all views. Parent views typically use this to hide the on-screen keyboard.
§Dispatch behavior
Focus events are broadcast: InputField
returns false after handling this event so that all input fields in
the hierarchy can update their focused/unfocused state.
§Sending
Typically sent through the hub (hub.send(...)) by:
- An
InputFieldwhen tapped while unfocused - A parent view after building a screen that contains an input field
- A keyboard’s hide method to clear focus
§Example
use cadmus_core::view::{Event, ViewId};
use cadmus_core::view::ota::OtaViewId;
// Focus the PR input field (e.g. after building the PR input screen).
// Note: `hub` is provided by the application's event loop.
hub.send(Event::Focus(Some(ViewId::Ota(OtaViewId::PrInput)))).ok();
// Clear focus from all views.
hub.send(Event::Focus(None)).ok();Select(EntryId)
PropagateSelect(EntryId)
EditLanguages
Define(String)
Submit(ViewId, String)
Slider(SliderId, f32, FingerStatus)
ToggleNear(ViewId, Rectangle)
ToggleInputHistoryMenu(ViewId, Rectangle)
ToggleBookMenu(Rectangle, usize)
TogglePresetMenu(Rectangle, usize)
SubMenu(Rectangle, Vec<EntryKind>)
OpenSettingsCategory(Category)
SelectSettingsCategory(Category)
UpdateSettings(Box<Settings>)
EditLibrary(usize)
UpdateLibrary(usize, Box<LibrarySettings>)
AddLibrary
DeleteLibrary(usize)
ProcessLine(LineOrigin, String)
History(CycleDir, bool)
Toggle(ViewId)
👎Deprecated: Use Event::NewToggle(ToggleEvent::View(ViewID)) instead
NewToggle(ToggleEvent)
Show(ViewId)
Close(ViewId)
CloseSub(ViewId)
Search(String)
SearchResult(usize, Vec<Boundary>)
FetcherAddDocument(u32, Box<Info>)
FetcherRemoveDocument(u32, PathBuf)
FetcherSearch
CheckFetcher(u32)
EndOfSearch
Finished
ClockTick
BatteryTick
ToggleFrontlight
Load(PathBuf)
LoadPreset(usize)
Scroll(i32)
Save
Guess
CheckBattery
SetWifi(bool)
MightSuspend
PrepareSuspend
Suspend
Validate
Cancel
Reseed
Back
Quit
WakeUp
Hold(EntryId)
FileChooserClosed(Option<PathBuf>)
The file chooser was closed.
The Option<PathBuf> contains the selected path, if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.