Skip to main content

SendToBox

Struct SendToBox 

pub struct SendToBox { /* private fields */ }
Expand description

The box beside a context menu.

Implementations§

§

impl SendToBox

pub fn new() -> SendToBox

pub fn is_open(&self) -> bool

pub fn is_drawn(&self) -> bool

Whether any of it is on screen: open, arriving with its menu, or leaving with it.

pub fn is_moving(&self) -> bool

Whether it moves now, so the frame pump keeps drawing.

pub fn rect(&self) -> Rect

Where the box stands.

pub fn is_focused(&self) -> bool

The keyboard is in the box (Tab brought it here, or it opened).

pub fn take_sent(&mut self) -> bool

Whether the person sent what the box held, once.

pub fn recipients(&self) -> &[Recipient]

The recipients on their chips, the new agent among them.

pub fn addressed(&self) -> bool

Whether the session named whom it goes to, so nobody is searched for and the chips stay.

pub fn text(&self) -> &str

What the message says.

pub fn subjects(&self) -> &[SharedSelection]

What the message is about, on its chips.

pub fn rows(&self) -> &[Recipient]

The recipients the search found, in the order shown.

pub fn hovered_row(&self) -> Option<usize>

The row the keyboard is on among the recipients found.

pub fn focus(&self) -> SendToFocus

Which field the keyboard is in.

pub fn set_about(&mut self, about: Option<SharedSelection>)

Say what the box is about: the chip it starts with.

pub fn open(&mut self, draft: Option<&str>, to: &[Recipient])

Show the box about what the menu acts on, with draft in its message field (a sentence typed into the menu that no row answered), and to to when the session names whom it goes to — the one place a report goes — else to the agent a message makes, which the person may change.

pub fn unfocus(&mut self)

Open without the keyboard: a menu opened on something carries the box beside it, and the person’s typing still narrows the menu’s rows until they send or Tab into it.

pub fn close(&mut self)

Put it away with its menu: it leaves as it stood, so what it showed is kept until the next Self::open clears it.

pub fn set_viewport(&mut self, viewport: Option<Rect>)

pub fn place(&mut self, menu: Rect, viewport: Option<Rect>)

Stand the box beside menu: on its trailing side with the same top, or its leading side where the window leaves no room, or under it where neither side holds it, inside the window.

pub fn handle_event( &mut self, event: &WindowEvent, ctx: &mut EventCtx<'_>, ) -> bool

Take a key, a press or a text event while the box is open. Whether it took it.

pub fn drain_answer(&mut self) -> bool

Take what the one search answered for this box, once. Whether it answered.

pub fn press(&mut self, at: Point) -> bool

A press at at on one of the box’s parts. Whether it was in the box.

pub fn focus_first(&mut self)

Put the keyboard in the box’s first field (the menu’s Tab brought it here).

pub fn can_send(&self) -> bool

Whether the box has something to send: whom it goes to, and either the words or what they are about. A subject on its own is the message — a task sent to someone says what it is without a sentence beside it.

pub fn send(&mut self)

Send what the box holds: one request the session acts on as the person.

pub fn paint( &mut self, scene: &mut Scene, transform: Affine, text_renderer: &mut TextRenderer, theme: &Theme, )

Draw the box: the floating panel its menu stands in, its chips and fields on it.

pub fn accessibility(&self) -> Option<AccessNode>

What assistive technology reads: the recipient field with its chips, what the search found, the subjects, the message and Send, in the order the keyboard visits them.

pub fn perform_semantic_action(&mut self, target: &str, action: &Action) -> bool

Assistive technology pressed or wrote in one of the box’s parts.

pub fn needs_redraw(&self) -> bool

Whether the box needs another frame: the search answered, a chip was added, the caret moved.

pub fn contains(&self, point: Point) -> bool

The part under point, for the box’s own press routing.

Trait Implementations§

§

impl Default for SendToBox

§

fn default() -> SendToBox

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> WasmNotSend for T
where T: Send,