GscProposal

GscProposal

Synopsis

#define             GSC_PROPOSAL_DEFAULT_PAGE
#define             GSC_PROPOSAL_DEFAULT_PRIORITY
                    GscProposalPrivate;
                    GscProposal;
GscProposal*        gsc_proposal_new                    (const gchar *label,
                                                         const gchar *info,
                                                         const 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

Signals

  "apply"                                          : Run Last / Action

Description

Details

GSC_PROPOSAL_DEFAULT_PAGE

#define GSC_PROPOSAL_DEFAULT_PAGE "Default"


GSC_PROPOSAL_DEFAULT_PRIORITY

#define GSC_PROPOSAL_DEFAULT_PRIORITY 10


GscProposalPrivate

typedef struct _GscProposalPrivate GscProposalPrivate;


GscProposal

typedef struct _GscProposal GscProposal;


gsc_proposal_new ()

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

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

label :

Item label that will be shown in the completion popup. We copy this string

info :

Item info markup that will be shown when the user select to view the item info. We copy this string

icon :

Item icon that will be shown in the completion popup

Returns :

The new GscProposal

gsc_proposal_get_label ()

const gchar*        gsc_proposal_get_label              (GscProposal *proposal);

proposal :

The GscProposal

Returns :

The proposal label that will be shown into the popup

gsc_proposal_get_icon ()

const GdkPixbuf*    gsc_proposal_get_icon               (GscProposal *proposal);

proposal :

The GscProposal

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);

self :

page_name :

The page name where this proposal will be shown. If NULL the default page will be used.

gsc_proposal_get_page_name ()

const gchar*        gsc_proposal_get_page_name          (GscProposal *proposal);

proposal :

The GscProposal

Returns :

the page name where the proposal will be placed.

gsc_proposal_get_info ()

const gchar*        gsc_proposal_get_info               (GscProposal *proposal);

proposal :

The GscProposal

Returns :

The proposal info markup asigned for this proposal. The completion calls this function when the user want to view the proposal info. You can overwrite this function if you need to change the default mechanism

gsc_proposal_apply ()

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

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

proposal :

The GscProposal

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

Signal Details

The "apply" signal

gboolean            user_function                      (GscProposal *proposal,
                                                        gpointer     view,
                                                        gpointer     user_data)      : Run Last / Action

The ::apply signal is emitted when the proposal has been selected and must to be applied.

proposal :

The proposal who emits the signal

view :

The GtkTextView where the proposal must be applied

user_data :

user data set when the signal handler was connected.