gtksourceviewmm: Gsv::CompletionProvider Class Reference
Completion provider interface. More...
#include <gtksourceviewmm/completionprovider.h>
Public Member Functions | |
CompletionProvider (CompletionProvider&& src) noexcept | |
CompletionProvider& | operator= (CompletionProvider&& src) noexcept |
virtual | ~CompletionProvider () noexcept |
GtkSourceCompletionProvider* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkSourceCompletionProvider* | gobj () const |
Provides access to the underlying C GObject. More... | |
Glib::ustring | get_name () const |
Get the name of the provider. More... | |
Glib::RefPtr< Gdk::Pixbuf > | get_icon () |
Get the icon of the provider. More... | |
Glib::RefPtr< const Gdk::Pixbuf > | get_icon () const |
Get the icon of the provider. More... | |
void | populate (const Glib::RefPtr< CompletionContext >& context) |
Populate context with proposals from a provider. More... | |
bool | match (const Glib::RefPtr< const CompletionContext >& context) const |
Get whether the provider match the context of completion detailed in context. More... | |
Gtk::Widget* | get_info_widget (const Glib::RefPtr< const CompletionProposal >& proposal) |
Get a customized info widget to show extra information of a proposal. More... | |
const Gtk::Widget* | get_info_widget (const Glib::RefPtr< const CompletionProposal >& proposal) const |
Get a customized info widget to show extra information of a proposal. More... | |
void | update_info (const Glib::RefPtr< const CompletionProposal >& proposal, const CompletionInfo& info) |
Update extra information shown in info for proposal. More... | |
bool | get_start_iter (const Glib::RefPtr< const CompletionContext >& context, const Glib::RefPtr< const CompletionProposal >& proposal, Gtk::TextIter& iter) |
Get the Gtk::TextIter at which the completion for proposal starts. More... | |
bool | activate_proposal (const Glib::RefPtr< CompletionProposal >& proposal, const Gtk::TextIter& iter) |
Activate proposal at iter. More... | |
CompletionActivation | get_activation () const |
Get with what kind of activation the provider should be activated. More... | |
int | get_interactive_delay () const |
Get the delay in milliseconds before starting interactive completion for this provider. More... | |
int | get_priority () const |
Get the provider priority. More... | |
Public Member Functions inherited from Glib::Interface | |
Interface () | |
Interface (Interface &&src) noexcept | |
Interface & | operator= (Interface &&src) noexcept |
Interface (const Glib::Interface_Class &interface_class) | |
Interface (GObject *castitem) | |
virtual | ~Interface () noexcept |
Interface (const Interface &)=delete | |
Interface & | operator= (const Interface &)=delete |
GObject * | gobj () |
const GObject * | gobj () const |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
Public Member Functions inherited from sigc::trackable | |
trackable () | |
trackable (const trackable &src) | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (void *data) const |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
CompletionProvider () | |
You should derive from this class to use it. More... | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gsv::CompletionProvider > | wrap (GtkSourceCompletionProvider* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
Public Types inherited from sigc::trackable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Detailed Description
Completion provider interface.
You must implement this interface to provide proposals to Completion.
Constructor & Destructor Documentation
|
protected |
You should derive from this class to use it.
|
noexcept |
|
virtualnoexcept |
Member Function Documentation
bool Gsv::CompletionProvider::activate_proposal | ( | const Glib::RefPtr< CompletionProposal >& | proposal, |
const Gtk::TextIter & | iter | ||
) |
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 label of proposal.
- Parameters
-
proposal A CompletionProposal. iter A Gtk::TextIter.
- Returns
true
to indicate that the proposal activation has been handled,false
otherwise.
|
static |
CompletionActivation Gsv::CompletionProvider::get_activation | ( | ) | const |
Get with what kind of activation the provider should be activated.
- Returns
- A combination of CompletionActivation.
Glib::RefPtr<Gdk::Pixbuf> Gsv::CompletionProvider::get_icon | ( | ) |
Get the icon of the provider.
- Returns
- The icon to be used for the provider, or empty Glib::RefPtr if the provider does not have a special icon.
Glib::RefPtr<const Gdk::Pixbuf> Gsv::CompletionProvider::get_icon | ( | ) | const |
Get the icon of the provider.
- Returns
- The icon to be used for the provider, or empty Glib::RefPtr if the provider does not have a special icon.
Gtk::Widget* Gsv::CompletionProvider::get_info_widget | ( | const Glib::RefPtr< const CompletionProposal >& | proposal | ) |
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 implemented, update_info() must also be implemented. If not implemented, the default get_info() will be used to display extra information about a CompletionProposal.
- Parameters
-
proposal The currently selected CompletionProposal.
- Returns
- A custom Gtk::Widget to show extra information about proposal.
const Gtk::Widget* Gsv::CompletionProvider::get_info_widget | ( | const Glib::RefPtr< const CompletionProposal >& | proposal | ) | const |
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 implemented, update_info() must also be implemented. If not implemented, the default get_info() will be used to display extra information about a CompletionProposal.
- Parameters
-
proposal The currently selected CompletionProposal.
- Returns
- A custom Gtk::Widget to show extra information about proposal.
int Gsv::CompletionProvider::get_interactive_delay | ( | ) | const |
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 Completion::property_auto_complete_delay().
- Returns
- The interactive delay in milliseconds.
Glib::ustring Gsv::CompletionProvider::get_name | ( | ) | const |
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().
- Returns
- A new string containing the name of the provider.
int Gsv::CompletionProvider::get_priority | ( | ) | const |
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.
- Returns
- The provider priority.
bool Gsv::CompletionProvider::get_start_iter | ( | const Glib::RefPtr< const CompletionContext >& | context, |
const Glib::RefPtr< const CompletionProposal >& | proposal, | ||
Gtk::TextIter & | iter | ||
) |
Get the Gtk::TextIter at which the completion for proposal starts.
When implemented, the completion can use this information to position the completion window accordingly when a proposal is selected in the completion window.
- Parameters
-
proposal A CompletionProposal. context A CompletionContext. iter A Gtk::TextIter.
- Returns
true
if iter was set for proposal,false
otherwise.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
bool Gsv::CompletionProvider::match | ( | const Glib::RefPtr< const CompletionContext >& | context | ) | const |
Get whether the provider match the context of completion detailed in context.
- Parameters
-
context The CompletionContext.
- Returns
true
if provider matches the completion context,false
otherwise.
|
noexcept |
void Gsv::CompletionProvider::populate | ( | const Glib::RefPtr< CompletionContext >& | context | ) |
Populate context with proposals from a provider.
- Parameters
-
context The CompletionContext.
void Gsv::CompletionProvider::update_info | ( | const Glib::RefPtr< const CompletionProposal >& | proposal, |
const CompletionInfo& | info | ||
) |
Update extra information shown in info for proposal.
This should be implemented if your provider sets a custom info widget for proposal. This function must be implemented when get_info_widget() is implemented.
- Parameters
-
proposal A CompletionProposal. info A CompletionInfo.
Friends And Related Function Documentation
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.