You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/embed/rust/src/ui/component/paginated.rs

32 lines
878 B

pub enum AuxPageMsg {
/// Page component was instantiated with BACK button on every page and it
/// was pressed.
GoBack,
/// Page component was configured to react to swipes and user swiped left.
SwipeLeft,
/// Page component was configured to react to swipes and user swiped right.
SwipeRight,
}
/// Common message type for pagination components.
pub enum PageMsg<T, U> {
/// Pass-through from paged component.
Content(T),
/// Messages from page controls outside the paged component, like
/// "OK" and "Cancel" buttons.
Controls(U),
/// Auxilliary events used by exotic pages on touchscreens.
Aux(AuxPageMsg),
}
pub trait Paginate {
/// How many pages of content are there in total?
fn page_count(&mut self) -> usize;
/// Navigate to the given page.
fn change_page(&mut self, active_page: usize);
}