| MATE Dictionary Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
GtkWidget * gdict_strategy_chooser_new (void); GtkWidget * gdict_strategy_chooser_new_with_context (GdictContext *context); GdictContext * gdict_strategy_chooser_get_context (GdictStrategyChooser *chooser); void gdict_strategy_chooser_set_context (GdictStrategyChooser *chooser,GdictContext *context); gboolean gdict_strategy_chooser_select_strategy (GdictStrategyChooser *chooser,const gchar *strat_name); gboolean gdict_strategy_chooser_unselect_strategy (GdictStrategyChooser *chooser,const gchar *strat_name); gboolean gdict_strategy_chooser_set_current_strategy (GdictStrategyChooser *chooser,const gchar *strat_name); gchar * gdict_strategy_chooser_get_current_strategy (GdictStrategyChooser *chooser); gchar ** gdict_strategy_chooser_get_strategies (GdictStrategyChooser *chooser,gsize *length); gint gdict_strategy_chooser_count_strategies (GdictStrategyChooser *chooser); gboolean gdict_strategy_chooser_has_strategy (GdictStrategyChooser *chooser,const gchar *strategy); void gdict_strategy_chooser_refresh (GdictStrategyChooser *chooser); void gdict_strategy_chooser_clear (GdictStrategyChooser *chooser); GtkWidget * gdict_strategy_chooser_add_button (GdictStrategyChooser *chooser,const gchar *button_text);
Each GdictContext allows matching a word using a specific "matching strategy". The GdictStrategyChooser widget queries a GdictContext and displays the list of available matching strategies.
GtkWidget * gdict_strategy_chooser_new (void);
Creates a new GdictStrategyChooser. Use this widget to show a list
of matching strategies available on a dictionary source represented
by a GdictContext, set with gdict_strategy_chooser_set_context().
Returns : |
the newly created GdictStrategyChooser widget |
Since 0.9
GtkWidget * gdict_strategy_chooser_new_with_context
(GdictContext *context);
Creates a new GdictStrategyChooser widget, using context as the
representation of a dictionary source.
|
a GdictContext |
Returns : |
the newly created GdictStrategyChooser widget |
Since 0.9
GdictContext * gdict_strategy_chooser_get_context (GdictStrategyChooser *chooser);
Retrieves the GdictContext used by chooser.
|
a GdictStrategyChooser |
Returns : |
a GdictContext |
Since
void gdict_strategy_chooser_set_context (GdictStrategyChooser *chooser,GdictContext *context);
Sets the GdictContext to be used by chooser to retrieve the
list of matching strategies.
|
a GdictStrategyChooser |
|
a GdictContext, or NULL to unset the context |
Since 0.9
gboolean gdict_strategy_chooser_select_strategy (GdictStrategyChooser *chooser,const gchar *strat_name);
Selects strat_name, if available.
|
a GdictStrategyChooser |
|
the name of the strategy to select |
Returns : |
TRUE if the matching strategy was found and selected |
Since 0.10
gboolean gdict_strategy_chooser_unselect_strategy (GdictStrategyChooser *chooser,const gchar *strat_name);
Unselects strat_name from the list.
|
a GdictStrategyChooser |
|
the name of the strategy to unselect |
Returns : |
TRUE if the matching strategy was found and successfully
unselected |
Since 0.10
gboolean gdict_strategy_chooser_set_current_strategy (GdictStrategyChooser *chooser,const gchar *strat_name);
Sets strat_name as the current matching strategy.
|
a GdictStrategyChooser |
|
the name of the matching strategy |
Returns : |
TRUE if the matching strategy was found |
Since 0.10
gchar * gdict_strategy_chooser_get_current_strategy
(GdictStrategyChooser *chooser);
Retrieves the current matching strategy.
|
a GdictStrategyChooser |
Returns : |
a newly allocated string containing the name of the current matching strategy |
Since 0.10
gchar ** gdict_strategy_chooser_get_strategies (GdictStrategyChooser *chooser,gsize *length);
Retrieves the list of matching strategies available.
|
a GdictStrategyChooser |
|
return location for the length of the returned string list |
Returns : |
a string vector containing the names of the matching
strategies. Use g_strfreev() to deallocate the memory when done |
Since 0.9
gint gdict_strategy_chooser_count_strategies
(GdictStrategyChooser *chooser);
Returns the number of strategies found.
|
a GdictStrategyChooser |
Returns : |
the number of strategies or -1 if case of error |
Since
gboolean gdict_strategy_chooser_has_strategy (GdictStrategyChooser *chooser,const gchar *strategy);
Checks whether strategy is available in the list of matching
strategies displayed by chooser.
|
a GdictStrategyChooser |
|
a strategy name |
Returns : |
TRUE if the strategy was found, FALSE otherwise |
Since 0.9
void gdict_strategy_chooser_refresh (GdictStrategyChooser *chooser);
Reloads the list of available strategies.
|
a GdictStrategyChooser |
Since 0.10
void gdict_strategy_chooser_clear (GdictStrategyChooser *chooser);
Clears chooser.
|
a GdictStrategyChooser |
Since 0.10
GtkWidget * gdict_strategy_chooser_add_button (GdictStrategyChooser *chooser,const gchar *button_text);
Creates a new button and packs it into the GdictStrategyChooser "action area".
|
a GdictStrategyChooser |
|
text of the button (can be a stock id) |
Returns : |
the packed GtkButton |
Since 0.10