GdictContext

GdictContext —

Synopsis


#include <gdict-context.h>


            GdictContext;
enum        GdictContextError;

gboolean    gdict_context_get_local_only    (GdictContext *context);
void        gdict_context_set_local_only    (GdictContext *context,
                                             gboolean local_only);
gboolean    gdict_context_lookup_databases  (GdictContext *context,
                                             GError **error);
gboolean    gdict_context_lookup_strategies (GdictContext *context,
                                             GError **error);
gboolean    gdict_context_define_word       (GdictContext *context,
                                             const gchar *database,
                                             const gchar *word,
                                             GError **error);
gboolean    gdict_context_match_word        (GdictContext *context,
                                             const gchar *database,
                                             const gchar *strategy,
                                             const gchar *word,
                                             GError **error);

            GdictDatabase;
GdictDatabase* gdict_database_ref           (GdictDatabase *db);
void        gdict_database_unref            (GdictDatabase *db);
const gchar* gdict_database_get_name        (GdictDatabase *db);
const gchar* gdict_database_get_full_name   (GdictDatabase *db);

            GdictStrategy;
GdictStrategy* gdict_strategy_ref           (GdictStrategy *strat);
void        gdict_strategy_unref            (GdictStrategy *strat);
const gchar* gdict_strategy_get_name        (GdictStrategy *strat);
const gchar* gdict_strategy_get_description (GdictStrategy *strat);

            GdictMatch;
GdictMatch* gdict_match_ref                 (GdictMatch *match);
void        gdict_match_unref               (GdictMatch *match);
const gchar* gdict_match_get_word           (GdictMatch *match);
const gchar* gdict_match_get_database       (GdictMatch *match);

            GdictDefinition;
GdictDefinition* gdict_definition_ref       (GdictDefinition *def);
void        gdict_definition_unref          (GdictDefinition *def);
gint        gdict_definition_get_total      (GdictDefinition *def);
const gchar* gdict_definition_get_word      (GdictDefinition *def);
const gchar* gdict_definition_get_database  (GdictDefinition *def);
const gchar* gdict_definition_get_text      (GdictDefinition *def);


Description

Details

GdictContext

typedef struct _GdictContext GdictContext;


enum GdictContextError

typedef enum {
  GDICT_CONTEXT_ERROR_PARSE,
  GDICT_CONTEXT_ERROR_NOT_IMPLEMENTED,
  GDICT_CONTEXT_ERROR_INVALID_DATABASE,
  GDICT_CONTEXT_ERROR_INVALID_STRATEGY,
  GDICT_CONTEXT_ERROR_INVALID_COMMAND,
  GDICT_CONTEXT_ERROR_NO_MATCH,
  GDICT_CONTEXT_ERROR_NO_DATABASES,
  GDICT_CONTEXT_ERROR_NO_STRATEGIES
} GdictContextError;


gdict_context_get_local_only ()

gboolean    gdict_context_get_local_only    (GdictContext *context);

Gets whether only local resources will be used when querying.

context : a GdictContext
Returns : TRUE if only local resources will be used.

Since 1.0


gdict_context_set_local_only ()

void        gdict_context_set_local_only    (GdictContext *context,
                                             gboolean local_only);

Sets whether only local resources will be used when querying for databases, strategies, matches or definitions.

context : a GdictContext
local_only : TRUE if only local resources will be used

Since 1.0


gdict_context_lookup_databases ()

gboolean    gdict_context_lookup_databases  (GdictContext *context,
                                             GError **error);

Query context for the list of databases available. Each time a new database is found, the "database-found" signal is fired.

context : a GdictContext
error : return location for a GError, or NULL
Returns : TRUE if the query was successfully started.

Since 1.0


gdict_context_lookup_strategies ()

gboolean    gdict_context_lookup_strategies (GdictContext *context,
                                             GError **error);

Query context for the list of matching strategies available. Each time a new strategy is found, the "strategy-found" signal is fired.

context : a GdictContext
error : return location for a GError, or NULL
Returns : TRUE if the query was successfully started.

Since 1.0


gdict_context_define_word ()

gboolean    gdict_context_define_word       (GdictContext *context,
                                             const gchar *database,
                                             const gchar *word,
                                             GError **error);

Query context for a list of definitions of word inside database. Each time a new definition is found, the "definition-found" signal is fired.

context : a GdictContext
database : a database name to search into, or NULL for the default database
word : the word to search
error : return location for a GError, or NULL
Returns : TRUE if the query was successfully sent.

Since 1.0


gdict_context_match_word ()

gboolean    gdict_context_match_word        (GdictContext *context,
                                             const gchar *database,
                                             const gchar *strategy,
                                             const gchar *word,
                                             GError **error);

Query context for a list of word matching word inside database, using strategy as a matching strategy. Each time a matching word is found, the "match-found" signal is fired.

context : a GdictContext
database : a database name to search into, or NULL for the default database
strategy : a strategy name to use for matching, or NULL for the default strategy
word : the word to match
error : return location for a GError, or NULL
Returns : TRUE if the query was successfully started.

Since 1.0


GdictDatabase

typedef struct _GdictDatabase GdictDatabase;


gdict_database_ref ()

GdictDatabase* gdict_database_ref           (GdictDatabase *db);

Increases the reference count of db by one.

db : a GdictDatabase
Returns : db with its reference count increased

Since 1.0


gdict_database_unref ()

void        gdict_database_unref            (GdictDatabase *db);

Decreases the reference count of db by one. If the reference count reaches zero, db is destroyed.

db : a GdictDatabase

Since 1.0


gdict_database_get_name ()

const gchar* gdict_database_get_name        (GdictDatabase *db);

Gets the short name of the database, to be used with functions like gdict_context_match_word() or gdict_context_define_word().

db : a GdictDatabase
Returns : the short name of the database. The string is owned by the GdictDatabase object, and should never be modified or freed.

Since 1.0


gdict_database_get_full_name ()

const gchar* gdict_database_get_full_name   (GdictDatabase *db);

Gets the full name of the database, suitable for display.

db : a GdictDatabase
Returns : the full name of the database. The string is owned by the GdictDatabase object, and should never be modified or freed.

Since 1.0


GdictStrategy

typedef struct _GdictStrategy GdictStrategy;


gdict_strategy_ref ()

GdictStrategy* gdict_strategy_ref           (GdictStrategy *strat);

Increases the reference count of strat by one.

strat : a GdictStrategy
Returns : the GdictStrategy object with its reference count increased

Since 1.0


gdict_strategy_unref ()

void        gdict_strategy_unref            (GdictStrategy *strat);

Decreases the reference count of strat by one. If the reference count reaches zero, the GdictStrategy object is freed.

strat : a GdictStrategy

Since 1.0


gdict_strategy_get_name ()

const gchar* gdict_strategy_get_name        (GdictStrategy *strat);

strat :
Returns :

gdict_strategy_get_description ()

const gchar* gdict_strategy_get_description (GdictStrategy *strat);

strat :
Returns :

GdictMatch

typedef struct _GdictMatch GdictMatch;


gdict_match_ref ()

GdictMatch* gdict_match_ref                 (GdictMatch *match);

match :
Returns :

gdict_match_unref ()

void        gdict_match_unref               (GdictMatch *match);

match :

gdict_match_get_word ()

const gchar* gdict_match_get_word           (GdictMatch *match);

match :
Returns :

gdict_match_get_database ()

const gchar* gdict_match_get_database       (GdictMatch *match);

match :
Returns :

GdictDefinition

typedef struct _GdictDefinition GdictDefinition;


gdict_definition_ref ()

GdictDefinition* gdict_definition_ref       (GdictDefinition *def);

Increases the reference count of def by one.

def : a GdictDefinition
Returns : the GdictDefinition object with its reference count increased.

Since 1.0


gdict_definition_unref ()

void        gdict_definition_unref          (GdictDefinition *def);

Decreases the reference count of def by one. If the reference count reaches zero, the GdictDefinition object is freed.

def : a GdictDefinition

Since 1.0


gdict_definition_get_total ()

gint        gdict_definition_get_total      (GdictDefinition *def);

Retrieves the total number of definitions that were found on a dictionary.

def : a GdictDefinition
Returns : the number of definitions.

Since 1.0


gdict_definition_get_word ()

const gchar* gdict_definition_get_word      (GdictDefinition *def);

Retrieves the word used by the dictionary database to store the definition.

def : a GdictDefinition
Returns : a word. The returned string is owned by the GdictDefinition object and should not be modified or freed.

Since 1.0


gdict_definition_get_database ()

const gchar* gdict_definition_get_database  (GdictDefinition *def);

Retrieves the full name of the dictionary database where the definition is stored.

def : a GdictDefinition
Returns : the full name of a database. The returned string is owned by the GdictDefinition object and should not be modified or freed.

Since 1.0


gdict_definition_get_text ()

const gchar* gdict_definition_get_text      (GdictDefinition *def);

Retrieves the text of the definition.

def : a GdictDefinition
Returns : the text of the definition. The returned string is owned by the GdictDefinition object, and should not be modified or freed.

Since 1.0