GdictSourceLoader

## GdictSourceLoader GdictSourceLoader — Loader object for a set of dictionary sources |

## Functions

GdictSourceLoader * | gdict_source_loader_new ()
void | gdict_source_loader_update ()
void | gdict_source_loader_add_search_path ()
const GSList * | gdict_source_loader_get_paths ()
gchar ** | gdict_source_loader_get_names ()
const GSList * | gdict_source_loader_get_sources ()
GdictSource * | gdict_source_loader_get_source ()
gboolean | gdict_source_loader_remove_source ()
gboolean | gdict_source_loader_has_source ()

## Properties

gpointer | paths | Read
gpointer | sources | Read

## Signals

void | source-loaded | Run Last

## Types and Values

struct | GdictSourceLoader
struct | GdictSourceLoaderClass

## Object Hierarchy

        GObject
        ╰── GdictSourceLoader

## Description

GdictSourceLoader allows searching for dictionary source definition files inside a set of paths and return a GdictSource using its name.

## Functions

### gdict_source_loader_new ()

    GdictSourceLoader *
    gdict_source_loader_new (void);

Creates a new GdictSourceLoader object. This object is used to search into a list of paths for dictionary source files. See GdictSource for more informations about the format of dictionary source files.

#### Returns

a new GdictSourceLoader object

Since: 1.0

### gdict_source_loader_update ()

    void
    gdict_source_loader_update (GdictSourceLoader *loader);

Queue an update of the sources inside `loader` .

#### Parameters

loader | a GdictSourceLoader |

Since: 1.0

### gdict_source_loader_add_search_path ()

    void
    gdict_source_loader_add_search_path (GdictSourceLoader *loader,
                                         const gchar *path);

Adds `path` to the search paths list of `loader` .

#### Parameters

loader | a GdictSourceLoader |
path | a path to be added to the search path list |

Since: 1.0

### gdict_source_loader_get_paths ()

    const GSList *
    gdict_source_loader_get_paths (GdictSourceLoader *loader);

Gets the list of paths used by `loader` to search for dictionary source files.

#### Parameters

loader | a GdictSourceLoader |

#### Returns

a list containing the paths. The returned list is owned by the GdictSourceLoader object and should never be free or modified.

[transfer none][element-type utf8]

Since: 1.0

### gdict_source_loader_get_names ()

    gchar **
    gdict_source_loader_get_names (GdictSourceLoader *loader,
                                   gsize *length);

Retrieves the list of dictionary source names available into the search paths of `loader` .

#### Parameters

loader | a GdictSourceLoader |
length | return location for the number of source names, or `NULL`. | [out][optional]

#### Returns

a newly allocated, `NULL` terminated array of strings. You should free the returned string array with `g_strfreev()`.

[transfer full]

Since: 1.0

### gdict_source_loader_get_sources ()

    const GSList *
    gdict_source_loader_get_sources (GdictSourceLoader *loader);

Retrieves the list of dictionary sources available into the search paths of `loader` , in form of GdictSource objects.

#### Parameters

loader | a GdictSourceLoader |

#### Returns

a list of GdictSource objects. The returned list is owned by the GdictSourceLoader object, and should never be freed or modified.

[transfer none][element-type Gdict.Source]

Since: 1.0

### gdict_source_loader_get_source ()

    GdictSource *
    gdict_source_loader_get_source (GdictSourceLoader *loader,
                                    const gchar *name);

Retrieves a dictionary source using `name` . You can use the returned GdictSource object to create the right GdictContext for that dictionary source.

#### Parameters

loader | a GdictSourceLoader |
name | a name of a dictionary source |

#### Returns

a referenced GdictSource object.

[transfer full]

Since: 1.0

### gdict_source_loader_remove_source ()

    gboolean
    gdict_source_loader_remove_source (GdictSourceLoader *loader,
                                       const gchar *name);

Removes the dictionary source `name` from `loader` . This function will also remove the dictionary source definition file bound to it.

#### Parameters

loader | a GdictSourceLoader |
name | name of a dictionary source |

#### Returns

`TRUE` if the dictionary source was successfully removed

Since: 1.0

### gdict_source_loader_has_source ()

    gboolean
    gdict_source_loader_has_source (GdictSourceLoader *loader,
                                    const gchar *source_name);

Checks whether `loader` has a dictionary source with name `source_name` .

#### Parameters

loader | a GdictSourceLoader |
source_name | the name of a dictionary source |

#### Returns

`TRUE` if the dictionary source is known

Since: 0.12

## Types and Values

### struct GdictSourceLoader

    struct GdictSourceLoader;

### struct GdictSourceLoaderClass

    struct GdictSourceLoaderClass {
      GObjectClass parent_class;

      void (*source_loaded) (GdictSourceLoader *loader,
      			 GdictSource       *source);

      /* padding for future expansion */
      void (*_gdict_source_1) (void);
      void (*_gdict_source_2) (void);
      void (*_gdict_source_3) (void);
      void (*_gdict_source_4) (void);
    };

## Property Details

### The `“paths”` property

      “paths”                    gpointer

The search paths used by this object

Flags: Read

Since: 1.0

### The `“sources”` property

      “sources”                  gpointer

The GdictSource objects found by this object

Flags: Read

Since: 1.0

## Signal Details

### The `“source-loaded”` signal

    void
    user_function (GdictSourceLoader *loader,
                   GdictSource       *source,
                   gpointer           user_data)

This signal is emitted when a new dictionary source has been added to the list.

#### Parameters

loader | the object which received the signal |
source | the new GdictSource object found |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 1.0