use egui::{text::LayoutJob, Color32, FontId, Rect, Response, Ui, Vec2};
pub trait LinkHandler {
fn link_style(&self, _href: &str) -> Option<LinkStyle> {
None
}
fn click(&self, _text: &str, _href: &str, _ui: &mut Ui) -> bool {
false
}
fn layout_link(&self, _text: &str, _href: &str, _job: &mut LayoutJob, _font: &FontId, _color: Color32) -> bool {
false
}
fn inline_widget_size(&self, _href: &str, _font: &FontId) -> Option<Vec2> {
None
}
fn paint_inline_widget(&self, _ui: &mut Ui, _text: &str, _href: &str, _rect: Rect) {}
fn is_block_widget(&self, _href: &str) -> bool {
false
}
fn block_widget(&self, _ui: &mut Ui, _text: &str, _href: &str) -> Option<Response> {
None
}
fn id(&self) -> u64 {
0
}
}
pub struct LinkStyle {
pub color: Option<Color32>,
pub underline: bool,
}