## IAnjutaEditorAssist IAnjutaEditorAssist — Editor assistance framework |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-editor-assist.h>

    #define             IANJUTA_EDITOR_ASSIST_ERROR
                        IAnjutaEditorAssist;
                        IAnjutaEditorAssistIface;
    GQuark              ianjuta_editor_assist_error_quark   (void);
    void                ianjuta_editor_assist_cancel_tips   (IAnjutaEditorAssist *obj,
                                                             GError **err);
    GList*              ianjuta_editor_assist_get_suggestions
                                                            (IAnjutaEditorAssist *obj,
                                                             const gchar *context,
                                                             GError **err);
    void                ianjuta_editor_assist_hide_suggestions
                                                            (IAnjutaEditorAssist *obj,
                                                             GError **err);
    void                ianjuta_editor_assist_show_tips     (IAnjutaEditorAssist *obj,
                                                             GList *tips,
                                                             IAnjutaIterable *position,
                                                             gint char_alignment,
                                                             GError **err);
    void                ianjuta_editor_assist_suggest       (IAnjutaEditorAssist *obj,
                                                             GList *choices,
                                                             IAnjutaIterable *position,
                                                             int char_alignment,
                                                             GError **err);

## Object Hierarchy

      GInterface
       +----IAnjutaEditorAssist

## Prerequisites

IAnjutaEditorAssist requires IAnjutaEditor and GObject.

## Signals

      "assist-chosen"                                  : Run Last

## Description

## Details

### IANJUTA_EDITOR_ASSIST_ERROR

    #define IANJUTA_EDITOR_ASSIST_ERROR ianjuta_editor_assist_error_quark()

### IAnjutaEditorAssist

    typedef struct _IAnjutaEditorAssist IAnjutaEditorAssist;

### IAnjutaEditorAssistIface

    typedef struct {
    	IAnjutaEditorIface g_iface;

    	/* Signal */
    	void (*assist_chosen) (IAnjutaEditorAssist *obj, gint selection);

    	void (*cancel_tips) (IAnjutaEditorAssist *obj, GError **err);
    	GList* (*get_suggestions) (IAnjutaEditorAssist *obj, const gchar *context, GError **err);
    	void (*hide_suggestions) (IAnjutaEditorAssist *obj, GError **err);
    	void (*show_tips) (IAnjutaEditorAssist *obj, GList* tips,  IAnjutaIterable *position,  gint char_alignment, GError **err);
    	void (*suggest) (IAnjutaEditorAssist *obj, GList* choices,  IAnjutaIterable *position,  int char_alignment, GError **err);
    	gboolean (*tip_shown) (IAnjutaEditorAssist *obj, GError **err);
    } IAnjutaEditorAssistIface;

### ianjuta_editor_assist_error_quark ()

    GQuark              ianjuta_editor_assist_error_quark   (void);

Returns : |

### ianjuta_editor_assist_cancel_tips ()

    void                ianjuta_editor_assist_cancel_tips   (IAnjutaEditorAssist *obj,
                                                             GError **err);

`obj` : |
`err` : |

### ianjuta_editor_assist_get_suggestions ()

    GList*              ianjuta_editor_assist_get_suggestions
                                                            (IAnjutaEditorAssist *obj,
                                                             const gchar *context,
                                                             GError **err);

Usually the editor might have some suggestions to make for a context. For example in a simple word completion context. The list of suggestion returned is allocated dynamically. The whole list, including the the strings should be freed when done. If the editor has no suggestions to make, it returns NULL.

`obj` : | Self
`context` : | The context for the suggestions.
`err` : | Error propagation and reporting
Returns : | A list of dynamically allocated strings for the given context or NULL if there is nothing to suggest.

### ianjuta_editor_assist_hide_suggestions ()

    void                ianjuta_editor_assist_hide_suggestions
                                                            (IAnjutaEditorAssist *obj,
                                                             GError **err);

Hide current suggestions but do not emit assist_end signal. This is useful when temporary waiting for more context

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_editor_assist_show_tips ()

    void                ianjuta_editor_assist_show_tips     (IAnjutaEditorAssist *obj,
                                                             GList *tips,
                                                             IAnjutaIterable *position,
                                                             gint char_alignment,
                                                             GError **err);

`obj` : |
`tips` : |
`position` : |
`char_alignment` : |
`err` : |

### ianjuta_editor_assist_suggest ()

    void                ianjuta_editor_assist_suggest       (IAnjutaEditorAssist *obj,
                                                             GList *choices,
                                                             IAnjutaIterable *position,
                                                             int char_alignment,
                                                             GError **err);

Suggest a list of choices to the user. The suggestions are viewed at char_alignment which should be the beginning of the completed word. If choices is NULL, and assist_end signal will occur

`obj` : | Self
`choices` : | list of choices.
`position` : |
`char_alignment` : | Character alignment.
`err` : | Error propagation and reporting

## Signal Details

### The `"assist-chosen"` signal

    void                user_function                      (IAnjutaEditorAssist *ianjutaeditorassist,
                                                            gint                 arg1,
                                                            gpointer             user_data)                : Run Last

`ianjutaeditorassist` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.