Skip to main content

Module shared_selection

Module shared_selection 

Expand description

What the person has selected in a window, for sending it somewhere.

A person who selects a sentence, a range of cells or a row and sends it to an agent or a person means that selection. The toolkit derives it once, from the focused widget, so every app gets it without code of its own: the place in the resource’s terms (an item and character offsets, the form an action’s place argument takes), the resource it is in, and a short excerpt. A widget that knows its selection better (a multi-block editor) says so through PublishesPresence::shared_selection.

Every context menu takes typing (crate::widget::ContextMenu): a sentence none of its entries answers goes into the send-to box docked beside it (crate::widget::SendToBox), where the person names whom to send it to. The box queues the request (send_to), and the app runner hands it to the session with a typed reference (resolve_selection), which the session acts on as the person: it makes a new agent when one is a recipient, opens or makes the one conversation, and posts the message there. The reference names a place; it grants nothing, so an agent reaches it only through the app’s published actions, as every task does.

Structs§

OpenSendBox
A box a window is asked to open with no menu around it.
SendToRequest
Someone asked to send a message from this window to these recipients about what they selected.
SharedSelection
A person’s selection in one window: the resource it is in, when known, and where in it.

Constants§

MAX_SEND_CHARS
The longest message a box sends, in characters: well inside a protocol frame, and more than anyone types into one.

Functions§

answer_recipients
What the search found for request, waiting for the box that asked.
box_open
Whether a send-to box is open in this window.
focused_selection
What the person has selected in this window now, as the app runner last read it: what a box’s “+” adds as a subject.
open_send_box
Open the box with no menu: what a window’s own key does over a selection, and what the shell’s send key or its “report a problem” asks of an app.
pointed_selection
The one subject rule for what pointing at at is about, given the focused selection: the selection when the person pointed inside it (or did not point at all, with the keyboard); None otherwise, for the caller to name the item under the pointer, else the window. A selection that does not say where it is drawn is not pointed inside.
resolve_selection
Where in the window a request points, and what it is about: the reference the app runner hands the session, resolved against what the window shows.
search_recipients
Ask the one search for the recipients matching query; the answer comes back through answer_recipients under the number returned. Empty queries ask for the ones the person reached for last.
selection_of
The selection widget holds, if it is focused and holds one.
send_host_available
Whether a desktop is connected that can send what a box holds, so a menu offers it. Outside a session the box is not offered.
send_to
Send what a box holds: the app runner hands it to the session, which acts on it as the person.
set_box_open
Record whether a send-to box is open. For the box itself.
set_focused_selection
Record the window’s selection, read each pass by the app runner.
set_send_host_available
Record whether a desktop that can send what a box holds is connected. For the app runner.
subtree_selection
The selection of the focused widget under root (itself included): the first in tree order that holds one. Bounded in nodes visited.
take_open_send_box
A box asked for with no menu since the last call. For the area that carries one.
take_recipient_searches
The searches boxes asked for since the last call, oldest first. For the app runner, which asks the session.
take_recipients
The rows for request, if the search has answered: taken once, so a box never draws the same answer twice.
take_send_to
Requests made since the last call, oldest first. For the app runner.