pub struct CompletionPopover {
list: TemplateChild<ListBox>,
view: PhantomData<TextView>,
room: WeakRef<Room>,
member_list: CompletionMemberList,
room_list: CompletionRoomList,
rows: [PillSourceRow; 32],
selected: Cell<Option<usize>>,
current_word: RefCell<Option<(TextIter, TextIter, SearchTerm)>>,
inhibit: Cell<bool>,
buffer: BoundObject<TextBuffer>,
}
Fields§
§list: TemplateChild<ListBox>
§view: PhantomData<TextView>
The parent GtkTextView
to autocomplete.
room: WeakRef<Room>
The current room.
member_list: CompletionMemberList
The sorted and filtered room members.
room_list: CompletionRoomList
The sorted and filtered rooms.
rows: [PillSourceRow; 32]
The rows in the popover.
selected: Cell<Option<usize>>
The selected row in the popover.
current_word: RefCell<Option<(TextIter, TextIter, SearchTerm)>>
The current autocompleted word.
inhibit: Cell<bool>
Whether the popover is inhibited for the current word.
buffer: BoundObject<TextBuffer>
The buffer to autocomplete.
Implementations§
Source§impl CompletionPopover
impl CompletionPopover
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl CompletionPopover
impl CompletionPopover
Sourcefn message_toolbar(&self) -> MessageToolbar
fn message_toolbar(&self) -> MessageToolbar
The ancestor MessageToolbar
.
Sourcefn update_buffer(&self)
fn update_buffer(&self)
Handle a change of buffer.
Sourcefn visible_rows_count(&self) -> usize
fn visible_rows_count(&self) -> usize
The number of visible rows.
Sourcefn handle_key_pressed(&self, key: Key, modifier: ModifierType) -> Propagation
fn handle_key_pressed(&self, key: Key, modifier: ModifierType) -> Propagation
Handle when a key was pressed.
Sourcefn current_word(&self) -> Option<(TextIter, TextIter, SearchTerm)>
fn current_word(&self) -> Option<(TextIter, TextIter, SearchTerm)>
The word that is currently used for filtering.
Returns the start and end position of the word, as well as the search term.
Sourcefn set_current_word(&self, word: Option<(TextIter, TextIter, SearchTerm)>)
fn set_current_word(&self, word: Option<(TextIter, TextIter, SearchTerm)>)
Set the word that is currently used for filtering.
Sourcefn update_completion(&self, trigger: bool)
fn update_completion(&self, trigger: bool)
Update completion.
If trigger is true
, the search term will not look for @
at the
start of the word.
Sourcefn find_search_term(
&self,
trigger: bool,
) -> Option<(TextIter, TextIter, SearchTerm)>
fn find_search_term( &self, trigger: bool, ) -> Option<(TextIter, TextIter, SearchTerm)>
Find the current search term in the underlying buffer.
Returns the start and end of the search word and the term to search for.
If trigger is true
, the search term will not look for @
at the
start of the word.
Sourcefn cursor_word_boundaries(&self, trigger: bool) -> Option<(TextIter, TextIter)>
fn cursor_word_boundaries(&self, trigger: bool) -> Option<(TextIter, TextIter)>
Find the word boundaries for the current cursor position.
If trigger is true
, the search term will not look for @
at the
start of the word.
Returns a (start, end)
tuple.
Sourcefn in_escaped_markdown(
&self,
word_start: &TextIter,
word_end: &TextIter,
) -> bool
fn in_escaped_markdown( &self, word_start: &TextIter, word_end: &TextIter, ) -> bool
Check if the text is in markdown that would be escaped.
This includes:
- Inline code
- Block code
- Links (because nested links are not allowed in HTML)
- Images
Sourcefn update_search(&self)
fn update_search(&self)
Update the popover for the current search term.
Sourcefn update_pointing_to(&self)
fn update_pointing_to(&self)
Update the location where the popover is pointing to.
Sourcefn selected_row_index(&self) -> Option<usize>
fn selected_row_index(&self) -> Option<usize>
The index of the selected row.
Sourcefn select_row_at_index(&self, idx: Option<usize>)
fn select_row_at_index(&self, idx: Option<usize>)
Select the row at the given index.
Sourcefn activate_selected_row(&self)
fn activate_selected_row(&self)
Activate the row that is currently selected.
Sourcefn row_activated(&self, row: &PillSourceRow)
fn row_activated(&self, row: &PillSourceRow)
Handle a row being activated.
Sourcefn is_inhibited(&self) -> bool
fn is_inhibited(&self) -> bool
Whether the completion is inhibited.
Sourcefn update_accessible_label(&self)
fn update_accessible_label(&self)
Update the accessible label of the popover.
Trait Implementations§
Source§impl CompositeTemplate for CompletionPopover
impl CompositeTemplate for CompletionPopover
fn bind_template(klass: &mut Self::Class)
fn check_template_children(widget: &<Self as ObjectSubclass>::Type)
Source§impl Debug for CompletionPopover
impl Debug for CompletionPopover
Source§impl Default for CompletionPopover
impl Default for CompletionPopover
Source§fn default() -> CompletionPopover
fn default() -> CompletionPopover
Source§impl DerivedObjectProperties for CompletionPopover
impl DerivedObjectProperties for CompletionPopover
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 CompletionPopover
impl ObjectImpl for CompletionPopover
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 CompletionPopover
impl ObjectSubclass for CompletionPopover
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<CompletionPopover>
type Class = ClassStruct<CompletionPopover>
Source§type Instance = InstanceStruct<CompletionPopover>
type Instance = InstanceStruct<CompletionPopover>
Source§type Type = CompletionPopover
type Type = CompletionPopover
wrapper!
Source§type ParentType = Popover
type ParentType = Popover
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 PopoverImpl for CompletionPopover
impl PopoverImpl for CompletionPopover
Source§impl WidgetImpl for CompletionPopover
impl WidgetImpl for CompletionPopover
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)
Auto Trait Implementations§
impl !Freeze for CompletionPopover
impl !RefUnwindSafe for CompletionPopover
impl !Send for CompletionPopover
impl !Sync for CompletionPopover
impl Unpin for CompletionPopover
impl !UnwindSafe for CompletionPopover
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
.