fui_core 0.19.2

Core library of FUI MVVM UI Framework
Documentation
use std::rc::Rc;

use crate::common::*;
use crate::control::ControlObject;
use crate::events::*;
use crate::FuiDrawingContext;

pub trait ControlBehavior {
    fn setup(&self);

    fn parent_attached(&self);

    fn parent_detached(&self);

    fn handle_event(
        &self,
        drawing_context: &mut FuiDrawingContext,
        event_context: &mut dyn EventContext,
        event: ControlEvent,
    );
    fn measure(&self, drawing_context: &mut FuiDrawingContext, size: Size);
    fn set_rect(&self, drawing_context: &mut FuiDrawingContext, rect: Rect);
    fn get_rect(&self) -> Rect;

    fn hit_test(&self, point: Point) -> Option<Rc<dyn ControlObject>>;

    /// Draws control content.
    fn draw(&self, drawing_context: &mut FuiDrawingContext);
}