lib-nested/nested/src/tree_nav.rs

54 lines
1 KiB
Rust
Raw Normal View History

2021-08-23 05:00:57 +02:00
use crate::list::ListCursorMode;
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum TreeNavResult {
Continue,
Exit
}
2021-08-23 05:00:57 +02:00
#[derive(Clone, Eq, PartialEq)]
pub struct TreeCursor {
pub leaf_mode: ListCursorMode,
pub tree_addr: Vec<usize>
}
pub trait TreeNav {
fn up(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
fn dn(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
fn pxev(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
fn nexd(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
fn goto_home(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
fn goto_end(&mut self) -> TreeNavResult {
TreeNavResult::Exit
}
2021-08-16 00:10:25 +02:00
2021-08-23 05:00:57 +02:00
fn goto(&mut self, new_cursor: Option<TreeCursor>) -> TreeNavResult {
TreeNavResult::Exit
}
2021-08-16 00:10:25 +02:00
2021-08-23 05:00:57 +02:00
fn get_cursor(&self) -> Option<TreeCursor> {
2021-08-16 00:10:25 +02:00
None
}
}
use crate::terminal::{TerminalView, TerminalEditor};
pub trait TerminalTreeEditor = TerminalEditor + TreeNav;