GtkSource.CompletionProvider¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class GtkSource.CompletionProvider¶
- Bases:
- Structure:
- activate_proposal(proposal, iter)¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.iter (
Gtk.TextIter
) – aGtk.TextIter
.
- Returns:
True
to indicate that the proposal activation has been handled,False
otherwise.- Return type:
Activate proposal at iter. When this functions returns
False
, the default activation of proposal will take place which replaces the word at iter with the text of proposal (seeGtkSource.CompletionProposal.get_text
()).Here is how the default activation selects the boundaries of the word to replace. The end of the word is iter. For the start of the word, it depends on whether a start iter is defined for proposal (see
GtkSource.CompletionProvider.get_start_iter
()). If a start iter is defined, the start of the word is the start iter. Else, the word (as long as possible) will contain only alphanumerical and the “_” characters.
- get_activation()¶
- Returns:
a combination of
GtkSource.CompletionActivation
.- Return type:
Get with what kind of activation the provider should be activated.
- get_gicon()¶
- Returns:
The icon to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Gets the
Gio.Icon
for the icon of self.New in version 3.18.
- get_icon()¶
- Returns:
The icon to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Get the
GdkPixbuf.Pixbuf
for the icon of the self.
- get_icon_name()¶
- Returns:
The icon name to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Gets the icon name of self.
New in version 3.18.
- get_info_widget(proposal)¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – a currently selectedGtkSource.CompletionProposal
.- Returns:
a custom
Gtk.Widget
to show extra information about proposal, orNone
if the provider does not have a special info widget.- Return type:
Gtk.Widget
orNone
Get a customized info widget to show extra information of a proposal. This allows for customized widgets on a proposal basis, although in general providers will have the same custom widget for all their proposals and proposal can be ignored. The implementation of this function is optional.
If this function is not implemented, the default widget is a
Gtk.Label
. The return value ofGtkSource.CompletionProposal.get_info
() is used as the content of theGtk.Label
.If implemented,
GtkSource.CompletionProvider.update_info
() must also be implemented.
- get_interactive_delay()¶
- Returns:
the interactive delay in milliseconds.
- Return type:
Get the delay in milliseconds before starting interactive completion for this provider. A value of -1 indicates to use the default value as set by the
GtkSource.Completion
:auto-complete-delay
property.
- get_name()¶
- Returns:
a new string containing the name of the provider.
- Return type:
Get the name of the provider. This should be a translatable name for display to the user. For example: _(“Document word completion provider”). The returned string must be freed with
GLib.free
().
- get_priority()¶
- Returns:
the provider priority.
- Return type:
Get the provider priority. The priority determines the order in which proposals appear in the completion popup. Higher priorities are sorted before lower priorities. The default priority is 0.
- get_start_iter(context, proposal)¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.
- Returns:
True
if iter was set for proposal,False
otherwise.- iter:
a
Gtk.TextIter
.
- Return type:
(
bool
, iter:Gtk.TextIter
)
Get the
Gtk.TextIter
at which the completion for proposal starts. When implemented, this information is used to position the completion window accordingly when a proposal is selected in the completion window. The proposal text inside the completion window is aligned on iter.If this function is not implemented, the word boundary is taken to position the completion window. See
GtkSource.CompletionProvider.activate_proposal
() for an explanation on the word boundaries.When the proposal is activated, the default handler uses iter as the start of the word to replace. See
GtkSource.CompletionProvider.activate_proposal
() for more information.
- match(context)¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.- Returns:
True
if self matches the completion context,False
otherwise.- Return type:
Get whether the provider match the context of completion detailed in context.
- populate(context)¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.
Populate context with proposals from self added with the
GtkSource.CompletionContext.add_proposals
() function.
- update_info(proposal, info)¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.info (
GtkSource.CompletionInfo
) – aGtkSource.CompletionInfo
.
Update extra information shown in info for proposal.
This function must be implemented when
GtkSource.CompletionProvider.get_info_widget
() is implemented.
- do_activate_proposal(proposal, iter) virtual¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.iter (
Gtk.TextIter
) – aGtk.TextIter
.
- Returns:
True
to indicate that the proposal activation has been handled,False
otherwise.- Return type:
Activate proposal at iter. When this functions returns
False
, the default activation of proposal will take place which replaces the word at iter with the text of proposal (seeGtkSource.CompletionProposal.get_text
()).Here is how the default activation selects the boundaries of the word to replace. The end of the word is iter. For the start of the word, it depends on whether a start iter is defined for proposal (see
GtkSource.CompletionProvider.get_start_iter
()). If a start iter is defined, the start of the word is the start iter. Else, the word (as long as possible) will contain only alphanumerical and the “_” characters.
- do_get_activation() virtual¶
- Returns:
a combination of
GtkSource.CompletionActivation
.- Return type:
Get with what kind of activation the provider should be activated.
- do_get_gicon() virtual¶
- Returns:
The icon to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Gets the
Gio.Icon
for the icon of provider.New in version 3.18.
- do_get_icon() virtual¶
- Returns:
The icon to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Get the
GdkPixbuf.Pixbuf
for the icon of the provider.
- do_get_icon_name() virtual¶
- Returns:
The icon name to be used for the provider, or
None
if the provider does not have a special icon.- Return type:
Gets the icon name of provider.
New in version 3.18.
- do_get_info_widget(proposal) virtual¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – a currently selectedGtkSource.CompletionProposal
.- Returns:
a custom
Gtk.Widget
to show extra information about proposal, orNone
if the provider does not have a special info widget.- Return type:
Gtk.Widget
orNone
Get a customized info widget to show extra information of a proposal. This allows for customized widgets on a proposal basis, although in general providers will have the same custom widget for all their proposals and proposal can be ignored. The implementation of this function is optional.
If this function is not implemented, the default widget is a
Gtk.Label
. The return value ofGtkSource.CompletionProposal.get_info
() is used as the content of theGtk.Label
.If implemented,
GtkSource.CompletionProvider.update_info
() must also be implemented.
- do_get_interactive_delay() virtual¶
- Returns:
the interactive delay in milliseconds.
- Return type:
Get the delay in milliseconds before starting interactive completion for this provider. A value of -1 indicates to use the default value as set by the
GtkSource.Completion
:auto-complete-delay
property.
- do_get_name() virtual¶
- Returns:
a new string containing the name of the provider.
- Return type:
Get the name of the provider. This should be a translatable name for display to the user. For example: _(“Document word completion provider”). The returned string must be freed with
GLib.free
().
- do_get_priority() virtual¶
- Returns:
the provider priority.
- Return type:
Get the provider priority. The priority determines the order in which proposals appear in the completion popup. Higher priorities are sorted before lower priorities. The default priority is 0.
- do_get_start_iter(context, proposal) virtual¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.
- Returns:
True
if iter was set for proposal,False
otherwise.- iter:
a
Gtk.TextIter
.
- Return type:
(
bool
, iter:Gtk.TextIter
)
Get the
Gtk.TextIter
at which the completion for proposal starts. When implemented, this information is used to position the completion window accordingly when a proposal is selected in the completion window. The proposal text inside the completion window is aligned on iter.If this function is not implemented, the word boundary is taken to position the completion window. See
GtkSource.CompletionProvider.activate_proposal
() for an explanation on the word boundaries.When the proposal is activated, the default handler uses iter as the start of the word to replace. See
GtkSource.CompletionProvider.activate_proposal
() for more information.
- do_match(context) virtual¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.- Returns:
True
if provider matches the completion context,False
otherwise.- Return type:
Get whether the provider match the context of completion detailed in context.
- do_populate(context) virtual¶
- Parameters:
context (
GtkSource.CompletionContext
) – aGtkSource.CompletionContext
.
Populate context with proposals from provider added with the
GtkSource.CompletionContext.add_proposals
() function.
- do_update_info(proposal, info) virtual¶
- Parameters:
proposal (
GtkSource.CompletionProposal
) – aGtkSource.CompletionProposal
.info (
GtkSource.CompletionInfo
) – aGtkSource.CompletionInfo
.
Update extra information shown in info for proposal.
This function must be implemented when
GtkSource.CompletionProvider.get_info_widget
() is implemented.