## IAnjutaLanguage

IAnjutaLanguage — Interface to manage multiple programming languages

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-language.h>

    #define             IANJUTA_LANGUAGE_ERROR
                        IAnjutaLanguage;
                        IAnjutaLanguageIface;
    typedef             IAnjutaLanguageId;
    GQuark              ianjuta_language_error_quark        (void);
    IAnjutaLanguageId   ianjuta_language_get_from_editor    (IAnjutaLanguage *obj,
                                                             IAnjutaEditorLanguage *editor,
                                                             GError **err);
    IAnjutaLanguageId   ianjuta_language_get_from_mime_type (IAnjutaLanguage *obj,
                                                             const gchar *mime_type,
                                                             GError **err);
    IAnjutaLanguageId   ianjuta_language_get_from_string    (IAnjutaLanguage *obj,
                                                             const gchar *string,
                                                             GError **err);
    GList*              ianjuta_language_get_languages      (IAnjutaLanguage *obj,
                                                             GError **err);
    const gchar*        ianjuta_language_get_make_target    (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);
    const gchar*        ianjuta_language_get_name           (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);
    const gchar*        ianjuta_language_get_name_from_editor
                                                            (IAnjutaLanguage *obj,
                                                             IAnjutaEditorLanguage *editor,
                                                             GError **err);
    GList*              ianjuta_language_get_strings        (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);

## Object Hierarchy

      GInterface
       +----IAnjutaLanguage

## Prerequisites

IAnjutaLanguage requires GObject.

## Description

## Details

### IANJUTA_LANGUAGE_ERROR

    #define IANJUTA_LANGUAGE_ERROR ianjuta_language_error_quark()

### IAnjutaLanguage

    typedef struct _IAnjutaLanguage IAnjutaLanguage;

### IAnjutaLanguageIface

    typedef struct {
    	GTypeInterface g_iface;

    	IAnjutaLanguageId (*get_from_editor) (IAnjutaLanguage *obj, IAnjutaEditorLanguage* editor, GError **err);
    	IAnjutaLanguageId (*get_from_mime_type) (IAnjutaLanguage *obj, const gchar* mime_type, GError **err);
    	IAnjutaLanguageId (*get_from_string) (IAnjutaLanguage *obj, const gchar* string, GError **err);
    	GList* (*get_languages) (IAnjutaLanguage *obj, GError **err);
    	const gchar* (*get_make_target) (IAnjutaLanguage *obj, IAnjutaLanguageId id, GError **err);
    	const gchar* (*get_name) (IAnjutaLanguage *obj, IAnjutaLanguageId id, GError **err);
    	const gchar* (*get_name_from_editor) (IAnjutaLanguage *obj, IAnjutaEditorLanguage* editor, GError **err);
    	GList* (*get_strings) (IAnjutaLanguage *obj, IAnjutaLanguageId id, GError **err);
    } IAnjutaLanguageIface;

### IAnjutaLanguageId

    typedef gint IAnjutaLanguageId;

### ianjuta_language_error_quark ()

    GQuark              ianjuta_language_error_quark        (void);

Returns : |

### ianjuta_language_get_from_editor ()

    IAnjutaLanguageId   ianjuta_language_get_from_editor    (IAnjutaLanguage *obj,
                                                             IAnjutaEditorLanguage *editor,
                                                             GError **err);

Conviniece method to get the id directly from the editor

`obj` : | Self
`editor` : | An object implementing IAnjutaEditorLanguage
`err` : | Error propagation
Returns : | A valid language id or 0

### ianjuta_language_get_from_mime_type ()

    IAnjutaLanguageId   ianjuta_language_get_from_mime_type (IAnjutaLanguage *obj,
                                                             const gchar *mime_type,
                                                             GError **err);

`obj` : |
`mime_type` : |
`err` : |
Returns : |

### ianjuta_language_get_from_string ()

    IAnjutaLanguageId   ianjuta_language_get_from_string    (IAnjutaLanguage *obj,
                                                             const gchar *string,
                                                             GError **err);

`obj` : |
`string` : |
`err` : |
Returns : |

### ianjuta_language_get_languages ()

    GList*              ianjuta_language_get_languages      (IAnjutaLanguage *obj,
                                                             GError **err);

`obj` : | Self
`err` : | Error propagation
Returns : | a list of ids of the available languages. Use `GPOINTER_TO_INT()` to receive them. The list but not the values should be free'd with `g_list_free()`. [element-type int][transfer container int]

### ianjuta_language_get_make_target ()

    const gchar*        ianjuta_language_get_make_target    (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);

`obj` : | Self
`id` : | A valid language id
`err` : |
Returns : | The suffix for the file thats needs to be passed to make to compile the file, e.g. ".o" for C

### ianjuta_language_get_name ()

    const gchar*        ianjuta_language_get_name           (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);

`obj` : | Self
`id` : | A valid language id
`err` : |
Returns : | The main name of the language. When you call `ianjuta_language_from_string()` before that method the string you get here might be different to the one you passed because the language might have multiple string representations

### ianjuta_language_get_name_from_editor ()

    const gchar*        ianjuta_language_get_name_from_editor
                                                            (IAnjutaLanguage *obj,
                                                             IAnjutaEditorLanguage *editor,
                                                             GError **err);

Conviniece method to get the name directly from the editor

`obj` : | Self
`editor` : | An object implementing IAnjutaEditorLanguage
`err` : | Error propagation
Returns : | A language name or NULL

### ianjuta_language_get_strings ()

    GList*              ianjuta_language_get_strings        (IAnjutaLanguage *obj,
                                                             IAnjutaLanguageId id,
                                                             GError **err);

`obj` : | Self
`id` : | A valid language id
`err` : |
Returns : | A list of strings that represent this language that language. [element-type utf8]