//! The bridge structs: the rows and forms the screens show, as plain //! values. They mirror the Slint structs of `crates/voelin-ui/ui/bridge.slint` //! field by field (strings are shared `Arc`, pictures [`ImageRef`], //! colours [`Rgb`], lists `Vec`); the Slint crate converts them //! (`bind/convert.rs`), the GPUI client will render them as they are. //! `MytsBadge` and `MytsForm` (account screens without a data source in this //! build) stay in Slint. //! //! Every field is documented here: the comments of `bridge.slint` were //! carried over, and the fields that had none were described from the code //! that fills them. use std::sync::Arc; use crate::color::Rgb; use crate::image::ImageRef; /// A row or form of the bridge (the plain counterpart of the Slint struct `ServerItem`). #[derive(Clone, Debug, Default, PartialEq)] pub struct ServerItem { /// The bookmark's id, which is the session's too. pub id: i32, /// The server's name. pub name: Arc, /// The address the bookmark connects to. pub address: Arc, /// "offline", "connecting", "observing" or "connected" pub status: Arc, /// Avatar of a server without an icon. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// The server's icon, empty without one. pub icon: ImageRef, /// Unread messages in its chats. pub unread: i32, /// Someone streams in our channel there. pub live: bool, /// "9 online · 7 channels" while its presence is known, else the address. pub detail: Arc, /// "TeamSpeak 6", "TeamSpeak 3", "" before it was reached. pub product: Arc, /// Gateway or query credentials: presence without joining. pub gateway: bool, } /// A row or form of the bridge (the plain counterpart of the Slint struct `TreeItem`). #[derive(Clone, Debug, Default, PartialEq)] pub struct TreeItem { /// A channel; else a client. pub is_channel: bool, /// A TeamSpeak spacer channel, its name without the `[cspacer1]` part: /// 0 none, 1 left, 2 centred, 3 right, 4 a line (the name repeats its /// pattern across the row). pub spacer: i32, /// How far the row is indented: its level in the tree. pub depth: i32, /// The channel's or the client's id on the server. pub id: i32, /// A channel's name (a spacer's text, without its `[cspacer1]` part) or a client's nickname. pub name: Arc, /// Our own channel (channels). pub own: bool, /// The client is speaking. pub talking: bool, /// The client's microphone is muted. pub muted: bool, /// The client's speakers are muted. pub sound_off: bool, /// The client is away. pub away: bool, /// The client streams. pub streaming: bool, /// The channel needs a password. pub locked: bool, /// The channel's contents are hidden. pub collapsed: bool, /// Local playback of this client: muted, or its volume in percent /// (100 = unchanged). pub local_muted: bool, /// Its local volume in percent; 100 is unchanged. pub local_volume: i32, /// Our own client. pub myself: bool, /// Avatar of a client. pub initials: Arc, /// The colour of the client's avatar. pub tint: Rgb, /// The client's avatar picture, empty without one. pub avatar: ImageRef, /// Channels: clients inside, and the limit (-1: none). pub members: i32, /// The channel's limit of clients; -1: none. pub max_members: i32, /// Leading channel icon or trailing client icons, empty where absent: a channel's /// icon; a client's server group icons, its channel group's and its own, /// in that order (the first three). pub icon: ImageRef, /// The second icon, as `icon`. pub icon_2: ImageRef, /// The third icon, as `icon`. pub icon_3: ImageRef, /// A client's badges (myTeamSpeak), the first three in its order, empty /// where absent; shown after the name. pub badge: ImageRef, /// The second badge, as `badge`. pub badge_2: ImageRef, /// The third badge, as `badge`. pub badge_3: ImageRef, /// A channel's banner picture (TeamSpeak 6), drawn behind the row; /// Wire sizing metadata; compact decorative backgrounds always cover. pub banner: ImageRef, /// How the server sizes the banner: 0 as it is, 1 stretched, 2 scaled keeping the aspect ratio. pub banner_mode: i32, } /// A client for the members panel (everyone on the server) and the voice /// channel view (our channel). #[derive(Clone, Debug, Default, PartialEq)] pub struct MemberItem { /// The client's id on the server. pub id: i32, /// Its nickname. pub name: Arc, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// Its avatar picture, empty without one. pub avatar: ImageRef, /// It is speaking. pub talking: bool, /// Its microphone is muted. pub muted: bool, /// Its speakers are muted. pub sound_off: bool, /// It is away. pub away: bool, /// It streams. pub streaming: bool, /// Our own client. pub myself: bool, /// "Speaking", "Streaming", "Away", ... pub status: Arc, /// The away message, empty without one. pub away_message: Arc, /// The section the row is in (a server group, "In Voice", /// "Streaming"), and the group's icon. pub group: Arc, /// The section's icon, empty where it has none. pub group_icon: ImageRef, /// The first row of its section draws the heading, with the number of /// rows in the section. pub first_in_group: bool, /// The number of rows in its section. pub group_count: i32, /// Badges: a crown for the server's admin groups. pub admin: bool, /// A moderator group's name, shown as a role next to the name. pub role: Arc, /// It is a priority speaker. pub priority: bool, /// It is a channel commander. pub commander: bool, /// It is recording the conversation. pub recording: bool, /// Its channel needs more talk power than it has (and it is no /// talker): it cannot speak. pub cannot_talk: bool, /// myTeamSpeak badges, as in `TreeItem`. pub badge: ImageRef, /// The second badge. pub badge_2: ImageRef, /// The third badge. pub badge_3: ImageRef, } /// A myTeamSpeak badge on the member card: "Badge" and its GUID for one /// the app does not know; its picture is empty until it is downloaded. #[derive(Clone, Debug, Default, PartialEq)] pub struct BadgeItem { /// The badge's name. pub name: Arc, /// What the badge says of its holder. pub description: Arc, /// The badge's picture, empty until it is downloaded. pub icon: ImageRef, } /// The member card over a member row: everything about one client and what /// can be done with them. #[derive(Clone, Debug, Default, PartialEq)] pub struct MemberCard { /// The card is shown. pub open: bool, /// The client's id on the server. pub id: i32, /// Its nickname. pub name: Arc, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// Its avatar picture, empty without one. pub avatar: ImageRef, /// What it does: "Speaking", "Streaming", "Away", ... (as `MemberItem::status`). pub status: Arc, /// The description the client set. pub description: Arc, /// Server groups, one per line. pub groups: Vec>, /// The badges the client shows (at most three, in its order). pub badges: Vec, /// The country the server reports for it, empty if none. pub country: Arc, /// Its talk power. pub talk_power: i32, /// It is one of our friends. pub friend: bool, /// It is a blocked contact. pub blocked: bool, /// Local playback, in percent. pub volume: f32, /// Its voice is muted for us (local playback). pub muted: bool, /// The client has a unique id, so contacts and private chats work. pub known: bool, /// The client streams: the card offers to watch it. pub streaming: bool, } /// A row or form of the bridge (the plain counterpart of the Slint struct `ChatTab`). #[derive(Clone, Debug, Default, PartialEq)] pub struct ChatTab { /// "Lobby", "@alice", "Server" pub title: Arc, /// The name alone ("Lobby"). pub name: Arc, /// 0 = server chat, 1 = channel chat, 2 = private chat pub kind: i32, /// A channel chat's channel id; 0 for the others. pub id: i32, /// How many of its messages are unread. pub unread: i32, /// The channel's topic (channel chats). pub topic: Arc, /// The last message ("Mira: the banner I promised") and its time. pub last: Arc, /// The time of the last message. pub time: Arc, /// The channel's banner picture behind the chat's header (as TreeItem). pub banner: ImageRef, /// As `TreeItem::banner_mode`. pub banner_mode: i32, } /// A piece of a chat line: a word in its style, or an emoji shown as an /// image (`emoji` is its Twemoji key, e.g. "1f600"; `text` then holds the /// characters). #[derive(Clone, Debug, Default, PartialEq)] pub struct TextRun { /// The characters of the run. pub text: Arc, /// The Twemoji key if the run is an emoji, else empty. pub emoji: Arc, /// In bold. pub bold: bool, /// In italics. pub italic: bool, /// Underlined. pub underline: bool, /// Struck through. pub strike: bool, /// Code: on a background. pub code: bool, /// The author's colour, made readable on each theme; transparent: the /// text's own. pub ink_dark: Option, /// The author's colour made readable on the light theme (`ink_dark`: the dark one). pub ink_light: Option, /// Where it links to ("": nowhere), and whether its text shows something /// else (a page's name, another address): asked about before it opens. pub link: Arc, /// Its text shows something else than the address it links to. pub masked: bool, } /// A block of a chat line (`vm::bbcode`): its runs, and what it is. #[derive(Clone, Debug, Default, PartialEq)] pub struct TextBlock { /// The pieces of the block, in order. pub runs: Vec, /// 0 = a line, 1 = a quote's line, 2 = a line of code, 3 = a list item, /// 4 = a rule (no runs) pub kind: i32, /// Who a quote quotes, on its first line. pub caption: Arc, } /// One emoji under a message, with how many put it there. #[derive(Clone, Debug, Default, PartialEq)] pub struct ReactionItem { /// The Twemoji key of the first emoji in `text` ("1f389"), for the image. pub key: Arc, /// The emoji, as text. pub text: Arc, /// How many reacted with it. pub count: i32, /// We reacted with it. pub me: bool, } /// A file linked in a message (`ChatMessage::file_refs`). #[derive(Clone, Debug, Default, PartialEq)] pub struct FileItem { /// The file's name. pub name: Arc, /// "2.4 MB", or what the transfer is doing. pub detail: Arc, /// Index of the link in the message (what `download-file` takes). pub index: i32, /// "", "running", "done", "failed" pub state: Arc, /// 0 … 1 while it downloads. pub progress: f32, /// A picture, so the icon differs. pub picture: bool, /// The picture itself, once downloaded: shown inline instead of the card. pub preview: ImageRef, } /// A row or form of the bridge (the plain counterpart of the Slint struct `ChatLine`). #[derive(Clone, Debug, Default, PartialEq)] pub struct ChatLine { /// A handle for this message in its chat, stable while the chat is open /// (the engine's ids do not fit a Slint int). pub key: i32, /// The author's name. pub author: Arc, /// The text without formatting, a line per block (shown as it is when /// the message has neither formatting nor emoji, and read out). pub text: Arc, /// When it was sent, as shown ("11:42"). pub time: Arc, /// The text in blocks of styled runs; only filled when it has /// formatting or emoji (`rich`). pub blocks: Vec, /// The blocks are shown, not `text`. pub rich: bool, /// Only one to three emoji: shown large. pub jumbo: bool, /// Same author as the line before, shortly after: no header. pub continued: bool, /// The initials of the author's avatar. pub initials: Arc, /// The colour of the author's avatar. pub tint: Rgb, /// The author's avatar picture, empty without one. pub avatar: ImageRef, /// From a blocked contact. pub blocked: bool, /// The message is pinned. pub pinned: bool, /// The reactions to it. pub reactions: Vec, /// The files it links to. pub files: Vec, /// The gateway knows this message: it can be pinned, reacted to and /// made into a topic. pub remote: bool, /// The topic it belongs to, "" outside a topic. pub topic: Arc, /// Highlighted after jumping to it from the pins. pub marked: bool, /// The first web address it links to, "" if none. pub link: Arc, /// The first new message: the "New" divider is above it (never /// `continued`). pub unread_start: bool, } /// A pinned message in the pins drawer. #[derive(Clone, Debug, Default, PartialEq)] pub struct PinItem { /// The pinned message. pub line: ChatLine, /// "pinned by Nova · 12:04" pub by: Arc, } /// A gateway topic (thread). #[derive(Clone, Debug, Default, PartialEq)] pub struct TopicItem { /// The topic's id on the gateway. pub id: i32, /// Its title. pub title: Arc, /// Who started it. pub creator: Arc, /// "12 messages · by Nova" pub detail: Arc, /// "Last active 3 min ago", and whether that was within the hour. pub activity: Arc, /// It was active within the hour. pub recent: bool, /// It is archived. pub archived: bool, } /// The server dialog: a bookmark (id -1: a new one) and, from a link, where /// Connect goes. #[derive(Clone, Debug, Default, PartialEq)] pub struct BookmarkForm { /// The bookmark's id; -1: a new one. pub id: i32, /// The name, empty to use the address. pub name: Arc, /// The server's address. pub address: Arc, /// The nickname to connect with. pub nickname: Arc, /// The server's password. pub server_password: Arc, /// The server has voice: no Connect. pub connected: bool, /// From a link, not stored with the server: the channel to join (a /// path, or `/`), its password and a privilege key. pub channel: Arc, /// The password of the channel to join. pub channel_password: Arc, /// A privilege key to use on joining. pub token: Arc, } /// A stream on the server, ours first: a stream can be watched from any /// channel. An empty id: a client that streams, but whose stream is still /// being looked up (it started before we joined, or in another channel). #[derive(Clone, Debug, Default, PartialEq)] pub struct StreamItem { /// The stream's id; empty while it is looked up. pub id: Arc, /// The stream's title. pub name: Arc, /// The streamer's name. pub streamer: Arc, /// The streamer's channel when it is not ours; empty in ours. pub channel: Arc, /// The streamer's client id (their avatar in the members). pub streamer_id: i32, /// The streamer's avatar, as the members show it: their picture, or /// their initials on their colour (also the card's picture's colour). pub initials: Arc, /// The colour of the streamer's avatar. pub tint: Rgb, /// The streamer's picture, empty without one. pub avatar: ImageRef, /// How many watch it (the gateway's directory; 0 unknown). pub viewers: i32, /// The stream has sound. pub audio: bool, /// "Screen", "Window", "Camera"; and the announced bitrate ("8 Mbit/s"). pub kind: Arc, /// The announced bitrate, "8 Mbit/s". pub bitrate: Arc, /// Shown in the viewer. pub watching: bool, /// Our own stream. pub own: bool, /// Ours from the Stream Studio: its preview is the card's picture. pub studio: bool, } /// A viewer of our stream. state: "requested", "connecting" or "connected". #[derive(Clone, Debug, Default, PartialEq)] pub struct ViewerItem { /// The viewer's client id. pub client: i32, /// The viewer's name. pub name: Arc, /// "requested", "connecting" or "connected". pub state: Arc, /// The message of its request to watch. pub message: Arc, /// Their avatar picture, empty without one. pub avatar: ImageRef, } /// A capture source for the share dialog. #[derive(Clone, Debug, Default, PartialEq)] pub struct SourceItem { /// The source's name. pub name: Arc, /// The line under the name. pub detail: Arc, } /// A row or form of the bridge (the plain counterpart of the Slint struct `ShareForm`). #[derive(Clone, Debug, Default, PartialEq)] pub struct ShareForm { /// Index into the sources offered (`SourceItem`). pub source: i32, /// The stream's title. pub name: Arc, /// Index into the frame rate choices (15, 30, 60, 120, 144, 240, 320). pub fps_index: i32, /// Frames per second as typed; a choice fills it in. Any number above 0. pub fps: Arc, /// Index into the bitrate choices (Auto, 2.5, 4.6, 8, 10, 20, 40, 60 /// Mbit/s). pub bitrate_index: i32, /// Video bitrate in kbit/s as typed; a choice fills it in. Empty with /// Auto: from the size and frame rate shared, up to 60 Mbit/s. pub bitrate: Arc, /// The stream carries sound too. pub audio: bool, /// Viewers are let in without being asked. pub auto_accept: bool, } /// A row or form of the bridge (the plain counterpart of the Slint struct `AudioForm`). #[derive(Clone, Debug, Default, PartialEq)] pub struct AudioForm { /// 0 = system default, then the devices. pub input_index: i32, /// As `input_index`, for the output device. pub output_index: i32, /// 0 = push-to-talk, 1 = voice activation, 2 = continuous. pub transmit: i32, /// dBFS. pub vad_threshold: f32, /// Echo cancellation is on. pub echo_cancellation: bool, /// Noise suppression is on. pub noise_suppression: bool, /// 0 = low ... 3 = very high. pub noise_level: i32, /// Automatic gain control is on. pub auto_gain: bool, /// dB. pub input_gain: f32, /// Percent. pub output_volume: f32, /// Milliseconds. pub playback_buffer: f32, } /// Local playback settings of one client. volume in percent. #[derive(Clone, Debug, Default, PartialEq)] pub struct ClientAudio { /// The client's id on the server. pub id: i32, /// Its nickname. pub name: Arc, /// Its playback volume in percent. pub volume: f32, /// Its playback is muted. pub muted: bool, /// The client streams: the dialog offers to watch it. pub streaming: bool, } /// The appearance settings (`ui.*` keys). #[derive(Clone, Debug, Default, PartialEq)] pub struct AppearanceForm { /// "dark", "light" or "system" pub theme: Arc, /// The factor the text size is scaled by; 1 is normal. pub font_scale: f32, /// Pixels. pub narrow_breakpoint: f32, /// Memory for decoded pictures in MB; 0 keeps none. pub image_cache_mb: f32, } /// A contact (friend, blocked or neutral) and where they are now. #[derive(Clone, Debug, Default, PartialEq)] pub struct ContactItem { /// The contact's unique id. pub uid: Arc, /// The contact's name. pub name: Arc, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// Its avatar picture, empty without one. pub avatar: ImageRef, /// "friend", "blocked" or "neutral" pub relation: Arc, /// A session sees them. pub online: bool, /// They are away. pub away: bool, /// They stream. pub streaming: bool, /// What they do: "In Chill Zone", "Streaming", "Away: brb", "Offline". pub status: Arc, /// Where: the server of the first session that sees them, or "Last seen /// 2 h ago on Nightfall Guild". pub place: Arc, /// "12m ago": online since (this run), else when last seen. pub when: Arc, /// Our note about them. pub note: Arc, /// Local playback in percent. pub volume: f32, /// Their voice is muted for us. pub muted: bool, /// "Contact since 14 Jan 2022". pub since: Arc, /// Every session that sees them: "Nightfall Guild · Chill Zone". pub spots: Vec>, /// A voice connection sees them: they can be messaged, poked, joined. pub reachable: bool, /// They are the contact the friends page shows in full. pub selected: bool, } /// A live stream on one of our servers (home page). #[derive(Clone, Debug, Default, PartialEq)] pub struct LiveItem { /// The session (bookmark id) and the stream (directory or stream id). pub session: i32, /// The stream's id in the directory or on the voice connection. pub id: Arc, /// The stream's title. pub title: Arc, /// The streamer's name. pub streamer: Arc, /// The initials of the streamer's avatar. pub initials: Arc, /// The colour of the streamer's avatar. pub tint: Rgb, /// The streamer's picture, empty without one. pub avatar: ImageRef, /// The server's name. pub server: Arc, /// The channel's name. pub channel: Arc, /// 0: unknown. pub viewers: i32, /// "Screen", "Camera", ... pub kind: Arc, /// The server's colour, for the card's picture. pub backdrop: Rgb, /// In our voice channel: it can be watched at once. pub watchable: bool, } /// A chat in the recent chats and in the direct messages list. #[derive(Clone, Debug, Default, PartialEq)] pub struct ConversationItem { /// Index in Rust's list (what `open-conversation` takes). pub key: i32, /// 0 server chat, 1 channel chat, 2 private chat, 3 offline message. pub kind: i32, /// The chat's title: the channel's or the person's name, or the server's. pub title: Arc, /// The server's name. pub server: Arc, /// "You: That works!", "Sent a file". pub preview: Arc, /// "11:42", "Yesterday", "Mon", "12 Mar". pub time: Arc, /// "10m ago". pub ago: Arc, /// How many of its messages are unread. pub unread: i32, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// Its picture, empty without one. pub avatar: ImageRef, /// The other person is online (private chats). pub online: bool, /// It is the conversation that is open. pub selected: bool, } /// A notification of the bell. #[derive(Clone, Debug, Default, PartialEq)] pub struct NoticeItem { /// What the rows call the notice. pub key: i32, /// "mention", "poke", "message", "event", "friend" pub kind: Arc, /// The headline. pub title: Arc, /// The line under it. pub body: Arc, /// "3 min ago" pub time: Arc, /// It was not opened or marked read. pub unread: bool, /// The initials of the avatar it shows. pub initials: Arc, /// The colour of that avatar. pub tint: Rgb, /// The avatar picture it shows, empty without one. pub avatar: ImageRef, } /// A result of the search (Ctrl+K). #[derive(Clone, Debug, Default, PartialEq)] pub struct SearchItem { /// "server", "channel", "person", "contact", "setting" pub kind: Arc, /// What the result is called. pub title: Arc, /// The line under it. pub subtitle: Arc, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// Its picture, empty without one. pub avatar: ImageRef, /// The first result of a group names it ("Servers", "People", ...). pub header: Arc, } /// Something on our servers: an event, a scheduled stream or server news. #[derive(Clone, Debug, Default, PartialEq)] pub struct HappeningItem { /// "event", "stream", "news" pub kind: Arc, /// The event's or stream's title, or the news' headline. pub title: Arc, /// The line under it, with the server's name. pub subtitle: Arc, /// "Sat 26 Apr · 19:00" pub when: Arc, /// The session (bookmark id) it is on. pub session: i32, /// The event's id on the gateway; 0: news. pub id: i32, /// Its stream is live. pub live: bool, } /// Home's "Continue where you left off": the voice channel we were in last. #[derive(Clone, Debug, Default, PartialEq)] pub struct ResumeItem { /// There is one: its server is still a bookmark at the same address. pub shown: bool, /// The server's bookmark id. pub server_id: i32, /// The server's name. pub server: Arc, /// The initials of its avatar. pub initials: Arc, /// The colour of its avatar. pub tint: Rgb, /// The server's icon, empty without one. pub icon: ImageRef, /// The channel's name as the tree shows it. pub channel: Arc, /// Voice is connected there: the button shows the server; else it /// connects into the channel. pub open: bool, /// The server is connecting now. pub connecting: bool, } /// A scheduled event of a server's gateway. #[derive(Clone, Debug, Default, PartialEq)] pub struct EventItem { /// The event's id on the gateway. pub id: i32, /// The event's title. pub title: Arc, /// Its description. pub description: Arc, /// The date block: "SAT", "26", "APR". pub weekday: Arc, /// The day of the month, in the date block. pub day: Arc, /// The month, abbreviated, in the date block. pub month: Arc, /// "Sat 26 Apr, 19:00 – 21:00" pub when: Arc, /// "Raid Night" or "Server-wide". pub place: Arc, /// A scheduled stream: "Exploring the Lands Between · Elden Ring". pub stream: Arc, /// Its stream is live. pub live: bool, /// How many go. pub going: i32, /// How many may go. pub maybe: i32, /// How many do not go. pub not_going: i32, /// "going", "maybe", "not_going" or "". pub rsvp: Arc, /// Who made it. pub creator: Arc, /// We may edit and delete it (ours, or we moderate). pub editable: bool, /// "Starts in 15 min", "Started 5 min ago", "". pub soon: Arc, /// "Nova (going)", ...; filled once the event was opened. pub attendees: Vec>, /// Its details are open. pub expanded: bool, } /// The event form (create or edit). #[derive(Clone, Debug, Default, PartialEq)] pub struct EventForm { /// -1: a new event. pub id: i32, /// The event's title. pub title: Arc, /// Its description. pub description: Arc, /// "2026-10-04 19:00", local time. pub start: Arc, /// Empty: no end. pub end: Arc, /// Index into `event-channels` (0: server-wide). pub channel: i32, /// It is a scheduled stream. pub stream: bool, /// The scheduled stream's title. pub stream_title: Arc, /// The game or category it shows. pub game: Arc, } /// An offline message to write (mail the server keeps). #[derive(Clone, Debug, Default, PartialEq)] pub struct OfflineForm { /// The peer's unique id and name. pub uid: Arc, /// The recipient's name. pub to: Arc, /// The message's subject. pub subject: Arc, /// The message's text. pub text: Arc, } /// The open direct message: who, and what can be done. #[derive(Clone, Debug, Default, PartialEq)] pub struct DmPeer { /// A conversation is open. pub open: bool, /// The peer's unique id. pub uid: Arc, /// The peer's name. pub name: Arc, /// The initials of their avatar. pub initials: Arc, /// The colour of their avatar. pub tint: Rgb, /// Their avatar picture, empty without one. pub avatar: ImageRef, /// They are online on one of our servers. pub online: bool, /// "Online · Nightfall Guild · Chill Zone", "Offline · last seen 2 h ago". pub status: Arc, /// The description they set. pub description: Arc, /// Their server groups. pub groups: Vec>, /// Our note about them. pub note: Arc, /// "Contact since 14 Jan 2022"; empty for no contact. pub since: Arc, /// Where they are now, or where they were last seen. pub servers: Vec>, /// Pictures linked in the conversation that are downloaded, newest /// first (at most six; `media-more` counts the others), and the other /// files: name, "2.4 MB · Today at 11:36", picture. pub media: Vec, /// How many pictures there are besides the ones in `media`. pub media_more: i32, /// The other files linked in the conversation. pub files: Vec, /// They are a friend. pub friend: bool, /// They are blocked. pub blocked: bool, /// Their local volume in percent. pub volume: f32, /// Their voice is muted for us. pub muted: bool, /// Messages can be sent now (a voice connection that sees them). pub can_send: bool, /// Why not: "Kairo is offline.", "Connect to Nightfall Guild to send." pub notice: Arc, /// The server keeps offline messages: offer one. pub offline: bool, /// Connect with voice to the server of this conversation. pub can_connect: bool, /// The messages come from the store, without a session: read-only. pub stored: bool, /// An offline message is shown instead of the conversation. pub mail: bool, /// The open offline message's subject. pub mail_subject: Arc, /// Its text, empty until the server has sent it. pub mail_text: Arc, /// When it was sent. pub mail_time: Arc, } /// An identity (Profiles page); never its key. #[derive(Clone, Debug, Default, PartialEq)] pub struct IdentityItem { /// The identity's id in the store. pub id: i32, /// The identity's name. pub name: Arc, /// Unique ids on TeamSpeak 3 and TeamSpeak 6 servers. pub uid: Arc, /// Its unique id on TeamSpeak 6 servers. pub uid6: Arc, /// The security level of its key. pub level: i32, /// The store's default: servers see us as this one unless a bookmark /// names another. pub default: bool, /// Where it came from: "Made in Voelin", "Imported", "Chosen by you". pub origin: Arc, /// Raising its level: the level aimed at and the best one reached (0: no). pub improving: i32, /// The best level reached so far while it is raised. pub reached: i32, /// The bookmarks that use it. pub used_by: Arc, } /// An identity found in another client's files (import). #[derive(Clone, Debug, Default, PartialEq)] pub struct FoundIdentity { /// The identity's name. pub name: Arc, /// Its unique id. pub uid: Arc, /// The security level of its key. pub level: i32, /// The other client's file it was found in. pub source: Arc, /// Already in our identities. pub known: bool, /// It is chosen for the import. pub picked: bool, } /// A bookmark and the identity it connects with (Profiles page). #[derive(Clone, Debug, Default, PartialEq)] pub struct BookmarkIdentity { /// The bookmark's id. pub id: i32, /// The bookmark's name. pub name: Arc, /// Index into `identity-names` (0: the default identity). pub identity: i32, } /// Camera, video and stream quality (Voice & Video page). #[derive(Clone, Debug, Default, PartialEq)] pub struct VideoForm { /// Index into `cameras`. pub camera: i32, /// 0 none, 1 blur. pub background: i32, /// "auto", "1280x720", ... pub resolution: Arc, /// `stream.fps` as typed. pub fps: Arc, /// auto, vp8, vp9, h264, av1. pub codec: i32, /// Hardware video encoders are used where there are some. pub hardware: bool, /// The camera picture is mirrored. pub mirror: bool, /// everyone, friends, channel, nobody. pub permissions: i32, /// 0 auto, 1 720p, 2 1080p, 3 1440p, -1 other layers. pub quality: i32, /// kbit/s. pub bitrate: f32, /// The camera preview runs. pub preview: bool, } /// A simulcast layer of our stream (Streaming page); numbers as typed. #[derive(Clone, Debug, Default, PartialEq)] pub struct LayerItem { /// "1920x1080", or a scale like "0.5". pub size: Arc, /// Frames per second; "" no cap. pub fps: Arc, /// kbit/s. pub bitrate: Arc, /// kbit/s a viewer needs for the layer. pub min_bitrate: Arc, /// kbit/s the layer may use at most, not below `bitrate`; empty: no limit. pub max_bitrate: Arc, } /// An audio source mixed into our stream. #[derive(Clone, Debug, Default, PartialEq)] pub struct AudioSourceItem { /// "desktop", "app", "window", "microphone", "synthetic" pub kind: Arc, /// The source's name. pub name: Arc, /// The line under the name. pub detail: Arc, /// Percent. pub gain: f32, /// It is muted in the mix. pub muted: bool, } /// Stream defaults (Streaming page). #[derive(Clone, Debug, Default, PartialEq)] pub struct StreamingForm { /// Frames per second as typed (`stream.fps`). pub fps: Arc, /// kbit/s as typed (`stream.bitrate_kbps`); "Auto" or empty: from the size and frame rate. pub bitrate: Arc, /// auto, vp8, vp9, h264, av1. pub codec: i32, /// auto, portal, wlroots, x11. pub capture: i32, /// Seconds the replay buffer keeps, as typed; 0: off. pub replay_seconds: Arc, /// MiB of the replay buffer kept in memory, as typed. pub replay_memory: Arc, /// The folder of recordings and clips; empty: the default. pub recording_dir: Arc, } /// Notification kinds: 0 off, 1 in the app, 2 also on the desktop. #[derive(Clone, Debug, Default, PartialEq)] pub struct NotifyForm { /// How a mention notifies: 0 off, 1 in the app, 2 also on the desktop. pub mentions: i32, /// How a poke notifies, as `mentions`. pub pokes: i32, /// How a private message notifies, as `mentions`. pub messages: i32, /// How an event that starts soon notifies, as `mentions`. pub events: i32, /// How a friend coming online notifies, as `mentions`. pub friends: i32, } /// Privacy & Safety. #[derive(Clone, Debug, Default, PartialEq)] pub struct PrivacyForm { /// 0 hide, 1 show flagged. pub block_mode: i32, /// everyone, friends, nobody. pub messages: i32, /// Who may poke us, as `messages`. pub pokes: i32, } /// A server's gateway (Integrations page). #[derive(Clone, Debug, Default, PartialEq)] pub struct GatewayItem { /// The session (bookmark id) whose gateway it is. pub session: i32, /// The server's name. pub server: Arc, /// The gateway's address. pub url: Arc, /// "connected", "connecting", "off" pub status: Arc, /// The features it offers. pub features: Vec>, /// We may administer it. pub admin: bool, } /// A gateway configuration key (gateway administration). #[derive(Clone, Debug, Default, PartialEq)] pub struct ConfigItem { /// The dotted key, "history.retention_days". pub key: Arc, /// JSON. pub value: Arc, /// Where the value comes from: "set at runtime", "command line", "environment", "file" or /// "default". pub source: Arc, /// What the key is for. pub description: Arc, /// The type of the value: `bool`, `int`, `string`, `int_list`, `string_list` or `rule`. pub kind: Arc, /// It is read at start only and cannot be set at runtime. pub bootstrap: bool, } /// A gateway permission rule. #[derive(Clone, Debug, Default, PartialEq)] pub struct PermItem { /// What the rule allows. pub action: Arc, /// "Everyone", "Server groups 6, 7", "Default: server admins". pub rule: Arc, /// Where the rule comes from, as `ConfigItem::source`. pub source: Arc, /// Everyone is allowed. pub everyone: bool, /// The server groups allowed, as a list. pub server_groups: Arc, /// The channel groups allowed, as a list. pub channel_groups: Arc, } /// A video encoder backend (Integrations page). #[derive(Clone, Debug, Default, PartialEq)] pub struct EncoderItem { /// The encoder backend's name. pub name: Arc, /// The API it uses. pub api: Arc, /// The codec it encodes. pub codec: Arc, /// It encodes in hardware. pub hardware: bool, /// It works on this machine. pub ok: bool, /// Why it does not work, or "used first". pub status: Arc, } /// Any registered setting (Advanced page). #[derive(Clone, Debug, Default, PartialEq)] pub struct SettingItem { /// The setting's key. pub key: Arc, /// What the setting is for. pub doc: Arc, /// JSON. pub value: Arc, /// "set here", "command line", "config file", "default". pub source: Arc, } /// A recording or clip of the Stream Studio (Library). #[derive(Clone, Debug, Default, PartialEq)] pub struct RecordingItem { /// The file's name. pub name: Arc, /// "12.3 MB · 3 Oct 18:04". pub detail: Arc, /// A clip saved from the replay buffer; else a recording. pub clip: bool, /// Where the file is. pub path: Arc, } /// Encoders, chat history, cache and logs (Advanced page); numbers as typed. #[derive(Clone, Debug, Default, PartialEq)] pub struct AdvancedForm { /// `stream.encoder_backend`: auto, software or an encoder's name. pub encoder: Arc, /// `stream.hardware_acceleration`: hardware encoders where available. pub hardware: bool, /// `stream.decoder_backend`, `stream.hardware_decoding`. pub decoder: Arc, /// `stream.hardware_decoding`: hardware decoders where available. pub hardware_decoding: bool, /// `chat.store_history`: keep the chat history on this device. pub store_history: bool, /// `chat.history_page`: messages per page; 0: all at once. pub history_page: Arc, /// `chat.dedupe_tolerance_ms`: how far apart two copies of a message may be and count as one. pub dedupe_ms: Arc, /// `chat.retention_days`: delete stored messages older than this; 0: keep all. pub retention_days: Arc, /// `cache.max_mb`: the picture cache's size in MiB; 0: no limit. pub cache_mb: Arc, /// `cache.fetch_images`: download pictures of servers and chats. pub fetch_images: bool, /// `files.progress_interval_ms`: how often a transfer reports; 0: continuously. pub progress_ms: Arc, /// `ui.image_preview_kb`. pub preview_kb: Arc, /// A text on where the logs go and how to get more of them. pub logs: Arc, /// The folder crash reports are kept in; empty if there is none. pub crash_dir: Arc, } /// A row or form of the bridge (the plain counterpart of the Slint struct `AccountForm`). #[derive(Clone, Debug, Default, PartialEq)] pub struct AccountForm { /// The nickname the current server's bookmark connects with. pub nickname: Arc, /// The name of the identity the server sees us as. pub identity: Arc, /// Its unique id on TeamSpeak 3 servers. pub uid: Arc, /// Its unique id on TeamSpeak 6 servers. pub uid6: Arc, /// The security level of its key. pub level: i32, /// The name of the current server. pub server: Arc, } /// One emoji of the picker. `text` is what picking it inserts. #[derive(Clone, Debug, Default, PartialEq)] pub struct EmojiCell { /// The Twemoji key, "1f600". pub key: Arc, /// The emoji's name. pub name: Arc, /// What picking it inserts. pub text: Arc, } /// A row or form of the bridge (the plain counterpart of the Slint struct `EmojiRow`). #[derive(Clone, Debug, Default, PartialEq)] pub struct EmojiRow { /// The emoji of the row. pub cells: Vec, }