Trait gtk::prelude::EntryCompletionExt[][src]

pub trait EntryCompletionExt: 'static {
Show methods fn complete(&self);
fn compute_prefix(&self, key: &str) -> Option<GString>;
fn delete_action(&self, index_: i32);
fn completion_prefix(&self) -> Option<GString>;
fn is_inline_completion(&self) -> bool;
fn is_inline_selection(&self) -> bool;
fn minimum_key_length(&self) -> i32;
fn model(&self) -> Option<TreeModel>;
fn is_popup_completion(&self) -> bool;
fn is_popup_set_width(&self) -> bool;
fn is_popup_single_match(&self) -> bool;
fn text_column(&self) -> i32;
fn insert_action_markup(&self, index_: i32, markup: &str);
fn insert_action_text(&self, index_: i32, text: &str);
fn insert_prefix(&self);
fn set_inline_completion(&self, inline_completion: bool);
fn set_inline_selection(&self, inline_selection: bool);
fn set_match_func<P: Fn(&EntryCompletion, &str, &TreeIter) -> bool + 'static>(
        &self,
        func: P
    );
fn set_minimum_key_length(&self, length: i32);
fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>);
fn set_popup_completion(&self, popup_completion: bool);
fn set_popup_set_width(&self, popup_set_width: bool);
fn set_popup_single_match(&self, popup_single_match: bool);
fn set_text_column(&self, column: i32);
fn cell_area(&self) -> Option<CellArea>;
fn connect_action_activated<F: Fn(&Self, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_cursor_on_match<F: Fn(&Self, &TreeModel, &TreeIter) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_insert_prefix<F: Fn(&Self, &str) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_match_selected<F: Fn(&Self, &TreeModel, &TreeIter) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_no_matches<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_inline_completion_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_inline_selection_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_minimum_key_length_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_model_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_popup_completion_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_popup_set_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_popup_single_match_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_text_column_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all EntryCompletion methods.

Implementors

EntryCompletion

Required methods

Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key. The completion list view will be updated accordingly.

Computes the common prefix that is shared by all rows in self that start with key. If no row matches key, None will be returned. Note that a text column must have been set for this function to work, see set_text_column() for details.

key

The text to complete for

Returns

The common prefix all rows starting with key or None if no row matches key.

Deletes the action at index_ from self’s action list.

Note that index_ is a relative position and the position of an action may have changed since it was inserted.

index_

the index of the item to delete

Get the original text entered by the user that triggered the completion or None if there’s no completion ongoing.

Returns

the prefix for the current completion

Returns whether the common prefix of the possible completions should be automatically inserted in the entry.

Returns

true if inline completion is turned on

Returns true if inline-selection mode is turned on.

Returns

true if inline-selection mode is on

Returns the minimum key length as set for self.

Returns

The currently used minimum key length

Returns the model the EntryCompletion is using as data source. Returns None if the model is unset.

Returns

A TreeModel, or None if none is currently being used

Returns whether the completions should be presented in a popup window.

Returns

true if popup completion is turned on

Returns whether the completion popup window will be resized to the width of the entry.

Returns

true if the popup window will be resized to the width of the entry

Returns whether the completion popup window will appear even if there is only a single match.

Returns

true if the popup window will appear regardless of the number of matches

Returns the column in the model of self to get strings from.

Returns

the column containing the strings

Inserts an action in self’s action item list at position index_ with markup markup.

index_

the index of the item to insert

markup

markup of the item to insert

Inserts an action in self’s action item list at position index_ with text text. If you want the action item to have markup, use insert_action_markup().

Note that index_ is a relative position in the list of actions and the position of an action can change when deleting a different action.

index_

the index of the item to insert

text

text of the item to insert

Requests a prefix insertion.

Sets whether the common prefix of the possible completions should be automatically inserted in the entry.

inline_completion

true to do inline completion

Sets whether it is possible to cycle through the possible completions inside the entry.

inline_selection

true to do inline selection

Sets the match function for self to be func. The match function is used to determine if a row should or should not be in the completion list.

func

the GtkEntryCompletionMatchFunc to use

func_data

user data for func

func_notify

destroy notify for func_data.

Requires the length of the search key for self to be at least length. This is useful for long lists, where completing using a small key takes a lot of time and will come up with meaningless results anyway (ie, a too large dataset).

length

the minimum length of the key in order to start completing

Sets the model for a EntryCompletion. If self already has a model set, it will remove it before setting the new model. If model is None, then it will unset the model.

model

the TreeModel

Sets whether the completions should be presented in a popup window.

true to do popup completion

Sets whether the completion popup window will be resized to be the same width as the entry.

true to make the width of the popup the same as the entry

Sets whether the completion popup window will appear even if there is only a single match. You may want to set this to false if you are using [inline completion][GtkEntryCompletion–inline-completion].

true if the popup should appear even for a single match

Convenience function for setting up the most used case of this code: a completion list with just strings. This function will set up self to have a list displaying all (and just) strings in the completion list, and to get those strings from column in the model of self.

This functions creates and adds a CellRendererText for the selected column. If you need to set the text column, but don’t want the cell renderer, use [ObjectExtManual::set()][crate::glib::prelude::ObjectExtManual::set()] to set the property::EntryCompletion::text-column property directly.

column

the column in the model of self to get strings from

The CellArea used to layout cell renderers in the treeview column.

If no area is specified when creating the entry completion with EntryCompletion::with_area() a horizontally oriented CellAreaBox will be used.

Gets emitted when an action is activated.

index

the index of the activated action

Gets emitted when a match from the cursor is on a match of the list. The default behaviour is to replace the contents of the entry with the contents of the text column in the row pointed to by iter.

Note that model is the model that was passed to set_model().

model

the TreeModel containing the matches

iter

a TreeIter positioned at the selected match

Returns

true if the signal has been handled

Gets emitted when the inline autocompletion is triggered. The default behaviour is to make the entry display the whole prefix and select the newly inserted part.

Applications may connect to this signal in order to insert only a smaller part of the prefix into the entry - e.g. the entry used in the FileChooser inserts only the part of the prefix up to the next ‘/’.

prefix

the common prefix of all possible completions

Returns

true if the signal has been handled

Gets emitted when a match from the list is selected. The default behaviour is to replace the contents of the entry with the contents of the text column in the row pointed to by iter.

Note that model is the model that was passed to set_model().

model

the TreeModel containing the matches

iter

a TreeIter positioned at the selected match

Returns

true if the signal has been handled

Gets emitted when the filter model has zero number of rows in completion_complete method. (In other words when GtkEntryCompletion is out of suggestions)

Implementors