pub struct MessageToolbar {Show 14 fields
main_stack: TemplateChild<Stack>,
message_entry: TemplateChild<View>,
send_button: TemplateChild<Button>,
related_event_header: TemplateChild<LabelWithWidgets>,
related_event_content: TemplateChild<MessageContent>,
room: WeakRef<Room>,
send_message_permission_handler: RefCell<Option<SignalHandlerId>>,
markdown_enabled: Cell<bool>,
completion: CompletionPopover,
current_composer_state: PhantomData<ComposerState>,
composer_state_handler: RefCell<Option<SignalHandlerId>>,
buffer_handlers: RefCell<Option<(SignalHandlerId, Binding)>>,
composer_states: RefCell<HashMap<Option<String>, HashMap<Option<OwnedRoomId>, ComposerState>>>,
send_guard: Mutex<()>,
}
Fields§
§main_stack: TemplateChild<Stack>
§message_entry: TemplateChild<View>
§room: WeakRef<Room>
The room to send messages in.
send_message_permission_handler: RefCell<Option<SignalHandlerId>>
§markdown_enabled: Cell<bool>
Whether outgoing messages should be interpreted as markdown.
completion: CompletionPopover
§current_composer_state: PhantomData<ComposerState>
The current composer state.
composer_state_handler: RefCell<Option<SignalHandlerId>>
§buffer_handlers: RefCell<Option<(SignalHandlerId, Binding)>>
§composer_states: RefCell<HashMap<Option<String>, HashMap<Option<OwnedRoomId>, ComposerState>>>
The composer states, per-session and per-room.
The fallback composer state has the None
key.
send_guard: Mutex<()>
A guard to avoid sending several messages at once.
Implementations§
Source§impl MessageToolbar
impl MessageToolbar
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl MessageToolbar
impl MessageToolbar
Sourcepub(super) fn can_compose_message(&self) -> bool
pub(super) fn can_compose_message(&self) -> bool
Whether the user can compose a message.
It depends on whether our own user has the permission to send a message in the current room.
Sourcefn send_message_permission_updated(&self)
fn send_message_permission_updated(&self)
Handle an update of the permission to send a message in the current room.
Sourcefn current_composer_state(&self) -> ComposerState
fn current_composer_state(&self) -> ComposerState
Get the current composer state.
Sourcefn composer_state(&self, room: Option<&Room>) -> ComposerState
fn composer_state(&self, room: Option<&Room>) -> ComposerState
Get the composer state for the given room.
If the composer state doesn’t exist, it is created.
Sourcefn update_current_composer_state(&self, old_room: Option<&Room>)
fn update_current_composer_state(&self, old_room: Option<&Room>)
Update the current composer state.
Update the displayed related event for the current state.
Sourcefn update_for_reply(&self, info: &RepliedToInfo)
fn update_for_reply(&self, info: &RepliedToInfo)
Update the displayed related event for the given reply.
Sourcefn update_for_edit(&self)
fn update_for_edit(&self)
Update the displayed related event for the given edit.
Clear the related event.
Sourcepub(super) fn mention_member(&self, member: &Member)
pub(super) fn mention_member(&self, member: &Member)
Add a mention of the given member to the message composer.
Sourcepub(super) fn set_reply_to(&self, event: &Event)
pub(super) fn set_reply_to(&self, event: &Event)
Set the event to reply to.
Sourcefn key_pressed(
&self,
key: Key,
_keycode: u32,
modifier: ModifierType,
) -> Propagation
fn key_pressed( &self, key: Key, _keycode: u32, modifier: ModifierType, ) -> Propagation
Handle when a key was pressed in the message entry.
Sourceasync fn send_text_message(&self)
async fn send_text_message(&self)
Send the text message that is currently in the message entry.
Sourcefn open_emoji(&self)
fn open_emoji(&self)
Open the emoji chooser in the message entry.
Sourceasync fn send_location(&self)
async fn send_location(&self)
Send the current location of the user.
Shows a preview of the location first and asks the user to confirm the action.
Sourcefn location_error_toast(&self, error: LocationError)
fn location_error_toast(&self, error: LocationError)
Show a toast for the given location error;
Sourceasync fn send_attachment(
&self,
source: AttachmentSource,
mime: Mime,
info: AttachmentInfo,
thumbnail: Option<Thumbnail>,
)
async fn send_attachment( &self, source: AttachmentSource, mime: Mime, info: AttachmentInfo, thumbnail: Option<Thumbnail>, )
Send the attachment with the given data.
Sourceasync fn send_image(&self, image: Texture)
async fn send_image(&self, image: Texture)
Send the given texture as an image.
Shows a preview of the image first and asks the user to confirm the action.
Sourceasync fn select_file(&self)
async fn select_file(&self)
Select a file to send.
Sourcepub(super) async fn send_file(&self, file: File)
pub(super) async fn send_file(&self, file: File)
Send the given file.
Shows a preview of the file first, if possible, and asks the user to confirm the action.
async fn send_file_inner(&self, file: File)
Sourcepub(super) async fn read_clipboard_file(&self)
pub(super) async fn read_clipboard_file(&self)
Read the file data from the clipboard and send it.
Handle a click on the related event.
Scrolls to the corresponding event.
Sourcefn paste_from_clipboard(&self)
fn paste_from_clipboard(&self)
Paste the content of the clipboard into the message entry.
Sourcefn copy_to_clipboard(&self)
fn copy_to_clipboard(&self)
Copy the content of the message entry to the clipboard.
Sourcefn cut_to_clipboard(&self)
fn cut_to_clipboard(&self)
Cut the content of the message entry to the clipboard.
fn copy_buffer_selection_to_clipboard(&self)
Sourcefn send_typing_notification(&self, typing: bool)
fn send_typing_notification(&self, typing: bool)
Send a typing notification for the given typing state.
Trait Implementations§
Source§impl CompositeTemplate for MessageToolbar
impl CompositeTemplate for MessageToolbar
fn bind_template(klass: &mut Self::Class)
fn check_template_children(widget: &<Self as ObjectSubclass>::Type)
Source§impl CompositeTemplateCallbacks for MessageToolbar
impl CompositeTemplateCallbacks for MessageToolbar
const CALLBACKS: &'static [TemplateCallback]
Source§fn bind_template_callbacks<T>(klass: &mut T)where
T: WidgetClassExt,
fn bind_template_callbacks<T>(klass: &mut T)where
T: WidgetClassExt,
klass
.Source§fn bind_template_callbacks_prefixed<T>(klass: &mut T, prefix: &str)where
T: WidgetClassExt,
fn bind_template_callbacks_prefixed<T>(klass: &mut T, prefix: &str)where
T: WidgetClassExt,
klass
, prepending prefix
to each callback name.Source§fn add_callbacks_to_scope(scope: &BuilderRustScope)
fn add_callbacks_to_scope(scope: &BuilderRustScope)
scope
.Source§fn add_callbacks_to_scope_prefixed(scope: &BuilderRustScope, prefix: &str)
fn add_callbacks_to_scope_prefixed(scope: &BuilderRustScope, prefix: &str)
scope
, prepending
prefix
to each callback name.Source§impl Debug for MessageToolbar
impl Debug for MessageToolbar
Source§impl Default for MessageToolbar
impl Default for MessageToolbar
Source§fn default() -> MessageToolbar
fn default() -> MessageToolbar
Source§impl DerivedObjectProperties for MessageToolbar
impl DerivedObjectProperties for MessageToolbar
Source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
Source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.Source§fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.Source§impl ObjectImpl for MessageToolbar
impl ObjectImpl for MessageToolbar
Source§fn constructed(&self)
fn constructed(&self)
Source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
Source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property")
.fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for MessageToolbar
impl ObjectSubclass for MessageToolbar
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<MessageToolbar>
type Class = ClassStruct<MessageToolbar>
Source§type Instance = InstanceStruct<MessageToolbar>
type Instance = InstanceStruct<MessageToolbar>
Source§type Type = MessageToolbar
type Type = MessageToolbar
wrapper!
Source§type ParentType = Bin
type ParentType = Bin
Source§fn class_init(klass: &mut Self::Class)
fn class_init(klass: &mut Self::Class)
Source§fn instance_init(obj: &InitializingObject<Self>)
fn instance_init(obj: &InitializingObject<Self>)
Source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
Source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
Source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
Source§impl ObjectSubclassType for MessageToolbar
impl ObjectSubclassType for MessageToolbar
Source§impl WidgetImpl for MessageToolbar
impl WidgetImpl for MessageToolbar
fn compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool)
fn contains(&self, x: f64, y: f64) -> bool
fn direction_changed(&self, previous_direction: TextDirection)
fn focus(&self, direction_type: DirectionType) -> bool
fn request_mode(&self) -> SizeRequestMode
fn grab_focus(&self) -> bool
fn map(&self)
fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn mnemonic_activate(&self, group_cycling: bool) -> bool
fn move_focus(&self, direction_type: DirectionType)
fn query_tooltip( &self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: &Tooltip, ) -> bool
fn realize(&self)
fn root(&self)
fn set_focus_child(&self, child: Option<&Widget>)
fn size_allocate(&self, width: i32, height: i32, baseline: i32)
fn snapshot(&self, snapshot: &Snapshot)
fn state_flags_changed(&self, state_flags: &StateFlags)
fn system_setting_changed(&self, settings: &SystemSetting)
fn unmap(&self)
fn unrealize(&self)
fn unroot(&self)
impl BinImpl for MessageToolbar
Auto Trait Implementations§
impl !Freeze for MessageToolbar
impl !RefUnwindSafe for MessageToolbar
impl !Send for MessageToolbar
impl !Sync for MessageToolbar
impl Unpin for MessageToolbar
impl !UnwindSafe for MessageToolbar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CompositeTemplateDisposeExt for T
impl<T> CompositeTemplateDisposeExt for T
fn dispose_template(&self)
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
Source§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed()
.Source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify()
.Source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
glib::Object::dispatch_properties_changed()
.Source§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
Source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
Source§fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self
.