libyui-gtk  2.44.8
ygtkfieldentry.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* YGtkFieldEntry is an extension of GtkEntry with the added
6  functionality of being able to define fields (useful for when
7  you need the user to set a IP address or time/date). The number
8  of fields, their individual range and separation character
9  is all customizable.
10 */
11 
12 #ifndef YGTK_FIELD_ENTRY_H
13 #define YGTK_FIELD_ENTRY_H
14 
15 #include <gtk/gtk.h>
16 G_BEGIN_DECLS
17 
18 #define YGTK_TYPE_FIELD_ENTRY (ygtk_field_entry_get_type ())
19 #define YGTK_FIELD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
20  YGTK_TYPE_FIELD_ENTRY, YGtkFieldEntry))
21 #define YGTK_FIELD_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
22  YGTK_TYPE_FIELD_ENTRY, YGtkFieldEntryClass))
23 #define IS_YGTK_FIELD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
24  YGTK_TYPE_FIELD_ENTRY))
25 #define IS_YGTK_FIELD_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
26  YGTK_TYPE_FIELD_ENTRY))
27 #define YGTK_FIELD_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
28  YGTK_TYPE_FIELD_ENTRY, YGtkFieldEntryClass))
29 
30 typedef struct _YGtkFieldEntry
31 {
32  GtkHBox parent;
34 
35 typedef struct _YGtkFieldEntryClass
36 {
37  GtkHBoxClass parent_class;
38 
39  void (* filter_entry_changed) (YGtkFieldEntry *entry, gint field_nb);
41 
42 GtkWidget* ygtk_field_entry_new (void);
43 GType ygtk_field_entry_get_type (void) G_GNUC_CONST;
44 
45 // if this is the first field, separator will be ignored.
46 guint ygtk_field_entry_add_field (YGtkFieldEntry *entry, gchar separator);
47 // max_length can be 0 to disable it. valids_chars can be NULL to disable it.
48 void ygtk_field_entry_setup_field (YGtkFieldEntry *entry, guint index,
49  gint max_length, const gchar *valid_chars);
50 
51 const gchar *ygtk_field_entry_get_field_text (YGtkFieldEntry *entry, guint index);
52 void ygtk_field_entry_set_field_text (YGtkFieldEntry *entry, guint index,
53  const gchar *text);
54 
55 GtkEntry *ygtk_field_entry_get_field_widget (YGtkFieldEntry *entry, guint index);
56 gboolean ygtk_field_entry_set_focus (YGtkFieldEntry *entry);
57 
58 G_END_DECLS
59 #endif /*YGTK_FIELD_ENTRY_H*/
60