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_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 <gtk/gtktreemodel.h>
28 #include <gtk/gtkliststore.h>
29 #include <gtk/gtktreeviewcolumn.h>
30 #include <gtk/gtktreemodelfilter.h>
34 #define GTK_TYPE_ENTRY_COMPLETION (gtk_entry_completion_get_type ())
35 #define GTK_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletion))
36 #define GTK_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
37 #define GTK_IS_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_COMPLETION))
38 #define GTK_IS_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_COMPLETION))
39 #define GTK_ENTRY_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
41 typedef struct _GtkEntryCompletion GtkEntryCompletion;
42 typedef struct _GtkEntryCompletionClass GtkEntryCompletionClass;
43 typedef struct _GtkEntryCompletionPrivate GtkEntryCompletionPrivate;
45 typedef gboolean (* GtkEntryCompletionMatchFunc) (GtkEntryCompletion *completion,
51 struct _GtkEntryCompletion
53 GObject parent_instance;
56 GtkEntryCompletionPrivate *priv;
59 struct _GtkEntryCompletionClass
61 GObjectClass parent_class;
63 gboolean (* match_selected) (GtkEntryCompletion *completion,
66 void (* action_activated) (GtkEntryCompletion *completion,
68 gboolean (* insert_prefix) (GtkEntryCompletion *completion,
70 gboolean (* cursor_on_match) (GtkEntryCompletion *completion,
74 /* Padding for future expansion */
75 void (*_gtk_reserved0) (void);
76 void (*_gtk_reserved1) (void);
80 GType gtk_entry_completion_get_type (void) G_GNUC_CONST;
81 GtkEntryCompletion *gtk_entry_completion_new (void);
83 GtkWidget *gtk_entry_completion_get_entry (GtkEntryCompletion *completion);
85 void gtk_entry_completion_set_model (GtkEntryCompletion *completion,
87 GtkTreeModel *gtk_entry_completion_get_model (GtkEntryCompletion *completion);
89 void gtk_entry_completion_set_match_func (GtkEntryCompletion *completion,
90 GtkEntryCompletionMatchFunc func,
92 GDestroyNotify func_notify);
93 void gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
95 gint gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion *completion);
96 void gtk_entry_completion_complete (GtkEntryCompletion *completion);
97 void gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion);
99 void gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion,
102 void gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion,
104 const gchar *markup);
105 void gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
108 void gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion,
109 gboolean inline_completion);
110 gboolean gtk_entry_completion_get_inline_completion (GtkEntryCompletion *completion);
111 void gtk_entry_completion_set_inline_selection (GtkEntryCompletion *completion,
112 gboolean inline_selection);
113 gboolean gtk_entry_completion_get_inline_selection (GtkEntryCompletion *completion);
114 void gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
115 gboolean popup_completion);
116 gboolean gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion);
117 void gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
118 gboolean popup_set_width);
119 gboolean gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion);
120 void gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion,
121 gboolean popup_single_match);
122 gboolean gtk_entry_completion_get_popup_single_match (GtkEntryCompletion *completion);
124 const gchar *gtk_entry_completion_get_completion_prefix (GtkEntryCompletion *completion);
126 void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
128 gint gtk_entry_completion_get_text_column (GtkEntryCompletion *completion);
132 #endif /* __GTK_ENTRY_COMPLETION_H__ */