1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*-  */
2 /*
3  * anjuta-completion.h
4  * Copyright (C) 2013 Carl-Anton Ingmarsson <carlantoni@gnome.org>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * anjuta is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.";
18  */
19 
20 #ifndef _ANJUTA_COMPLETION_H_
21 #define _ANJUTA_COMPLETION_H_
22 
23 #include <glib-object.h>
24 
25 G_BEGIN_DECLS
26 
27 #define ANJUTA_TYPE_COMPLETION             (anjuta_completion_get_type ())
28 #define ANJUTA_COMPLETION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_COMPLETION, AnjutaCompletion))
29 #define ANJUTA_COMPLETION_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_COMPLETION, AnjutaCompletionClass))
30 #define ANJUTA_IS_COMPLETION(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_COMPLETION))
31 #define ANJUTA_IS_COMPLETION_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_COMPLETION))
32 #define ANJUTA_COMPLETION_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_COMPLETION, AnjutaCompletionClass))
33 
34 typedef struct _AnjutaCompletionClass AnjutaCompletionClass;
35 typedef struct _AnjutaCompletion AnjutaCompletion;
36 typedef struct _AnjutaCompletionPrivate AnjutaCompletionPrivate;
37 
38 
39 
40 struct _AnjutaCompletionClass
41 {
42     GObjectClass parent_class;
43 };
44 
45 struct _AnjutaCompletion
46 {
47     GObject parent_instance;
48 
49     AnjutaCompletionPrivate* priv;
50 };
51 
52 
53 typedef const char* (*AnjutaCompletionNameFunc) (const void* item);
54 typedef gboolean    (*AnjutaCompletionFilterFunc) (const void* item, void* user_data);
55 
56 
57 GType anjuta_completion_get_type (void) G_GNUC_CONST;
58 
59 AnjutaCompletion*
60 anjuta_completion_new (AnjutaCompletionNameFunc name_func);
61 
62 gboolean
63 anjuta_completion_get_case_sensitive (AnjutaCompletion* self);
64 
65 void
66 anjuta_completion_set_case_sensitive (AnjutaCompletion* self,
67                                       gboolean case_sensitive);
68 
69 void
70 anjuta_completion_set_item_destroy_func (AnjutaCompletion* self,
71                                          GDestroyNotify item_destroy_func);
72 
73 void
74 anjuta_completion_set_filter_func        (AnjutaCompletion* self,
75                                           AnjutaCompletionFilterFunc filter_func,
76                                           void* user_data);
77 
78 void
79 anjuta_completion_add_item (AnjutaCompletion* self,
80                             void*             item);
81 
82 void
83 anjuta_completion_clear    (AnjutaCompletion* self);
84 
85 GList*
86 anjuta_completion_complete (AnjutaCompletion* self,
87                             const char*       prefix,
88                             gint              max_completions);
89 
90 G_END_DECLS
91 
92 #endif /* _ANJUTA_COMPLETION_H_ */
93 
94