GscManager

GscManager

Synopsis

#define             USER_REQUEST_TRIGGER_NAME
                    GscManagerPrivate;
                    GscManagerEventOptions;
                    GscManager;
GscManager*         gsc_manager_get_from_view           (GtkTextView *view);
GscManager*         gsc_manager_new                     (GtkTextView *view);
GtkTextView*        gsc_manager_get_view                (GscManager *completion);
gboolean            gsc_manager_is_visible              (GscManager *completion);
gboolean            gsc_manager_register_provider       (GscManager *completion,
                                                         GscProvider *provider,
                                                         const gchar *trigger_name);
gboolean            gsc_manager_unregister_provider     (GscManager *completion,
                                                         GscProvider *provider,
                                                         const gchar *trigger_name);
GscProvider*        gsc_manager_get_provider            (GscManager *completion,
                                                         const gchar *provider_name);
void                gsc_manager_register_trigger        (GscManager *completion,
                                                         GscTrigger *trigger);
void                gsc_manager_unregister_trigger      (GscManager *completion,
                                                         GscTrigger *trigger);
GscTrigger*         gsc_manager_get_trigger             (GscManager *completion,
                                                         const gchar *trigger_name);
GscTrigger*         gsc_manager_get_active_trigger      (GscManager *completion);
void                gsc_manager_activate                (GscManager *completion);
void                gsc_manager_deactivate              (GscManager *completion);
void                gsc_manager_finish_completion       (GscManager *completion);
void                gsc_manager_trigger_event           (GscManager *completion,
                                                         const gchar *trigger_name,
                                                         gpointer event_data);
void                gsc_manager_trigger_event_with_opts (GscManager *completion,
                                                         const gchar *trigger_name,
                                                         GscManagerEventOptions *options,
                                                         gpointer event_data);
void                gsc_manager_set_current_info        (GscManager *self,
                                                         gchar *info);
void                gsc_manager_update_event_options    (GscManager *self,
                                                         GscManagerEventOptions *options);
void                gsc_manager_get_current_event_options
                                                        (GscManager *self,
                                                         GscManagerEventOptions *options);

Object Hierarchy

  GObject
   +----GscManager

Properties

  "info-keys"                gchar*                : Read / Write
  "next-page-keys"           gchar*                : Read / Write
  "previous-page-keys"       gchar*                : Read / Write

Description

Details

USER_REQUEST_TRIGGER_NAME

#define USER_REQUEST_TRIGGER_NAME "user-request"


GscManagerPrivate

typedef struct _GscManagerPrivate GscManagerPrivate;


GscManagerEventOptions

typedef struct {
	GscPopupPositionType position_type;
	GscPopupFilterType filter_type;
	const gchar* filter_text;
	gboolean autoselect;
	gboolean show_bottom_bar;
} GscManagerEventOptions;

GscPopupPositionType position_type;

GscPopupFilterType filter_type;

const gchar *filter_text;

gboolean autoselect;

If TRUE, the completion selects automatically if there is only one proposal and only one page

gboolean show_bottom_bar;


GscManager

typedef struct _GscManager GscManager;


gsc_manager_get_from_view ()

GscManager*         gsc_manager_get_from_view           (GtkTextView *view);

view :

the GtkSourceView

Returns :

NULL if the GtkTextView haven't got an associated GscManager or the GscManager of this GtkTextView

gsc_manager_new ()

GscManager*         gsc_manager_new                     (GtkTextView *view);

Creates a new GscManager asociated to a GtkSourceView

view :

a GtkSourceView.

Returns :

value: A new GscManager

gsc_manager_get_view ()

GtkTextView*        gsc_manager_get_view                (GscManager *completion);

completion :

the GscManager

Returns :

The internal GtkTextView of this completion.

gsc_manager_is_visible ()

gboolean            gsc_manager_is_visible              (GscManager *completion);

completion :

The GscManager

Returns :

TRUE if the completion popup is visible.

gsc_manager_register_provider ()

gboolean            gsc_manager_register_provider       (GscManager *completion,
                                                         GscProvider *provider,
                                                         const gchar *trigger_name);

This function register the provider into the completion and reference it. When an event is raised, completion call to the provider to get the data. When the user select a proposal, it call the provider to tell it this action and the provider do that it want (normally inserts some text)

completion :

the GscManager

provider :

The GscProvider.

trigger_name :

The trigger name what you want to register this provider

Returns :

TRUE if it was registered or FALSE if not (because it has been already registered, or the trigger don't exists)

gsc_manager_unregister_provider ()

gboolean            gsc_manager_unregister_provider     (GscManager *completion,
                                                         GscProvider *provider,
                                                         const gchar *trigger_name);

This function unregister the provider.

completion :

the GscManager

provider :

The GscProvider.

trigger_name :

The trigger name what you want to unregister this provider

Returns :

TRUE if it was unregistered or FALSE if not (because it doesn't exists, or the trigger don't exists)

gsc_manager_get_provider ()

GscProvider*        gsc_manager_get_provider            (GscManager *completion,
                                                         const gchar *provider_name);

completion :

The GscManager

provider_name :

Provider's name that you are looking for.

Returns :

The provider if the completion has this provider registered or NULL if not.

gsc_manager_register_trigger ()

void                gsc_manager_register_trigger        (GscManager *completion,
                                                         GscTrigger *trigger);

This function register a completion trigger. If the completion is actived then this method activate the trigger. This function reference the trigger object

completion :

The GscManager

trigger :

The trigger to register

gsc_manager_unregister_trigger ()

void                gsc_manager_unregister_trigger      (GscManager *completion,
                                                         GscTrigger *trigger);

This function unregister a completion trigger. If the completion is actived then this method deactivate the trigger. This function reference the trigger object

completion :

The GscManager

trigger :

The trigger to unregister

gsc_manager_get_trigger ()

GscTrigger*         gsc_manager_get_trigger             (GscManager *completion,
                                                         const gchar *trigger_name);

This function return the trigger with this name.

completion :

The GscManager

trigger_name :

The trigger name to get

Returns :

The trigger or NULL if not exists

gsc_manager_get_active_trigger ()

GscTrigger*         gsc_manager_get_active_trigger      (GscManager *completion);

This function return the active trigger. The active trigger is the last trigger raised if the completion is active. If the completion is not visible then there is no an active trigger.

completion :

The GscManager

Returns :

The trigger or NULL if completion is not active

gsc_manager_activate ()

void                gsc_manager_activate                (GscManager *completion);

This function activate the completion mechanism. The completion connects all signals and activate all registered triggers.

completion :

The GscManager

gsc_manager_deactivate ()

void                gsc_manager_deactivate              (GscManager *completion);

This function deactivate the completion mechanism. The completion disconnect all signals and deactivate all registered triggers.

completion :

The GscManager

gsc_manager_finish_completion ()

void                gsc_manager_finish_completion       (GscManager *completion);

This function finish the completion if it is active (visible).

completion :

The GscManager

gsc_manager_trigger_event ()

void                gsc_manager_trigger_event           (GscManager *completion,
                                                         const gchar *trigger_name,
                                                         gpointer event_data);

Calling this function, the completion call to all providers to get data and, if they return data, it shows the completion to the user.

completion :

the GscManager

trigger_name :

The event name to raise

event_data :

This object will be passed to the providers to give them some special information of the event

gsc_manager_trigger_event_with_opts ()

void                gsc_manager_trigger_event_with_opts (GscManager *completion,
                                                         const gchar *trigger_name,
                                                         GscManagerEventOptions *options,
                                                         gpointer event_data);

Calling this function, the completion call to all providers to get data and, if they return data, it shows the completion to the user. Use this function if you want to show the popup with special parameters (position, filter, etc)

completion :

the GscManager

trigger_name :

The event name to raise

options :

Options to tell the completion how it must to work.

event_data :

This object will be passed to the providers to give them some special information of the event

gsc_manager_set_current_info ()

void                gsc_manager_set_current_info        (GscManager *self,
                                                         gchar *info);

You can use this function when a GscProposal emit the display-info signal to set the current info.

self :

The GscManager

info :

Info markup to be shown into for current proposal.

gsc_manager_update_event_options ()

void                gsc_manager_update_event_options    (GscManager *self,
                                                         GscManagerEventOptions *options);

Sets the current event options

self :

The GscManager

options :

Options struct where the option will be set.

gsc_manager_get_current_event_options ()

void                gsc_manager_get_current_event_options
                                                        (GscManager *self,
                                                         GscManagerEventOptions *options);

self :

options :

Property Details

The "info-keys" property

  "info-keys"                gchar*                : Read / Write

Keys to show/hide the info window

Default value: "<Control>i"


The "next-page-keys" property

  "next-page-keys"           gchar*                : Read / Write

Keys to show the next completion page

Default value: "Right"


The "previous-page-keys" property

  "previous-page-keys"       gchar*                : Read / Write

Keys to show the previous completion page

Default value: "Left"