gsc-provider

gsc-provider

Synopsis

#define             GSC_PROVIDER_GET_INTERFACE          (obj)
#define             GSC_COMPLETION_CAPABILITY_INTERACTIVE
#define             GSC_COMPLETION_CAPABILITY_AUTOMATIC
                    GscProvider;
                    GscProviderIface;
const gchar *       gsc_provider_get_name               (GscProvider *provider);
GdkPixbuf *         gsc_provider_get_icon               (GscProvider *provider);
void                gsc_provider_populate_completion    (GscProvider *provider,
                                                         GscContext *context);
const gchar *       gsc_provider_get_capabilities       (GscProvider *provider);
GtkWidget *         gsc_provider_get_info_widget        (GscProvider *provider,
                                                         GscProposal *proposal);
void                gsc_provider_update_info            (GscProvider *provider,
                                                         GscProposal *proposal,
                                                         GscInfo *info);
gboolean            gsc_provider_activate_proposal      (GscProvider *provider,
                                                         GscProposal *proposal,
                                                         GtkTextIter *iter);

Object Hierarchy

  GInterface
   +----GscProvider

Description

Details

GSC_PROVIDER_GET_INTERFACE()

#define GSC_PROVIDER_GET_INTERFACE(obj) 	(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GSC_TYPE_PROVIDER, GscProviderIface))

obj :


GSC_COMPLETION_CAPABILITY_INTERACTIVE

#define GSC_COMPLETION_CAPABILITY_INTERACTIVE "standard::interactive"


GSC_COMPLETION_CAPABILITY_AUTOMATIC

#define GSC_COMPLETION_CAPABILITY_AUTOMATIC "standard::automatic"


GscProvider

typedef struct _GscProvider GscProvider;


GscProviderIface

typedef struct {
	GTypeInterface g_iface;
	
	const gchar	*(*get_name)       	(GscProvider *provider);
	GdkPixbuf	*(*get_icon)       	(GscProvider *provider);
	void		 (*populate_completion)	(GscProvider *provider,
						 GscContext  *context);

	const gchar     *(*get_capabilities)	(GscProvider *provider);

	GtkWidget 	*(*get_info_widget)	(GscProvider *provider,
						 GscProposal *proposal);
	void		 (*update_info)		(GscProvider *provider,
						 GscProposal *proposal,
						 GscInfo     *info);

	gboolean	 (*activate_proposal)	(GscProvider *provider,
						 GscProposal *proposal,
						 GtkTextIter                 *iter);
} GscProviderIface;


gsc_provider_get_name ()

const gchar *       gsc_provider_get_name               (GscProvider *provider);

Get the name of the provider. This should be a translatable name for display to the user. For example: _("Document word completion provider").

provider :

The GscProvider

Returns :

The name of the provider.

gsc_provider_get_icon ()

GdkPixbuf *         gsc_provider_get_icon               (GscProvider *provider);

Get the icon of the provider.

provider :

The GscProvider

Returns :

The icon to be used for the provider, or NULL if the provider does not have a special icon.

gsc_provider_populate_completion ()

void                gsc_provider_populate_completion    (GscProvider *provider,
                                                         GscContext *context);

TODO Document this function

provider :

The GscProvider

context :

The GscContext to add the proposals, get the current criteria etc.

gsc_provider_get_capabilities ()

const gchar *       gsc_provider_get_capabilities       (GscProvider *provider);

A list of capabilities this provider supports

provider :

The GscProvider

Returns :

list of capabilities.

gsc_provider_get_info_widget ()

GtkWidget *         gsc_provider_get_info_widget        (GscProvider *provider,
                                                         GscProposal *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, gsc_provider_update_info MUST also be implemented. If not implemented, the default gsc_proposal_get_info will be used to display extra information about a GscProposal.

provider :

The GscProvider

proposal :

The currently selected GscProposal

Returns :

a custom GtkWidget to show extra information about proposal.

gsc_provider_update_info ()

void                gsc_provider_update_info            (GscProvider *provider,
                                                         GscProposal *proposal,
                                                         GscInfo *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 gsc_provider_get_info_widget is implemented.

provider :

A GscProvider

proposal :

A GscProposal

info :

A GscInfo

gsc_provider_activate_proposal ()

gboolean            gsc_provider_activate_proposal      (GscProvider *provider,
                                                         GscProposal *proposal,
                                                         GtkTextIter *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.

provider :

A GscProvider

proposal :

A GscProposal

iter :

A GtkTextIter

Returns :

TRUE to indicate that the proposal activation has been handled, FALSE otherwise.