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 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtk.h> can be included directly."
24 #ifndef __GTK_ENTRY_COMPLETION_H__
25 #define __GTK_ENTRY_COMPLETION_H__
27 #include <glib-object.h>
29 #include <gtk/gtktreemodel.h>
30 #include <gtk/gtkliststore.h>
31 #include <gtk/gtktreeviewcolumn.h>
32 #include <gtk/gtktreemodelfilter.h>
36 #define GTK_TYPE_ENTRY_COMPLETION (gtk_entry_completion_get_type ())
37 #define GTK_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletion))
38 #define GTK_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
39 #define GTK_IS_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_COMPLETION))
40 #define GTK_IS_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_COMPLETION))
41 #define GTK_ENTRY_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
43 typedef struct _GtkEntryCompletion GtkEntryCompletion;
44 typedef struct _GtkEntryCompletionClass GtkEntryCompletionClass;
45 typedef struct _GtkEntryCompletionPrivate GtkEntryCompletionPrivate;
47 typedef gboolean (* GtkEntryCompletionMatchFunc) (GtkEntryCompletion *completion,
53 struct _GtkEntryCompletion
55 GObject parent_instance;
58 GtkEntryCompletionPrivate *priv;
61 struct _GtkEntryCompletionClass
63 GObjectClass parent_class;
65 gboolean (* match_selected) (GtkEntryCompletion *completion,
68 void (* action_activated) (GtkEntryCompletion *completion,
70 gboolean (* insert_prefix) (GtkEntryCompletion *completion,
72 gboolean (* cursor_on_match) (GtkEntryCompletion *completion,
76 /* Padding for future expansion */
77 void (*_gtk_reserved0) (void);
78 void (*_gtk_reserved1) (void);
82 GType gtk_entry_completion_get_type (void) G_GNUC_CONST;
83 GtkEntryCompletion *gtk_entry_completion_new (void);
85 GtkWidget *gtk_entry_completion_get_entry (GtkEntryCompletion *completion);
87 void gtk_entry_completion_set_model (GtkEntryCompletion *completion,
89 GtkTreeModel *gtk_entry_completion_get_model (GtkEntryCompletion *completion);
91 void gtk_entry_completion_set_match_func (GtkEntryCompletion *completion,
92 GtkEntryCompletionMatchFunc func,
94 GDestroyNotify func_notify);
95 void gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
97 gint gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion *completion);
98 void gtk_entry_completion_complete (GtkEntryCompletion *completion);
99 void gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion);
101 void gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion,
104 void gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion,
106 const gchar *markup);
107 void gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
110 void gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion,
111 gboolean inline_completion);
112 gboolean gtk_entry_completion_get_inline_completion (GtkEntryCompletion *completion);
113 void gtk_entry_completion_set_inline_selection (GtkEntryCompletion *completion,
114 gboolean inline_selection);
115 gboolean gtk_entry_completion_get_inline_selection (GtkEntryCompletion *completion);
116 void gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
117 gboolean popup_completion);
118 gboolean gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion);
119 void gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
120 gboolean popup_set_width);
121 gboolean gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion);
122 void gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion,
123 gboolean popup_single_match);
124 gboolean gtk_entry_completion_get_popup_single_match (GtkEntryCompletion *completion);
126 const gchar *gtk_entry_completion_get_completion_prefix (GtkEntryCompletion *completion);
128 void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
130 gint gtk_entry_completion_get_text_column (GtkEntryCompletion *completion);
134 #endif /* __GTK_ENTRY_COMPLETION_H__ */