Skip to main content

rat_widget/
lib.rs

1#![doc = include_str!("../readme.md")]
2//
3#![allow(clippy::collapsible_else_if)]
4#![allow(clippy::collapsible_if)]
5#![allow(clippy::if_same_then_else)]
6#![allow(clippy::clone_on_copy)]
7#![allow(clippy::assigning_clones)]
8#![allow(clippy::question_mark)]
9#![allow(clippy::uninlined_format_args)]
10
11pub mod event {
12    //!
13    //! Event-handler traits and Keybindings.
14    //!
15    //! See [rat-event](https://docs.rs/rat-event/latest/rat_event/)
16    //!
17    pub use rat_event::*;
18
19    pub use crate::button::event::ButtonOutcome;
20    pub use crate::calendar::event::CalOutcome;
21    pub use crate::checkbox::event::CheckOutcome;
22    pub use crate::choice::event::ChoiceOutcome;
23    pub use crate::combobox::event::ComboboxOutcome;
24    pub use crate::file_dialog::event::FileOutcome;
25    pub use crate::form::event::FormOutcome;
26    pub use crate::radio::event::RadioOutcome;
27    pub use crate::slider::event::SliderOutcome;
28    pub use crate::tabbed::event::TabbedOutcome;
29    pub use rat_ftable::event::{DoubleClickOutcome, EditOutcome, TableOutcome};
30    pub use rat_ftable2::event::{
31        DoubleClickOutcome as DoubleClickOutcome2, TableOutcome as TableOutcome2,
32    };
33    pub use rat_menu::event::MenuOutcome;
34    pub use rat_popup::event::PopupOutcome;
35    pub use rat_scrolled::event::ScrollOutcome;
36    pub use rat_text::event::{ReadOnly, TextOutcome};
37}
38
39/// Module for focus-handling functionality.
40/// See [rat-focus](https://docs.rs/rat-focus)
41pub mod focus {
42    pub use rat_focus::{
43        Focus, FocusBuilder, FocusFlag, HasFocus, Navigation, handle_focus, impl_has_focus,
44        match_focus, on_gained, on_lost,
45    };
46}
47
48/// Layout calculations apart from ratatui/Layout.
49pub mod layout;
50
51/// Trait for relocatable widgets.
52/// See also [rat-reloc](https://docs.rs/rat-reloc/latest/rat_reloc/)
53pub mod reloc {
54    pub use rat_reloc::{
55        RelocatableState, impl_relocatable_state, relocate_area, relocate_areas,
56        relocate_pos_tuple, relocate_pos_tuple_opt, relocate_position, relocate_positions,
57    };
58}
59
60/// Scroll attribute and event-handling.
61/// See [rat-scrolled](https://docs.rs/rat-scrolled/latest/rat_scrolled/)
62pub mod scrolled {
63    pub use rat_scrolled::{
64        SCROLLBAR_DOUBLE_HORIZONTAL, SCROLLBAR_DOUBLE_VERTICAL, SCROLLBAR_HORIZONTAL,
65        SCROLLBAR_VERTICAL, Scroll, ScrollArea, ScrollAreaState, ScrollState, ScrollStyle,
66        ScrollSymbols, ScrollbarPolicy,
67    };
68}
69
70/// Text editing core functionality and utilities.
71pub mod text {
72    pub use rat_text::clipboard;
73    pub use rat_text::core;
74    pub use rat_text::cursor;
75    pub use rat_text::undo_buffer;
76    pub use rat_text::{
77        Cursor, Grapheme, HasScreenCursor, Locale, TextError, TextFocusGained, TextFocusLost,
78        TextPosition, TextRange, TextStyle, TextTab, impl_screen_cursor, ipos_type, screen_cursor,
79        upos_type,
80    };
81}
82
83// --- widget modules here --- (alphabetical)
84
85pub mod button;
86pub mod calendar;
87pub mod checkbox;
88pub mod choice;
89pub mod clipper;
90pub mod combobox;
91pub mod date_input;
92pub mod dialog_frame;
93pub mod file_dialog;
94pub mod form;
95pub mod hover;
96pub mod line_number;
97pub mod list;
98pub mod menu;
99pub mod msgdialog;
100pub mod number_input;
101pub mod paired;
102pub mod paragraph;
103pub mod popup;
104pub mod radio;
105pub mod range_op;
106pub mod shadow;
107pub mod slider;
108pub mod splitter;
109pub mod statusline;
110pub mod statusline_stacked;
111pub mod tabbed;
112pub mod table;
113pub mod table2;
114pub mod text_input;
115pub mod text_input_mask;
116pub mod textarea;
117pub mod toolbar;
118pub mod util;
119pub mod view;
120
121mod _private {
122    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
123    pub struct NonExhaustive;
124}