1 /* gtkentrycompletion.h
2 * Copyright (C) 2003 Kristian Rietveld <kris@gtk.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library 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.
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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GTK_ENTRY_COMPLETION_H__
21 #define __GTK_ENTRY_COMPLETION_H__
23 #include <glib-object.h>
25 #include <gtk/gtktreemodel.h>
26 #include <gtk/gtkliststore.h>
27 #include <gtk/gtktreeviewcolumn.h>
28 #include <gtk/gtktreemodelfilter.h>
32 #define GTK_TYPE_ENTRY_COMPLETION (gtk_entry_completion_get_type ())
33 #define GTK_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletion))
34 #define GTK_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
35 #define GTK_IS_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_COMPLETION))
36 #define GTK_IS_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_COMPLETION))
37 #define GTK_ENTRY_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
39 typedef struct _GtkEntryCompletion GtkEntryCompletion;
40 typedef struct _GtkEntryCompletionClass GtkEntryCompletionClass;
41 typedef struct _GtkEntryCompletionPrivate GtkEntryCompletionPrivate;
43 typedef gboolean (* GtkEntryCompletionMatchFunc) (GtkEntryCompletion *completion,
49 struct _GtkEntryCompletion
51 GObject parent_instance;
54 GtkEntryCompletionPrivate *priv;
57 struct _GtkEntryCompletionClass
59 GObjectClass parent_class;
61 gboolean (* match_selected) (GtkEntryCompletion *completion,
64 void (* action_activated) (GtkEntryCompletion *completion,
66 gboolean (* insert_prefix) (GtkEntryCompletion *completion,
69 /* Padding for future expansion */
70 void (*_gtk_reserved0) (void);
71 void (*_gtk_reserved1) (void);
72 void (*_gtk_reserved2) (void);
76 GType gtk_entry_completion_get_type (void) G_GNUC_CONST;
77 GtkEntryCompletion *gtk_entry_completion_new (void);
79 GtkWidget *gtk_entry_completion_get_entry (GtkEntryCompletion *completion);
81 void gtk_entry_completion_set_model (GtkEntryCompletion *completion,
83 GtkTreeModel *gtk_entry_completion_get_model (GtkEntryCompletion *completion);
85 void gtk_entry_completion_set_match_func (GtkEntryCompletion *completion,
86 GtkEntryCompletionMatchFunc func,
88 GDestroyNotify func_notify);
89 void gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
91 gint gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion *completion);
92 void gtk_entry_completion_complete (GtkEntryCompletion *completion);
93 void gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion);
95 void gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion,
98 void gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion,
100 const gchar *markup);
101 void gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
104 void gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion,
105 gboolean inline_completion);
106 gboolean gtk_entry_completion_get_inline_completion (GtkEntryCompletion *completion);
107 void gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
108 gboolean popup_completion);
109 gboolean gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion);
110 void gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
111 gboolean popup_set_width);
112 gboolean gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion);
113 void gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion,
114 gboolean popup_single_match);
115 gboolean gtk_entry_completion_get_popup_single_match (GtkEntryCompletion *completion);
119 void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
121 gint gtk_entry_completion_get_text_column (GtkEntryCompletion *completion);
125 #endif /* __GTK_ENTRY_COMPLETION_H__ */