Skip to main content

RenderableContent

Trait RenderableContent 

Source
pub trait RenderableContent {
    // Required methods
    fn get_dimensions(&self) -> (usize, usize);
    fn get_raw_content(&self) -> String;
    fn get_box_relative_sensitive_zones(&self) -> Vec<SensitiveZone>;
    fn handle_event(&mut self, event: &ContentEvent) -> EventResult;
}
Expand description

Universal content interface for all content types in BoxMux Enables unified overflow handling for text, choices, charts, and any future content types

Required Methods§

Source

fn get_dimensions(&self) -> (usize, usize)

Get the raw content dimensions before any transformations Returns (width, height) in character cells

Source

fn get_raw_content(&self) -> String

Get the raw content as a string - for backward compatibility with existing text rendering

Source

fn get_box_relative_sensitive_zones(&self) -> Vec<SensitiveZone>

Get sensitive zones in box-relative coordinates (0,0 = top-left of content area, ignoring borders) BoxRenderer will translate these to absolute screen coordinates accounting for scroll/wrap/centering

Source

fn handle_event(&mut self, event: &ContentEvent) -> EventResult

Handle a content event (click, hover, keypress, etc.) Event contains zone_id, position, and event-specific data Returns EventResult indicating how the event was processed

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§