1 /*
2  * Copyright (C) 2009 - 2011 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_FORMATTED_ENTRY_H__
21 #define __GDAUI_FORMATTED_ENTRY_H__
22 
23 #include "gdaui-entry.h"
24 
25 G_BEGIN_DECLS
26 
27 #define GDAUI_TYPE_FORMATTED_ENTRY                 (gdaui_formatted_entry_get_type ())
28 #define GDAUI_FORMATTED_ENTRY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDAUI_TYPE_FORMATTED_ENTRY, GdauiFormattedEntry))
29 #define GDAUI_FORMATTED_ENTRY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GDAUI_TYPE_FORMATTED_ENTRY, GdauiFormattedEntry))
30 #define GDAUI_IS_FORMATTED_ENTRY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDAUI_TYPE_FORMATTED_ENTRY))
31 #define GDAUI_IS_FORMATTED_ENTRY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GDAUI_TYPE_FORMATTED_ENTRY))
32 #define GDAUI_FORMATTED_ENTRY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GDAUI_TYPE_FORMATTED_ENTRY, GdauiFormattedEntry))
33 
34 
35 typedef struct _GdauiFormattedEntry        GdauiFormattedEntry;
36 typedef struct _GdauiFormattedEntryClass   GdauiFormattedEntryClass;
37 typedef struct _GdauiFormattedEntryPrivate GdauiFormattedEntryPrivate;
38 
39 struct _GdauiFormattedEntry
40 {
41 	GdauiEntry                  entry;
42 	GdauiFormattedEntryPrivate *priv;
43 };
44 
45 struct _GdauiFormattedEntryClass
46 {
47 	GdauiEntryClass             parent_class;
48 };
49 
50 GType                 gdaui_formatted_entry_get_type           (void) G_GNUC_CONST;
51 GtkWidget            *gdaui_formatted_entry_new                (const gchar *format, const gchar *mask);
52 gchar                *gdaui_formatted_entry_get_text           (GdauiFormattedEntry *entry);
53 
54 typedef void (*GdauiFormattedEntryInsertFunc) (GdauiFormattedEntry *entry, gunichar insert_char,
55 					       gint virt_pos, gpointer data);
56 void                  gdaui_formatted_entry_set_insert_func    (GdauiFormattedEntry *entry,
57 								GdauiFormattedEntryInsertFunc insert_func,
58 								gpointer data);
59 
60 G_END_DECLS
61 
62 #endif
63