Struct fractal::session::view::content::room_history::message_toolbar::composer_state::imp::ComposerState
source · pub struct ComposerState {
pub room: WeakRef<Room>,
pub buffer: Buffer,
pub related_to: RefCell<Option<RelationInfo>>,
pub has_relation: PhantomData<bool>,
pub widgets: RefCell<Vec<(Widget, TextChildAnchor)>>,
pub view: WeakRef<View>,
pub saved_draft: RefCell<Option<ComposerDraft>>,
draft_timeout: RefCell<Option<SourceId>>,
draft_lock: Mutex<()>,
}
Fields§
§room: WeakRef<Room>
The room associated with this state.
buffer: Buffer
The buffer of this state.
The relation of this state.
has_relation: PhantomData<bool>
Whether this state has a relation.
widgets: RefCell<Vec<(Widget, TextChildAnchor)>>
The widgets of this state.
These are the widgets inserted in the composer.
view: WeakRef<View>
The current view attached to this state.
saved_draft: RefCell<Option<ComposerDraft>>
The draft that was saved in the store.
draft_timeout: RefCell<Option<SourceId>>
The signal handler for the current draft saving timeout.
draft_lock: Mutex<()>
The lock to prevent multiple draft saving operations at the same time.
Implementations§
source§impl ComposerState
impl ComposerState
sourcefn register_type()
fn register_type()
Registers the type only once.
source§impl ComposerState
impl ComposerState
sourcefn has_relation(&self) -> bool
fn has_relation(&self) -> bool
Whether this state has a relation.
sourcepub(super) fn update_widgets(&self)
pub(super) fn update_widgets(&self)
Update the list of widgets present in the composer.
sourcefn draft(&self) -> Option<ComposerDraft>
fn draft(&self) -> Option<ComposerDraft>
Get the draft for the current state.
Returns None
if the draft would be empty.
sourcepub(super) fn trigger_draft_saving(&self)
pub(super) fn trigger_draft_saving(&self)
Trigger the timeout for saving the current draft.
sourceasync fn save_draft(&self)
async fn save_draft(&self)
Save the current draft.
sourcepub(super) fn add_widget(&self, widget: impl IsA<Widget>, iter: &mut TextIter)
pub(super) fn add_widget(&self, widget: impl IsA<Widget>, iter: &mut TextIter)
Add the given widget at the position of the given iter to this state.
sourcepub(super) async fn restore_draft(&self)
pub(super) async fn restore_draft(&self)
Restore the state from the persisted draft.
sourceasync fn restore_from_draft(&self, draft: ComposerDraft)
async fn restore_from_draft(&self, draft: ComposerDraft)
Restore the state from the given draft.
Restore the relation from the given draft content.
Trait Implementations§
source§impl Debug for ComposerState
impl Debug for ComposerState
source§impl Default for ComposerState
impl Default for ComposerState
source§fn default() -> ComposerState
fn default() -> ComposerState
source§impl DerivedObjectProperties for ComposerState
impl DerivedObjectProperties for ComposerState
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 ComposerState
impl ObjectImpl for ComposerState
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 ComposerState
impl ObjectSubclass for ComposerState
§type ParentType = Object
type ParentType = Object
§type Interfaces = ()
type Interfaces = ()
§type Class = ClassStruct<ComposerState>
type Class = ClassStruct<ComposerState>
§type Instance = InstanceStruct<ComposerState>
type Instance = InstanceStruct<ComposerState>
§type Type = ComposerState
type Type = ComposerState
wrapper!
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 class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
source§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Auto Trait Implementations§
impl !Freeze for ComposerState
impl !RefUnwindSafe for ComposerState
impl !Send for ComposerState
impl !Sync for ComposerState
impl Unpin for ComposerState
impl !UnwindSafe for ComposerState
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, 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> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
source§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
.