zellij_utils/opt/rustwide/workdir/assets/prost/api.input_mode.rs
1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct InputModeMessage {
4 #[prost(enumeration = "InputMode", tag = "1")]
5 pub input_mode: i32,
6}
7#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
8#[repr(i32)]
9pub enum InputMode {
10 /// / In `Normal` mode, input is always written to the terminal, except for the shortcuts leading
11 /// / to other modes
12 Normal = 0,
13 /// / In `Locked` mode, input is always written to the terminal and all shortcuts are disabled
14 /// / except the one leading back to normal mode
15 Locked = 1,
16 /// / `Resize` mode allows resizing the different existing panes.
17 Resize = 2,
18 /// / `Pane` mode allows creating and closing panes, as well as moving between them.
19 Pane = 3,
20 /// / `Tab` mode allows creating and closing tabs, as well as moving between them.
21 Tab = 4,
22 /// / `Scroll` mode allows scrolling up and down within a pane.
23 Scroll = 5,
24 /// / `EnterSearch` mode allows for typing in the needle for a search in the scroll buffer of a pane.
25 EnterSearch = 6,
26 /// / `Search` mode allows for searching a term in a pane (superset of `Scroll`).
27 Search = 7,
28 /// / `RenameTab` mode allows assigning a new name to a tab.
29 RenameTab = 8,
30 /// / `RenamePane` mode allows assigning a new name to a pane.
31 RenamePane = 9,
32 /// / `Session` mode allows detaching sessions
33 Session = 10,
34 /// / `Move` mode allows moving the different existing panes within a tab
35 Move = 11,
36 /// / `Prompt` mode allows interacting with active prompts.
37 Prompt = 12,
38 /// / `Tmux` mode allows for basic tmux keybindings functionality
39 Tmux = 13,
40}
41impl InputMode {
42 /// String value of the enum field names used in the ProtoBuf definition.
43 ///
44 /// The values are not transformed in any way and thus are considered stable
45 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
46 pub fn as_str_name(&self) -> &'static str {
47 match self {
48 InputMode::Normal => "Normal",
49 InputMode::Locked => "Locked",
50 InputMode::Resize => "Resize",
51 InputMode::Pane => "Pane",
52 InputMode::Tab => "Tab",
53 InputMode::Scroll => "Scroll",
54 InputMode::EnterSearch => "EnterSearch",
55 InputMode::Search => "Search",
56 InputMode::RenameTab => "RenameTab",
57 InputMode::RenamePane => "RenamePane",
58 InputMode::Session => "Session",
59 InputMode::Move => "Move",
60 InputMode::Prompt => "Prompt",
61 InputMode::Tmux => "Tmux",
62 }
63 }
64 /// Creates an enum from field names used in the ProtoBuf definition.
65 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
66 match value {
67 "Normal" => Some(Self::Normal),
68 "Locked" => Some(Self::Locked),
69 "Resize" => Some(Self::Resize),
70 "Pane" => Some(Self::Pane),
71 "Tab" => Some(Self::Tab),
72 "Scroll" => Some(Self::Scroll),
73 "EnterSearch" => Some(Self::EnterSearch),
74 "Search" => Some(Self::Search),
75 "RenameTab" => Some(Self::RenameTab),
76 "RenamePane" => Some(Self::RenamePane),
77 "Session" => Some(Self::Session),
78 "Move" => Some(Self::Move),
79 "Prompt" => Some(Self::Prompt),
80 "Tmux" => Some(Self::Tmux),
81 _ => None,
82 }
83 }
84}