//! What the user can ask of the shell, as GPUI actions: the callbacks of the //! Slint front end's `bind/servers.rs` that the desktop shell has (the first //! eleven below), and the shell's own affordances. A click dispatches the //! action ([`gpui_kit::Window::dispatch_action`]), the window's root view //! ([`crate::view::MainView`]) handles it, and the handler asks the root state //! ([`crate::app::AppState`]) for what the callback did in Slint: key bindings //! and menus come to the same handlers later. //! //! The voice page and the call bar add `show_voice_view`, the page's own //! buttons (the smaller stage, Leave) and the two affordances of the call bar //! whose pages come with later slices (Share, the voice settings), which are //! logged. //! //! The channel tree and the members panel add `join_channel`, //! `join_with_password`, `toggle_collapse`, `search_members`, `open_member` and //! `open_client` (the last one only logs: the client's volume dialog is a //! dialog of its own slice). The callbacks of `bind/servers.rs` that are //! still not here belong to the slices after: `client_audio_changed` to the //! dialogs, and `copied` (the toast that follows a copy) to whichever copies: //! [`Invite`] sets it itself. use gpui_kit::{Action, actions}; actions!( voelin, [ /// `connect_voice`: connect the server on screen with voice, into its default channel. ConnectVoice, /// `disconnect_voice`: leave voice on the server on screen. DisconnectVoice, /// `invite`: copy a link to the voice channel we are in. Invite, /// `save_bookmark`: save the server form (the form's own Save button). SaveServer, /// `save_and_connect`: save the server form, then connect. SaveAndConnect, /// Open the empty server form (the rail's plus button). AddServer, /// Close the server form without saving. CancelServerForm, /// The top bar's search box: the search comes with its slice, today it is logged. OpenSearch, /// The settings buttons: the settings come with their slice, today it is logged. OpenSettings, /// `join_with_password`: the password prompt's Join, with what it holds. SubmitChannelPassword, /// Close the password prompt without joining. CancelChannelPassword, /// The voice page's Leave (`Nav.show-voice(false)` then `disconnect_voice`). LeaveVoice, /// The voice page's Smaller stage / Larger stage (`ui.voice_compact`). ToggleVoiceCompact, /// The call bar's Share: the share menu comes with the stream slices, today it is logged. OpenShare, /// The call bar's voice settings: the settings come with their slice, today it is logged. OpenVoiceSettings, ] ); /// `show_voice_view`: the voice channel page on (the main area) or off (back to /// the server page, where the chat will be). #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct ShowVoiceView { /// Shown from now on. pub on: bool, } /// `select_server`: show a server (and observe it). #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct SelectServer { /// The bookmark's id. pub id: i64, } /// `edit_bookmark`: open the server form with a saved server. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct EditServer { /// The bookmark's id. pub id: i64, } /// `delete_bookmark`: remove a server. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct DeleteServer { /// The bookmark's id. pub id: i64, } /// `set_input_muted`: mute or unmute our microphone. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct SetInputMuted { /// Muted from now on. pub muted: bool, } /// `set_output_muted`: mute or unmute the sound. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct SetOutputMuted { /// Muted from now on. pub muted: bool, } /// `push_to_talk`: transmit while the hold-to-talk button is held. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct PushToTalk { /// Transmitting from now on. pub on: bool, } /// `join_channel`: join a channel of the server on screen (a double-click on /// its row, the context menu's Join). #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct JoinChannel { /// The channel's id on the server. pub channel: u64, } /// A click on a channel's row: select it (the Slint tree opens the channel's /// chat, which comes with the chat slice). #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct SelectChannel { /// The channel's id on the server. pub channel: u64, } /// `toggle_collapse`: fold or unfold a channel of the tree. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct ToggleChannel { /// The channel's id on the server. pub channel: u64, } /// The context menu's Edit channel: the channel editor is a slice of its own, /// today it is logged. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct EditChannel { /// The channel's id on the server. pub channel: u64, } /// The context menu's Move to my channel: moving another client needs a command /// the engine does not have yet, so today it is logged. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct MoveClient { /// The client's id on the server. pub client: u16, } /// `open_client`: a click on a person in the tree opens their volume dialog, /// which is a dialog of its own slice: today it is logged. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct OpenClient { /// The client's id on the server. pub client: u16, } /// `search_members`: the members panel's search text. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct SearchMembers { /// What the box holds; empty shows everyone. pub text: String, } /// `open_member`: open the card of a person over the members panel; -1 closes it. #[derive(Clone, Debug, PartialEq, Action)] #[action(namespace = voelin, no_json)] pub struct OpenMember { /// The client's id on the server, or -1. pub client: i32, }