1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  * anjuta-language-provider.h
4  * Copyright (C) Naba Kumar  <naba@gnome.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 #ifndef _ANJUTA_LANGUAGE_PROVIDER_H_
21 #define _ANJUTA_LANGUAGE_PROVIDER_H_
22 
23 #include <glib.h>
24 #include <glib-object.h>
25 #include <libanjuta/interfaces/ianjuta-editor.h>
26 #include <libanjuta/interfaces/ianjuta-editor-tip.h>
27 #include <libanjuta/interfaces/ianjuta-iterable.h>
28 #include <libanjuta/interfaces/ianjuta-provider.h>
29 #include <libanjuta/interfaces/ianjuta-symbol.h>
30 
31 G_BEGIN_DECLS
32 
33 #define ANJUTA_LANGUAGE_PROPOSAL_DATA(obj)             (AnjutaLanguageProposalData*)((obj))
34 
35 typedef struct _AnjutaLanguageProposalData AnjutaLanguageProposalData;
36 
37 /**
38  * AnjutaLanguageProposalData:
39  * @name: Name of the object
40  * @info: Info about the object
41  * @is_func: If this is a function
42  * @has_para: If the function has at least one parameters
43  * @type: Type of the object
44  */
45 struct _AnjutaLanguageProposalData
46 {
47 	gchar* name;
48 	gchar* info;
49 	gboolean is_func;
50 	gboolean has_para;
51 	IAnjutaSymbolType type;
52 };
53 
54 GType anjuta_language_proposal_data_get_type (void) G_GNUC_CONST;
55 AnjutaLanguageProposalData* anjuta_language_proposal_data_new (gchar* name);
56 void anjuta_language_proposal_data_free (AnjutaLanguageProposalData *data);
57 
58 #define ANJUTA_TYPE_LANGUAGE_PROVIDER             (anjuta_language_provider_get_type ())
59 #define ANJUTA_LANGUAGE_PROVIDER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_LANGUAGE_PROVIDER, AnjutaLanguageProvider))
60 #define ANJUTA_LANGUAGE_PROVIDER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_LANGUAGE_PROVIDER, AnjutaLanguageProviderClass))
61 #define ANJUTA_IS_LANGUAGE_PROVIDER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_LANGUAGE_PROVIDER))
62 #define ANJUTA_IS_LANGUAGE_PROVIDER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_LANGUAGE_PROVIDER))
63 #define ANJUTA_LANGUAGE_PROVIDER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_LANGUAGE_PROVIDER, AnjutaLanguageProviderClass))
64 
65 typedef struct _AnjutaLanguageProviderClass AnjutaLanguageProviderClass;
66 typedef struct _AnjutaLanguageProvider AnjutaLanguageProvider;
67 typedef struct _AnjutaLanguageProviderPriv AnjutaLanguageProviderPriv;
68 
69 struct _AnjutaLanguageProviderClass
70 {
71 	GObjectClass parent_class;
72 };
73 
74 struct _AnjutaLanguageProvider
75 {
76 	GObject parent;
77 	AnjutaLanguageProviderPriv *priv;
78 };
79 
80 GType anjuta_language_provider_get_type (void) G_GNUC_CONST;
81 
82 void
83 anjuta_language_provider_install				(AnjutaLanguageProvider* lang_prov,
84                                                  IAnjutaEditor *ieditor,
85                                                  GSettings* settings);
86 
87 gchar*
88 anjuta_language_provider_get_pre_word			(AnjutaLanguageProvider* lang_prov,
89                                                  IAnjutaEditor* editor,
90                                                  IAnjutaIterable *iter,
91                                                  IAnjutaIterable** start_iter,
92                                                  const gchar *word_characters);
93 
94 gchar*
95 anjuta_language_provider_get_calltip_context	(AnjutaLanguageProvider* lang_prov,
96                                                  IAnjutaEditorTip* itip,
97                                                  IAnjutaIterable* iter,
98                                                  const gchar* scope_context_ch);
99 
100 void
101 anjuta_language_provider_activate				(AnjutaLanguageProvider* lang_prov,
102                                                  IAnjutaProvider* iprov,
103                                                  IAnjutaIterable* iter,
104                                                  gpointer data);
105 
106 void
107 anjuta_language_provider_populate				(AnjutaLanguageProvider* lang_prov,
108                                                  IAnjutaProvider* iprov,
109                                                  IAnjutaIterable* cursor);
110 void
111 anjuta_language_provider_proposals              (AnjutaLanguageProvider* lang_prov,
112                                                  IAnjutaProvider* iprov,
113                                                  GList* proposals,
114                                                  const gchar* pre_word,
115                                                  gboolean finished);
116 
117 
118 IAnjutaIterable*
119 anjuta_language_provider_get_start_iter			(AnjutaLanguageProvider* lang_prov);
120 
121 G_END_DECLS
122 
123 #endif
124