Trait modalkit_ratatui::WindowOps
source · pub trait WindowOps<I: ApplicationInfo>: TerminalCursor {
// Required methods
fn dup(&self, store: &mut Store<I>) -> Self;
fn close(&mut self, flags: CloseFlags, store: &mut Store<I>) -> bool;
fn draw(
&mut self,
area: Rect,
buf: &mut Buffer,
focused: bool,
store: &mut Store<I>
);
fn get_completions(&self) -> Option<CompletionList>;
fn get_cursor_word(&self, style: &WordStyle) -> Option<String>;
fn get_selected_word(&self) -> Option<String>;
fn write(
&mut self,
path: Option<&str>,
flags: WriteFlags,
store: &mut Store<I>
) -> UIResult<EditInfo, I>;
}
Expand description
Trait to allow widgets to control how they get drawn onto the screen when they are either focused or unfocused.
Required Methods§
sourcefn dup(&self, store: &mut Store<I>) -> Self
fn dup(&self, store: &mut Store<I>) -> Self
Create a copy of this window during a window split.
sourcefn close(&mut self, flags: CloseFlags, store: &mut Store<I>) -> bool
fn close(&mut self, flags: CloseFlags, store: &mut Store<I>) -> bool
Perform any necessary cleanup for this window and close it.
If this function returns false, it’s because the window cannot be closed, at least not with the provided set of flags.
sourcefn draw(
&mut self,
area: Rect,
buf: &mut Buffer,
focused: bool,
store: &mut Store<I>
)
fn draw( &mut self, area: Rect, buf: &mut Buffer, focused: bool, store: &mut Store<I> )
Draw this window into the buffer for the prescribed area.
sourcefn get_completions(&self) -> Option<CompletionList>
fn get_completions(&self) -> Option<CompletionList>
Get completion candidates to show the user.
sourcefn get_cursor_word(&self, style: &WordStyle) -> Option<String>
fn get_cursor_word(&self, style: &WordStyle) -> Option<String>
Returns the word following the current cursor position in this window.
sourcefn get_selected_word(&self) -> Option<String>
fn get_selected_word(&self) -> Option<String>
Returns the currently selected text in this window.
Object Safety§
This trait is not object safe.