pub trait CompletionExt: IsA<Completion> + Sealed + 'static {
Show 45 methods // Provided methods fn add_provider( &self, provider: &impl IsA<CompletionProvider> ) -> Result<(), Error> { ... } fn block_interactive(&self) { ... } fn info_window(&self) -> Option<CompletionInfo> { ... } fn providers(&self) -> Vec<CompletionProvider> { ... } fn view(&self) -> Option<View> { ... } fn hide(&self) { ... } fn remove_provider( &self, provider: &impl IsA<CompletionProvider> ) -> Result<(), Error> { ... } fn start( &self, providers: &[CompletionProvider], context: &impl IsA<CompletionContext> ) -> bool { ... } fn unblock_interactive(&self) { ... } fn accelerators(&self) -> u32 { ... } fn set_accelerators(&self, accelerators: u32) { ... } fn auto_complete_delay(&self) -> u32 { ... } fn set_auto_complete_delay(&self, auto_complete_delay: u32) { ... } fn proposal_page_size(&self) -> u32 { ... } fn set_proposal_page_size(&self, proposal_page_size: u32) { ... } fn provider_page_size(&self) -> u32 { ... } fn set_provider_page_size(&self, provider_page_size: u32) { ... } fn is_remember_info_visibility(&self) -> bool { ... } fn set_remember_info_visibility(&self, remember_info_visibility: bool) { ... } fn selects_on_show(&self) -> bool { ... } fn set_select_on_show(&self, select_on_show: bool) { ... } fn shows_headers(&self) -> bool { ... } fn set_show_headers(&self, show_headers: bool) { ... } fn shows_icons(&self) -> bool { ... } fn set_show_icons(&self, show_icons: bool) { ... } fn connect_activate_proposal<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_activate_proposal(&self) { ... } fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_hide(&self) { ... } fn connect_move_cursor<F: Fn(&Self, ScrollStep, i32) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_move_cursor(&self, step: ScrollStep, num: i32) { ... } fn connect_move_page<F: Fn(&Self, ScrollStep, i32) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_move_page(&self, step: ScrollStep, num: i32) { ... } fn connect_populate_context<F: Fn(&Self, &CompletionContext) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_populate_context(&self, context: &CompletionContext) { ... } fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_show(&self) { ... } fn connect_accelerators_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_auto_complete_delay_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_proposal_page_size_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_provider_page_size_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_remember_info_visibility_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_select_on_show_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_show_headers_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_show_icons_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Completion methods.

Implementors

Completion

Provided Methods§

source

fn add_provider( &self, provider: &impl IsA<CompletionProvider> ) -> Result<(), Error>

Add a new CompletionProvider to the completion object. This will add a reference provider, so make sure to unref your own copy when you no longer need it.

provider

a CompletionProvider.

Returns

true if provider was successfully added, otherwise if error is provided, it will be set with the error and false is returned.

source

fn block_interactive(&self)

Block interactive completion. This can be used to disable interactive completion when inserting or deleting text from the buffer associated with the completion. Use unblock_interactive() to enable interactive completion again.

This function may be called multiple times. It will continue to block interactive completion until unblock_interactive() has been called the same number of times.

source

fn info_window(&self) -> Option<CompletionInfo>

The info widget is the window where the completion displays optional extra information of the proposal.

Returns

The CompletionInfo window associated with self.

source

fn providers(&self) -> Vec<CompletionProvider>

Get list of providers registered on self. The returned list is owned by the completion and should not be freed.

Returns

list of CompletionProvider.

source

fn view(&self) -> Option<View>

The View associated with self, or None if the view has been destroyed.

Returns

The View associated with self, or None.

source

fn hide(&self)

Hides the completion if it is active (visible).

source

fn remove_provider( &self, provider: &impl IsA<CompletionProvider> ) -> Result<(), Error>

Remove provider from the completion.

provider

a CompletionProvider.

Returns

true if provider was successfully removed, otherwise if error is provided, it will be set with the error and false is returned.

source

fn start( &self, providers: &[CompletionProvider], context: &impl IsA<CompletionContext> ) -> bool

Starts a new completion with the specified CompletionContext and a list of potential candidate providers for completion.

It can be convenient for showing a completion on-the-fly, without the need to add or remove providers to the Completion.

Another solution is to add providers with add_provider(), and implement CompletionProviderExt::match_() for each provider.

providers

a list of CompletionProvider, or None.

context

The CompletionContext with which to start the completion.

Returns

true if it was possible to the show completion window.

source

fn unblock_interactive(&self)

Unblock interactive completion. This can be used after using block_interactive() to enable interactive completion again.

source

fn accelerators(&self) -> u32

Number of keyboard accelerators to show for the first proposals. For example, to activate the first proposal, the user can press <keycombo>``<keycap>Alt</keycap>``<keycap>1</keycap>``</keycombo>.

source

fn set_accelerators(&self, accelerators: u32)

Number of keyboard accelerators to show for the first proposals. For example, to activate the first proposal, the user can press <keycombo>``<keycap>Alt</keycap>``<keycap>1</keycap>``</keycombo>.

source

fn auto_complete_delay(&self) -> u32

Determines the popup delay (in milliseconds) at which the completion will be shown for interactive completion.

source

fn set_auto_complete_delay(&self, auto_complete_delay: u32)

Determines the popup delay (in milliseconds) at which the completion will be shown for interactive completion.

source

fn proposal_page_size(&self) -> u32

The scroll page size of the proposals in the completion window. In other words, when <keycap>PageDown</keycap> or <keycap>PageUp</keycap> is pressed, the selected proposal becomes the one which is located one page size backward or forward.

See also the move-cursor signal.

source

fn set_proposal_page_size(&self, proposal_page_size: u32)

The scroll page size of the proposals in the completion window. In other words, when <keycap>PageDown</keycap> or <keycap>PageUp</keycap> is pressed, the selected proposal becomes the one which is located one page size backward or forward.

See also the move-cursor signal.

source

fn provider_page_size(&self) -> u32

The scroll page size of the provider pages in the completion window.

See the move-page signal.

source

fn set_provider_page_size(&self, provider_page_size: u32)

The scroll page size of the provider pages in the completion window.

See the move-page signal.

source

fn is_remember_info_visibility(&self) -> bool

Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.

source

fn set_remember_info_visibility(&self, remember_info_visibility: bool)

Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.

source

fn selects_on_show(&self) -> bool

Determines whether the first proposal should be selected when the completion is first shown.

source

fn set_select_on_show(&self, select_on_show: bool)

Determines whether the first proposal should be selected when the completion is first shown.

source

fn shows_headers(&self) -> bool

Determines whether provider headers should be shown in the proposal list. It can be useful to disable when there is only one provider.

source

fn set_show_headers(&self, show_headers: bool)

Determines whether provider headers should be shown in the proposal list. It can be useful to disable when there is only one provider.

source

fn shows_icons(&self) -> bool

Determines whether provider and proposal icons should be shown in the completion popup.

source

fn set_show_icons(&self, show_icons: bool)

Determines whether provider and proposal icons should be shown in the completion popup.

source

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

The activate-proposal signal is a keybinding signal which gets emitted when the user initiates a proposal activation.

Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the proposal activation programmatically.

source

fn emit_activate_proposal(&self)

source

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

Emitted when the completion window is hidden. The default handler will actually hide the window.

source

fn emit_hide(&self)

source

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

The move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement.

The <keycap>Up</keycap>, <keycap>Down</keycap>, <keycap>PageUp</keycap>, <keycap>PageDown</keycap>, <keycap>Home</keycap> and <keycap>End</keycap> keys are bound to the normal behavior expected by those keys.

When step is equal to gtk::ScrollStep::Pages, the page size is defined by the proposal-page-size property. It is used for the <keycap>PageDown</keycap> and <keycap>PageUp</keycap> keys.

Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.

step

The gtk::ScrollStep by which to move the cursor

num

The amount of steps to move the cursor

source

fn emit_move_cursor(&self, step: ScrollStep, num: i32)

source

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

The move-page signal is a keybinding signal which gets emitted when the user initiates a page movement (i.e. switches between provider pages).

<keycombo>``<keycap>Control</keycap>``<keycap>Left</keycap>``</keycombo> is for going to the previous provider. <keycombo>``<keycap>Control</keycap>``<keycap>Right</keycap>``</keycombo> is for going to the next provider. <keycombo>``<keycap>Control</keycap>``<keycap>Home</keycap>``</keycombo> is for displaying all the providers. <keycombo>``<keycap>Control</keycap>``<keycap>End</keycap>``</keycombo> is for going to the last provider.

When step is equal to gtk::ScrollStep::Pages, the page size is defined by the provider-page-size property.

Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the page selection programmatically.

step

The gtk::ScrollStep by which to move the page

num

The amount of steps to move the page

source

fn emit_move_page(&self, step: ScrollStep, num: i32)

source

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

Emitted just before starting to populate the completion with providers. You can use this signal to add additional attributes in the context.

context

The CompletionContext for the current completion

source

fn emit_populate_context(&self, context: &CompletionContext)

source

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

Emitted when the completion window is shown. The default handler will actually show the window.

source

fn emit_show(&self)

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§