pub struct StructuredRichUI(pub FltkStructuredRichDisplay);Expand description
NoteUI adapter for rutle’s Renderer + FLTK Group wrapper
Tuple Fields§
§0: FltkStructuredRichDisplayImplementations§
Source§impl StructuredRichUI
impl StructuredRichUI
pub fn new(x: i32, y: i32, w: i32, h: i32, edit_mode: bool) -> Self
pub fn has_selection(&self) -> bool
Sourcepub fn highlight_targets(&self) -> Vec<HighlightTarget>
pub fn highlight_targets(&self) -> Vec<HighlightTarget>
The web-view highlights mirroring the editor’s selection: one
HighlightTarget per top-level block (or list/checklist item) the
selection touches, in document order. Empty when there is no selection,
so a bare caret shows no highlight and double-clicking a word brings one
back.
Sourcepub fn cut_selection(&mut self) -> bool
pub fn cut_selection(&mut self) -> bool
Cut the current selection to the system clipboard (HTML + Markdown).
Returns true if there was a selection that was cut.
Sourcepub fn copy_selection(&self) -> bool
pub fn copy_selection(&self) -> bool
Copy the current selection to the system clipboard (HTML + Markdown).
Returns true if there was a selection that was copied.
pub fn paste_from_clipboard(&mut self)
pub fn undo(&mut self) -> bool
pub fn redo(&mut self) -> bool
pub fn clear_formatting(&mut self) -> bool
pub fn set_block_type(&mut self, block_type: BlockType) -> bool
pub fn toggle_quote(&mut self) -> bool
pub fn toggle_code_block(&mut self) -> bool
pub fn toggle_list(&mut self) -> bool
pub fn toggle_checklist(&mut self) -> bool
pub fn toggle_ordered_list(&mut self) -> bool
pub fn toggle_bold(&mut self) -> bool
pub fn toggle_italic(&mut self) -> bool
pub fn toggle_code(&mut self) -> bool
pub fn toggle_strikethrough(&mut self) -> bool
pub fn toggle_underline(&mut self) -> bool
pub fn toggle_highlight(&mut self) -> bool
pub fn current_block_type(&self) -> Option<BlockType>
Sourcepub fn current_heading_anchor(&self) -> Option<String>
pub fn current_heading_anchor(&self) -> Option<String>
The anchor slug of the heading the caret is currently inside, or None
when the caret is not in a heading. Duplicate headings are disambiguated
exactly as Self::scroll_to_anchor resolves them, so the slug links
back to this heading and not an earlier namesake.
Sourcepub fn scroll_to_anchor(&mut self, anchor: &str) -> bool
pub fn scroll_to_anchor(&mut self, anchor: &str) -> bool
Scroll so the heading whose anchor slug equals anchor sits near the top
of the viewport. Returns false if no heading matches.
Sourcepub fn scroll_to_block(&mut self, block_index: usize) -> bool
pub fn scroll_to_block(&mut self, block_index: usize) -> bool
Scroll so top-level block block_index sits near the top of the viewport.
The renderer exposes no public block→pixel mapping, so this moves the
caret into the target block and reuses the caret→pixel bridge
(cursor_content_y) after a layout pass. Returns false if the index is
out of range.
Sourcepub fn set_horizontal_padding(&mut self, padding: i32)
pub fn set_horizontal_padding(&mut self, padding: i32)
Set horizontal padding (for write room mode)
Sourcepub fn horizontal_padding(&self) -> i32
pub fn horizontal_padding(&self) -> i32
Get current horizontal padding
Sourcepub fn reveal_codes(&self) -> bool
pub fn reveal_codes(&self) -> bool
Whether reveal-codes mode is active (rutle’s inline-style tags, e.g.
[Bold>…<Bold], shown inline).
Sourcepub fn toggle_reveal_codes(&mut self) -> bool
pub fn toggle_reveal_codes(&mut self) -> bool
Toggle reveal-codes mode, returning the new state. This is purely a view change — not a document edit — so it deliberately skips the change/undo machinery; the tags appearing inline are their own feedback.
Sourcepub fn search(&mut self, term: &str) -> usize
pub fn search(&mut self, term: &str) -> usize
Perform a case-insensitive search for the given term
Sourcepub fn clear_search(&mut self)
pub fn clear_search(&mut self)
Clear the search state
Sourcepub fn search_matches(&self) -> Vec<SearchMatch>
pub fn search_matches(&self) -> Vec<SearchMatch>
Get all search matches
Sourcepub fn search_current_index(&self) -> Option<usize>
pub fn search_current_index(&self) -> Option<usize>
Get the current match index
Sourcepub fn next_match(&mut self) -> bool
pub fn next_match(&mut self) -> bool
Move to the next match
Sourcepub fn prev_match(&mut self) -> bool
pub fn prev_match(&mut self) -> bool
Move to the previous match
Sourcepub fn scroll_to_current_match(&mut self)
pub fn scroll_to_current_match(&mut self)
Scroll to make the current match visible
Sourcepub fn take_focus(&mut self)
pub fn take_focus(&mut self)
Focus the editor widget