use std::cell::Cell;
use std::rc::Rc;
use super::TextField;
use crate::widgets::on_screen_keyboard::KeyboardInputMode;
impl TextField {
pub fn with_focus_id(mut self, id: crate::focus::FocusId) -> Self {
self.focus_request_id = Some(id);
self
}
pub fn with_keyboard_mode(self, mode: KeyboardInputMode) -> Self {
self.keyboard_mode.set(mode);
self
}
pub fn with_keyboard_mode_cell(mut self, cell: Rc<Cell<KeyboardInputMode>>) -> Self {
self.keyboard_mode = cell;
self
}
pub fn keyboard_mode(&self) -> KeyboardInputMode {
self.keyboard_mode.get()
}
pub fn set_keyboard_mode(&self, mode: KeyboardInputMode) {
self.keyboard_mode.set(mode);
}
pub fn keyboard_mode_handle(&self) -> Rc<Cell<KeyboardInputMode>> {
Rc::clone(&self.keyboard_mode)
}
}