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§
- Open
Send Box - A box a window is asked to open with no menu around it.
- Send
ToRequest - Someone asked to send a message from this window to these recipients about what they selected.
- Shared
Selection - 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
atis about, given thefocusedselection: the selection when the person pointed inside it (or did not point at all, with the keyboard);Noneotherwise, 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 throughanswer_recipientsunder the number returned. Empty queries ask for the ones the person reached for last. - selection_
of - The selection
widgetholds, 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.