1 /* gdict-strategy-chooser.h - display widget for strategy names 2 * 3 * Copyright (C) 2006 Emmanuele Bassi <ebassi@gmail.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with this library. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef __GDICT_STRATEGY_CHOOSER_H__ 20 #define __GDICT_STRATEGY_CHOOSER_H__ 21 22 #include <gtk/gtk.h> 23 #include "gdict-context.h" 24 25 G_BEGIN_DECLS 26 27 #define GDICT_TYPE_STRATEGY_CHOOSER (gdict_strategy_chooser_get_type ()) 28 #define GDICT_STRATEGY_CHOOSER(obj) \ 29 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooser)) 30 #define GDICT_IS_STRATEGY_CHOOSER(obj) \ 31 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_STRATEGY_CHOOSER)) 32 #define GDICT_STRATEGY_CHOOSER_CLASS(klass) \ 33 (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserClass)) 34 #define GDICT_IS_STRATEGY_CHOOSER_CLASS(klass) \ 35 (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_STRATEGY_CHOOSER)) 36 #define GDICT_STRATEGY_CHOOSER_GET_CLASS(obj) \ 37 (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserClass)) 38 39 typedef struct _GdictStrategyChooser GdictStrategyChooser; 40 typedef struct _GdictStrategyChooserPrivate GdictStrategyChooserPrivate; 41 typedef struct _GdictStrategyChooserClass GdictStrategyChooserClass; 42 43 struct _GdictStrategyChooser 44 { 45 GtkBox parent_instance; 46 47 GdictStrategyChooserPrivate *priv; 48 }; 49 50 struct _GdictStrategyChooserClass 51 { 52 GtkBoxClass parent_class; 53 54 void (*strategy_activated) (GdictStrategyChooser *chooser, 55 const gchar *name, 56 const gchar *description); 57 58 void (*_gdict_padding1) (void); 59 void (*_gdict_padding2) (void); 60 void (*_gdict_padding3) (void); 61 void (*_gdict_padding4) (void); 62 void (*_gdict_padding5) (void); 63 void (*_gdict_padding6) (void); 64 }; 65 66 GType gdict_strategy_chooser_get_type (void) G_GNUC_CONST; 67 68 GtkWidget * gdict_strategy_chooser_new (void); 69 GtkWidget * gdict_strategy_chooser_new_with_context (GdictContext *context); 70 71 GdictContext *gdict_strategy_chooser_get_context (GdictStrategyChooser *chooser); 72 void gdict_strategy_chooser_set_context (GdictStrategyChooser *chooser, 73 GdictContext *context); 74 gboolean gdict_strategy_chooser_select_strategy (GdictStrategyChooser *chooser, 75 const gchar *strat_name); 76 gboolean gdict_strategy_chooser_unselect_strategy (GdictStrategyChooser *chooser, 77 const gchar *strat_name); 78 gboolean gdict_strategy_chooser_set_current_strategy (GdictStrategyChooser *chooser, 79 const gchar *strat_name); 80 gchar * gdict_strategy_chooser_get_current_strategy (GdictStrategyChooser *chooser) G_GNUC_MALLOC; 81 gchar ** gdict_strategy_chooser_get_strategies (GdictStrategyChooser *chooser, 82 gsize *length) G_GNUC_MALLOC; 83 gint gdict_strategy_chooser_count_strategies (GdictStrategyChooser *chooser); 84 gboolean gdict_strategy_chooser_has_strategy (GdictStrategyChooser *chooser, 85 const gchar *strategy); 86 void gdict_strategy_chooser_refresh (GdictStrategyChooser *chooser); 87 void gdict_strategy_chooser_clear (GdictStrategyChooser *chooser); 88 GtkWidget * gdict_strategy_chooser_add_button (GdictStrategyChooser *chooser, 89 const gchar *button_text); 90 91 G_END_DECLS 92 93 #endif /* __GDICT_STRATEGY_CHOOSER_H__ */ 94