[][src]Trait gtk::EntryCompletionExt

pub trait EntryCompletionExt: 'static {
    fn complete(&self);
fn compute_prefix(&self, key: &str) -> Option<GString>;
fn delete_action(&self, index_: i32);
fn get_completion_prefix(&self) -> Option<GString>;
fn get_inline_completion(&self) -> bool;
fn get_inline_selection(&self) -> bool;
fn get_minimum_key_length(&self) -> i32;
fn get_model(&self) -> Option<TreeModel>;
fn get_popup_completion(&self) -> bool;
fn get_popup_set_width(&self) -> bool;
fn get_popup_single_match(&self) -> bool;
fn get_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 get_property_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_property_inline_completion_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_inline_selection_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_minimum_key_length_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_model_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_popup_completion_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_popup_set_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_popup_single_match_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_text_column_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all EntryCompletion methods.

Implementors

EntryCompletion

Required methods

fn complete(&self)

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.

fn compute_prefix(&self, key: &str) -> Option<GString>

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 EntryCompletionExt::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.

fn delete_action(&self, index_: i32)

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

fn get_completion_prefix(&self) -> Option<GString>

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

fn get_inline_completion(&self) -> bool

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

Returns

true if inline completion is turned on

fn get_inline_selection(&self) -> bool

Returns true if inline-selection mode is turned on.

Returns

true if inline-selection mode is on

fn get_minimum_key_length(&self) -> i32

Returns the minimum key length as set for self.

Returns

The currently used minimum key length

fn get_model(&self) -> Option<TreeModel>

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

fn get_popup_completion(&self) -> bool

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

Returns

true if popup completion is turned on

fn get_popup_set_width(&self) -> bool

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

fn get_popup_single_match(&self) -> bool

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

fn get_text_column(&self) -> i32

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

Returns

the column containing the strings

fn insert_action_markup(&self, index_: i32, markup: &str)

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

fn insert_action_text(&self, index_: i32, text: &str)

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 EntryCompletionExt::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

fn insert_prefix(&self)

Requests a prefix insertion.

fn set_inline_completion(&self, inline_completion: bool)

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

inline_completion

true to do inline completion

fn set_inline_selection(&self, inline_selection: bool)

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

inline_selection

true to do inline selection

fn set_match_func<P: Fn(&EntryCompletion, &str, &TreeIter) -> bool + 'static>(
    &self,
    func: P
)

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.

fn set_minimum_key_length(&self, length: i32)

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

fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)

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

fn set_popup_completion(&self, popup_completion: bool)

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

true to do popup completion

fn set_popup_set_width(&self, popup_set_width: bool)

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

fn set_popup_single_match(&self, popup_single_match: bool)

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][EntryCompletion--inline-completion].

true if the popup should appear even for a single match

fn set_text_column(&self, column: i32)

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 gobject::ObjectExt::set to set the EntryCompletion:text-column property directly.

column

the column in the model of self to get strings from

fn get_property_cell_area(&self) -> Option<CellArea>

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

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

fn connect_action_activated<F: Fn(&Self, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Gets emitted when an action is activated.

index

the index of the activated action

fn connect_cursor_on_match<F: Fn(&Self, &TreeModel, &TreeIter) -> Inhibit + 'static>(
    &self,
    f: F
) -> SignalHandlerId

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 EntryCompletionExt::set_model.

model

the TreeModel containing the matches

iter

a TreeIter positioned at the selected match

Returns

true if the signal has been handled

fn connect_insert_prefix<F: Fn(&Self, &str) -> Inhibit + 'static>(
    &self,
    f: F
) -> SignalHandlerId

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

fn connect_match_selected<F: Fn(&Self, &TreeModel, &TreeIter) -> Inhibit + 'static>(
    &self,
    f: F
) -> SignalHandlerId

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 EntryCompletionExt::set_model.

model

the TreeModel containing the matches

iter

a TreeIter positioned at the selected match

Returns

true if the signal has been handled

fn connect_no_matches<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

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

fn connect_property_inline_completion_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_inline_selection_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_minimum_key_length_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_model_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_popup_completion_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_popup_set_width_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_popup_single_match_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_text_column_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<EntryCompletion>> EntryCompletionExt for O[src]

Loading content...