1 | /* gtkentryprivate.h |
2 | * Copyright (C) 2003 Kristian Rietveld <kris@gtk.org> |
3 | * |
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. |
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 | * Library General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Library General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | #ifndef __GTK_ENTRY_PRIVATE_H__ |
19 | #define __GTK_ENTRY_PRIVATE_H__ |
20 | |
21 | #include "gtkentry.h" |
22 | |
23 | #include "gtkentrycompletion.h" |
24 | #include "gtkeventcontrollermotion.h" |
25 | #include "gtkliststore.h" |
26 | #include "gtktreemodelfilter.h" |
27 | #include "gtktreeviewcolumn.h" |
28 | #include "gtkeventcontrollerkey.h" |
29 | #include "gtktextprivate.h" |
30 | |
31 | G_BEGIN_DECLS |
32 | |
33 | typedef struct _GtkEntryCompletionClass GtkEntryCompletionClass; |
34 | |
35 | struct _GtkEntryCompletion |
36 | { |
37 | GObject parent_instance; |
38 | |
39 | GtkWidget *entry; |
40 | |
41 | GtkWidget *tree_view; |
42 | GtkTreeViewColumn *column; |
43 | GtkTreeModelFilter *filter_model; |
44 | GtkCellArea *cell_area; |
45 | |
46 | GtkEntryCompletionMatchFunc match_func; |
47 | gpointer match_data; |
48 | GDestroyNotify match_notify; |
49 | |
50 | int minimum_key_length; |
51 | int text_column; |
52 | |
53 | char *case_normalized_key; |
54 | |
55 | GtkEventController *entry_key_controller; |
56 | GtkEventController *entry_focus_controller; |
57 | |
58 | /* only used by GtkEntry when attached: */ |
59 | GtkWidget *; |
60 | GtkWidget *scrolled_window; |
61 | |
62 | gulong completion_timeout; |
63 | gulong changed_id; |
64 | gulong insert_text_id; |
65 | |
66 | int current_selected; |
67 | |
68 | guint first_sel_changed : 1; |
69 | guint has_completion : 1; |
70 | guint inline_completion : 1; |
71 | guint : 1; |
72 | guint : 1; |
73 | guint : 1; |
74 | guint inline_selection : 1; |
75 | guint has_grab : 1; |
76 | |
77 | char *completion_prefix; |
78 | |
79 | GSource *check_completion_idle; |
80 | }; |
81 | |
82 | struct _GtkEntryCompletionClass |
83 | { |
84 | GObjectClass parent_class; |
85 | |
86 | gboolean (* match_selected) (GtkEntryCompletion *completion, |
87 | GtkTreeModel *model, |
88 | GtkTreeIter *iter); |
89 | void (* action_activated) (GtkEntryCompletion *completion, |
90 | int index_); |
91 | gboolean (* insert_prefix) (GtkEntryCompletion *completion, |
92 | const char *prefix); |
93 | gboolean (* cursor_on_match) (GtkEntryCompletion *completion, |
94 | GtkTreeModel *model, |
95 | GtkTreeIter *iter); |
96 | void (* no_matches) (GtkEntryCompletion *completion); |
97 | }; |
98 | |
99 | void (GtkEntryCompletion *completion); |
100 | void _gtk_entry_completion_popdown (GtkEntryCompletion *completion); |
101 | void _gtk_entry_completion_connect (GtkEntryCompletion *completion, |
102 | GtkEntry *entry); |
103 | void _gtk_entry_completion_disconnect (GtkEntryCompletion *completion); |
104 | |
105 | GtkEventController * gtk_entry_get_key_controller (GtkEntry *entry); |
106 | GtkText *gtk_entry_get_text_widget (GtkEntry *entry); |
107 | |
108 | gboolean gtk_entry_activate_icon (GtkEntry *entry, |
109 | GtkEntryIconPosition pos); |
110 | |
111 | G_END_DECLS |
112 | |
113 | #endif /* __GTK_ENTRY_PRIVATE_H__ */ |
114 | |