GscProposal

GscProposal — Completion proposal object

Synopsis

                    GscProposalPrivate;
                    GscProposalClass;
                    GscProposal;
GscProposal *       gsc_proposal_new                    (const gchar *label,
                                                         const gchar *info,
                                                         GdkPixbuf *icon);
const gchar *       gsc_proposal_get_label              (GscProposal *proposal);
const GdkPixbuf *   gsc_proposal_get_icon               (GscProposal *proposal);
void                gsc_proposal_set_page_name          (GscProposal *self,
                                                         const gchar *page_name);
const gchar *       gsc_proposal_get_page_name          (GscProposal *proposal);
const gchar *       gsc_proposal_get_info               (GscProposal *proposal);
void                gsc_proposal_apply                  (GscProposal *proposal,
                                                         GtkTextView *view);

Object Hierarchy

  GObject
   +----GscProposal

Properties

  "icon"                     gpointer              : Read / Write
  "info"                     gchar*                : Read / Write
  "label"                    gchar*                : Read / Write
  "page-name"                gchar*                : Read / Write

Description

Every proposal is an item into the popup. It controls the label to be shown, the help (info) and the apply when the user selects the proposal.

Details

GscProposalPrivate

typedef struct _GscProposalPrivate GscProposalPrivate;


GscProposalClass

typedef struct {
	GObjectClass parent_class;
	
	gboolean     (*apply)    (GscProposal *proposal,
				  GtkTextView *view);
	const gchar* (*get_info) (GscProposal *proposal);
} GscProposalClass;


GscProposal

typedef struct _GscProposal GscProposal;


gsc_proposal_new ()

GscProposal *       gsc_proposal_new                    (const gchar *label,
                                                         const gchar *info,
                                                         GdkPixbuf *icon);

This function creates a new GscProposal. By default, when the user selects the proposal, the proposal label will be inserted into the GtkTextView. You can overwrite the apply and disply-info functions to overwrite the default.

label :

Item label that will be shown in the completion popup.

info :

Item info markup that will be shown when the user select to view the item info.

icon :

Item icon that will be shown in the completion popup

Returns :

A new GscProposal

gsc_proposal_get_label ()

const gchar *       gsc_proposal_get_label              (GscProposal *proposal);

proposal :

Returns :

The proposal label that will be shown into the popup

gsc_proposal_get_icon ()

const GdkPixbuf *   gsc_proposal_get_icon               (GscProposal *proposal);

Gets the icon of this proposal that will be shown into the popup.

proposal :

Returns :

the icon of this proposal that will be shown into the popup

gsc_proposal_set_page_name ()

void                gsc_proposal_set_page_name          (GscProposal *self,
                                                         const gchar *page_name);

Sets the name of the page where this proposal will be shown. If page_name is NULL the default page will be used.

self :

The GscProposal

page_name :

The name for the page

gsc_proposal_get_page_name ()

const gchar *       gsc_proposal_get_page_name          (GscProposal *proposal);

Gets the page name where the proposal will be placed.

proposal :

Returns :

the page name where the proposal will be placed.

gsc_proposal_get_info ()

const gchar *       gsc_proposal_get_info               (GscProposal *proposal);

The completion calls this function when the user wants to see the proposal info. You can overwrite this function if you need to change the default mechanism.

proposal :

Returns :

The proposal info markup asigned for this proposal or NULL;

gsc_proposal_apply ()

void                gsc_proposal_apply                  (GscProposal *proposal,
                                                         GtkTextView *view);

The completion calls this function when the user selects the proposal. The default handler insert the proposal label into the view. You can overwrite this function.

proposal :

view :

The GtkTextView

Property Details

The "icon" property

  "icon"                     gpointer              : Read / Write

Icon to be shown for this proposal


The "info" property

  "info"                     gchar*                : Read / Write

Info to be shown for this proposal

Default value: NULL


The "label" property

  "label"                    gchar*                : Read / Write

Label to be shown for this proposal

Default value: NULL


The "page-name" property

  "page-name"                gchar*                : Read / Write

Page name for this proposal

Default value: NULL