pub enum Event {
Show 82 variants
Device(DeviceEvent),
Gesture(GestureEvent),
Keyboard(KeyboardEvent),
Key(KeyKind),
Open(Box<Info>),
OpenHtml(String, Option<String>),
LoadPixmap(usize),
Update(UpdateMode),
RefreshBookPreview(PathBuf),
Invalid(PathBuf),
Notification(NotificationEvent),
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(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>),
Github(GithubEvent),
Settings(SettingsEvent),
OpenNamedInput {
view_id: ViewId,
label: String,
max_chars: usize,
initial_text: String,
},
OtaDownloadProgress {
label: String,
percent: u8,
},
StartStableReleaseDownload,
}Variants§
Device(DeviceEvent)
Gesture(GestureEvent)
Keyboard(KeyboardEvent)
Key(KeyKind)
Open(Box<Info>)
OpenHtml(String, Option<String>)
LoadPixmap(usize)
Update(UpdateMode)
RefreshBookPreview(PathBuf)
Invalid(PathBuf)
Notification(NotificationEvent)
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(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.
Github(GithubEvent)
GitHub authentication and API interaction events.
Settings(SettingsEvent)
Settings-specific events
OpenNamedInput
Request to open a NamedInput text overlay.
The handler is responsible for creating the overlay and placing it at the correct position in the view hierarchy so it sits at the top of the z-order.
Fields
OtaDownloadProgress
Progress update from a background OTA download thread.
OtaView handles this by updating the status label text and the
progress bar fill to reflect the current download state.
StartStableReleaseDownload
Signal to start downloading the stable release after version check.
This event is sent from the version check thread when the remote version is newer than the current version, triggering the actual download to begin.
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more