pub struct MessageVisualMedia {
overlay: TemplateChild<Overlay>,
stack: TemplateChild<Stack>,
spinner: TemplateChild<Spinner>,
error: TemplateChild<Image>,
dimensions: Cell<Option<FrameDimensions>>,
state: Cell<LoadingState>,
compact: Cell<bool>,
activatable: Cell<bool>,
gesture_click: WeakRef<GestureClick>,
cache_key: RefCell<MessageCacheKey>,
file: RefCell<Option<File>>,
paintable_animation_ref: RefCell<Option<CountedRef>>,
}
Fields§
§overlay: TemplateChild<Overlay>
§stack: TemplateChild<Stack>
§spinner: TemplateChild<Spinner>
§error: TemplateChild<Image>
§dimensions: Cell<Option<FrameDimensions>>
The supposed dimensions of the media.
state: Cell<LoadingState>
The loading state of the media.
compact: Cell<bool>
Whether to display this media in a compact format.
activatable: Cell<bool>
Whether the media can be activated.
If the media is activatable and it is not using the compact format, clicking on the media opens the media viewer.
gesture_click: WeakRef<GestureClick>
§cache_key: RefCell<MessageCacheKey>
The cache key for the current media message.
We only try to reload the media if the key changes. This is to avoid reloading the media when a local echo changes to a remote echo.
file: RefCell<Option<File>>
The current video file, if any.
paintable_animation_ref: RefCell<Option<CountedRef>>
Implementations§
Source§impl MessageVisualMedia
impl MessageVisualMedia
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl MessageVisualMedia
impl MessageVisualMedia
Sourcepub(super) fn media_child<T: IsA<Widget>>(&self) -> Option<T>
pub(super) fn media_child<T: IsA<Widget>>(&self) -> Option<T>
The media child of the given type, if any.
Sourcefn set_media_child(&self, child: &impl IsA<Widget>)
fn set_media_child(&self, child: &impl IsA<Widget>)
Set the media child.
Removes the previous media child if one was set.
Sourcefn set_state(&self, state: LoadingState)
fn set_state(&self, state: LoadingState)
Set the state of the media.
Sourcefn update_animated_paintable_state(&self)
fn update_animated_paintable_state(&self)
Update the state of the animated paintable, if any.
Sourcefn set_compact(&self, compact: bool)
fn set_compact(&self, compact: bool)
Set whether to display this media in a compact format.
Sourcefn set_activatable(&self, activatable: bool)
fn set_activatable(&self, activatable: bool)
Set whether the media can be activated.
Sourcefn update_gesture_click(&self)
fn update_gesture_click(&self)
Add or remove the click controller given the current state.
Sourcefn set_cache_key(&self, key: MessageCacheKey) -> bool
fn set_cache_key(&self, key: MessageCacheKey) -> bool
Set the cache key with the given value.
Returns true
if the media should be reloaded.
Sourcepub(super) fn build(
&self,
media_message: VisualMediaMessage,
session: &Session,
format: ContentFormat,
cache_key: MessageCacheKey,
)
pub(super) fn build( &self, media_message: VisualMediaMessage, session: &Session, format: ContentFormat, cache_key: MessageCacheKey, )
Build the content for the given media message.
Sourceasync fn build_image(&self, media_message: &VisualMediaMessage, client: Client)
async fn build_image(&self, media_message: &VisualMediaMessage, client: Client)
Build the content for the image in the given media message.
Sourcefn enable_copy_image_action(&self, enable: bool)
fn enable_copy_image_action(&self, enable: bool)
Enable or disable the context menu action to copy the image.
Sourceasync fn build_video(&self, media_message: VisualMediaMessage, client: &Client)
async fn build_video(&self, media_message: VisualMediaMessage, client: &Client)
Build the content for the video in the given media message.
Sourcefn video_state_changed(&self, player: &VideoPlayer)
fn video_state_changed(&self, player: &VideoPlayer)
Handle when the state of the video changed.
Trait Implementations§
Source§impl CompositeTemplate for MessageVisualMedia
impl CompositeTemplate for MessageVisualMedia
fn bind_template(klass: &mut Self::Class)
fn check_template_children(widget: &<Self as ObjectSubclass>::Type)
Source§impl Debug for MessageVisualMedia
impl Debug for MessageVisualMedia
Source§impl Default for MessageVisualMedia
impl Default for MessageVisualMedia
Source§fn default() -> MessageVisualMedia
fn default() -> MessageVisualMedia
Source§impl DerivedObjectProperties for MessageVisualMedia
impl DerivedObjectProperties for MessageVisualMedia
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 MessageVisualMedia
impl ObjectImpl for MessageVisualMedia
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 constructed(&self)
fn constructed(&self)
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 MessageVisualMedia
impl ObjectSubclass for MessageVisualMedia
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<MessageVisualMedia>
type Class = ClassStruct<MessageVisualMedia>
Source§type Instance = InstanceStruct<MessageVisualMedia>
type Instance = InstanceStruct<MessageVisualMedia>
Source§type Type = MessageVisualMedia
type Type = MessageVisualMedia
wrapper!
Source§type ParentType = Widget
type ParentType = Widget
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 WidgetImpl for MessageVisualMedia
impl WidgetImpl for MessageVisualMedia
fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn request_mode(&self) -> SizeRequestMode
fn size_allocate(&self, width: i32, height: i32, baseline: i32)
fn map(&self)
fn unmap(&self)
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 grab_focus(&self) -> bool
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 snapshot(&self, snapshot: &Snapshot)
fn state_flags_changed(&self, state_flags: &StateFlags)
fn system_setting_changed(&self, settings: &SystemSetting)
fn unrealize(&self)
fn unroot(&self)
Auto Trait Implementations§
impl !Freeze for MessageVisualMedia
impl !RefUnwindSafe for MessageVisualMedia
impl !Send for MessageVisualMedia
impl !Sync for MessageVisualMedia
impl Unpin for MessageVisualMedia
impl !UnwindSafe for MessageVisualMedia
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
.