1 /* 2 * Copyright (C) 2009 - 2012 Vivien Malerba <malerba@gnome-db.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef __GDAUI_ENTRY_WRAPPER__ 21 #define __GDAUI_ENTRY_WRAPPER__ 22 23 #include <gtk/gtk.h> 24 #include "gdaui-entry-shell.h" 25 #include <libgda-ui/gdaui-data-entry.h> 26 27 G_BEGIN_DECLS 28 29 #define GDAUI_TYPE_ENTRY_WRAPPER (gdaui_entry_wrapper_get_type()) 30 #define GDAUI_ENTRY_WRAPPER(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gdaui_entry_wrapper_get_type(), GdauiEntryWrapper) 31 #define GDAUI_ENTRY_WRAPPER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gdaui_entry_wrapper_get_type (), GdauiEntryWrapperClass) 32 #define GDAUI_IS_ENTRY_WRAPPER(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gdaui_entry_wrapper_get_type ()) 33 34 35 typedef struct _GdauiEntryWrapper GdauiEntryWrapper; 36 typedef struct _GdauiEntryWrapperClass GdauiEntryWrapperClass; 37 typedef struct _GdauiEntryWrapperPriv GdauiEntryWrapperPriv; 38 39 40 /* struct for the object's data */ 41 struct _GdauiEntryWrapper 42 { 43 GdauiEntryShell object; 44 45 GdauiEntryWrapperPriv *priv; 46 }; 47 48 /* struct for the object's class */ 49 struct _GdauiEntryWrapperClass 50 { 51 GdauiEntryShellClass parent_class; 52 53 /* pure virtual functions */ 54 GtkWidget *(*create_entry) (GdauiEntryWrapper *wrapper); 55 void (*real_set_value) (GdauiEntryWrapper *wrapper, const GValue *value); 56 GValue *(*real_get_value) (GdauiEntryWrapper *wrapper); 57 void (*connect_signals) (GdauiEntryWrapper *wrapper, GCallback modify_cb, GCallback activate_cb); 58 gboolean (*can_expand) (GdauiEntryWrapper *wrapper, gboolean horiz); /* not used anymore */ 59 void (*set_editable) (GdauiEntryWrapper *wrapper, gboolean editable); 60 61 gboolean (*value_is_equal_to)(GdauiEntryWrapper *wrapper, const GValue *value); 62 gboolean (*value_is_null) (GdauiEntryWrapper *wrapper); 63 gboolean (*is_valid) (GdauiEntryWrapper *wrapper); /* not used yet */ 64 void (*grab_focus) (GdauiEntryWrapper *wrapper); 65 }; 66 67 68 GType gdaui_entry_wrapper_get_type (void) G_GNUC_CONST; 69 void gdaui_entry_wrapper_contents_changed (GdauiEntryWrapper *wrapper); 70 void gdaui_entry_wrapper_contents_activated (GdauiEntryWrapper *wrapper); 71 72 G_END_DECLS 73 74 #endif 75