View

Trait View 

Source
pub trait View: Downcast {
Show 16 methods // Required methods fn handle_event( &mut self, evt: &Event, hub: &Hub, bus: &mut Bus, rq: &mut RenderQueue, context: &mut Context, ) -> bool; fn render( &self, fb: &mut dyn Framebuffer, rect: Rectangle, fonts: &mut Fonts, ); fn rect(&self) -> &Rectangle; fn rect_mut(&mut self) -> &mut Rectangle; fn children(&self) -> &Vec<Box<dyn View>>; fn children_mut(&mut self) -> &mut Vec<Box<dyn View>>; fn id(&self) -> Id; // Provided methods fn render_rect(&self, _rect: &Rectangle) -> Rectangle { ... } fn resize( &mut self, rect: Rectangle, _hub: &Hub, _rq: &mut RenderQueue, _context: &mut Context, ) { ... } fn child(&self, index: usize) -> &dyn View { ... } fn child_mut(&mut self, index: usize) -> &mut dyn View { ... } fn len(&self) -> usize { ... } fn might_skip(&self, _evt: &Event) -> bool { ... } fn might_rotate(&self) -> bool { ... } fn is_background(&self) -> bool { ... } fn view_id(&self) -> Option<ViewId> { ... }
}

Required Methods§

Source

fn handle_event( &mut self, evt: &Event, hub: &Hub, bus: &mut Bus, rq: &mut RenderQueue, context: &mut Context, ) -> bool

Source

fn render(&self, fb: &mut dyn Framebuffer, rect: Rectangle, fonts: &mut Fonts)

Source

fn rect(&self) -> &Rectangle

Source

fn rect_mut(&mut self) -> &mut Rectangle

Source

fn children(&self) -> &Vec<Box<dyn View>>

Source

fn children_mut(&mut self) -> &mut Vec<Box<dyn View>>

Source

fn id(&self) -> Id

Provided Methods§

Source

fn render_rect(&self, _rect: &Rectangle) -> Rectangle

Source

fn resize( &mut self, rect: Rectangle, _hub: &Hub, _rq: &mut RenderQueue, _context: &mut Context, )

Source

fn child(&self, index: usize) -> &dyn View

Source

fn child_mut(&mut self, index: usize) -> &mut dyn View

Source

fn len(&self) -> usize

Source

fn might_skip(&self, _evt: &Event) -> bool

Source

fn might_rotate(&self) -> bool

Source

fn is_background(&self) -> bool

Source

fn view_id(&self) -> Option<ViewId>

Implementations§

Source§

impl dyn View

Source

pub fn is<__T: View>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

Source

pub fn downcast<__T: View>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Source

pub fn downcast_rc<__T: View>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Source

pub fn downcast_ref<__T: View>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Source

pub fn downcast_mut<__T: View>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

Source§

impl Debug for Box<dyn View>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

Source§

impl View for ActionLabel

Source§

impl View for Battery

Source§

impl View for Button

Source§

impl View for cadmus_core::view::calculator::bottom_bar::BottomBar

Source§

impl View for CodeArea

Source§

impl View for InputBar

Source§

impl View for Calculator

Source§

impl View for Clock

Source§

impl View for Dialog

Source§

impl View for cadmus_core::view::dictionary::bottom_bar::BottomBar

Source§

impl View for Dictionary

Source§

impl View for Breadcrumb

Source§

impl View for BreadcrumbEntry

Source§

impl View for FileChooser

Source§

impl View for FileEntry

Source§

impl View for Filler

Source§

impl View for FrontlightWindow

Source§

impl View for AddressBar

Source§

impl View for Book

Source§

impl View for cadmus_core::view::home::bottom_bar::BottomBar

Source§

impl View for DirectoriesBar

Source§

impl View for Directory

Source§

impl View for LibraryLabel

Source§

impl View for Shelf

Source§

impl View for Home

Source§

impl View for Icon

Source§

impl View for Image

Source§

impl View for InputField

Source§

impl View for Intermission

Source§

impl View for Key

Source§

impl View for Keyboard

Source§

impl View for Label

Source§

impl View for LabeledIcon

Source§

impl View for Menu

Source§

impl View for MenuEntry

Source§

impl View for NamedInput

Source§

impl View for Notification

Source§

impl View for OtaView

Source§

impl View for PageLabel

Source§

impl View for Preset

Source§

impl View for PresetsList

Source§

impl View for cadmus_core::view::reader::bottom_bar::BottomBar

Source§

impl View for ChapterLabel

Source§

impl View for MarginCropper

Source§

impl View for ResultsBar

Source§

impl View for ResultsLabel

Source§

impl View for Reader

Source§

impl View for ToolBar

Source§

impl View for RotationValues

Source§

impl View for RoundedButton

Source§

impl View for LibraryEditor

Source§

impl View for CategoryButton

Source§

impl View for CategoryEditor

Source§

impl View for CategoryNavigationBar

Source§

impl View for SettingRow

Source§

impl View for SettingValue

Source§

impl View for SettingsEditor

Source§

impl View for SettingsEditorBottomBar

Source§

impl View for Sketch

Source§

impl View for Slider

Source§

impl View for SelectionBox

Source§

impl View for Toggle

Source§

impl View for ToggleableKeyboard

Source§

impl View for TopBar

Source§

impl View for TouchEvents

Source§

impl<P: NavigationProvider + 'static> View for StackNavigationBar<P>