* plugins/class-gen/element-editor.c: Fixed typo.
[anjuta-git-plugin.git] / libanjuta / anjuta-plugin-manager.h
blobf4f5626867e731aab1e84fc21fe3f5fd6fda1d91
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-plugin-manager.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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _ANJUTA_PLUGIN_MANAGER_H_
22 #define _ANJUTA_PLUGIN_MANAGER_H_
24 #include <glib-object.h>
25 #include <libanjuta/anjuta-status.h>
26 #include <libanjuta/anjuta-profile.h>
27 #include <libanjuta/anjuta-plugin-description.h>
29 G_BEGIN_DECLS
31 #define ANJUTA_TYPE_PLUGIN_MANAGER (anjuta_plugin_manager_get_type ())
32 #define ANJUTA_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PLUGIN_MANAGER, AnjutaPluginManager))
33 #define ANJUTA_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PLUGIN_MANAGER, AnjutaPluginManagerClass))
34 #define ANJUTA_IS_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PLUGIN_MANAGER))
35 #define ANJUTA_IS_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PLUGIN_MANAGER))
36 #define ANJUTA_PLUGIN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PLUGIN_MANAGER, AnjutaPluginManagerClass))
38 typedef struct _AnjutaPluginManagerClass AnjutaPluginManagerClass;
39 typedef struct _AnjutaPluginManager AnjutaPluginManager;
40 typedef struct _AnjutaPluginManagerPriv AnjutaPluginManagerPriv;
42 struct _AnjutaPluginManagerClass
44 GObjectClass parent_class;
46 /* Signals */
47 void(* profile_pushed) (AnjutaPluginManager *self, AnjutaProfile* profile);
48 void(* profile_popped) (AnjutaPluginManager *self, AnjutaProfile* profile);
49 void(* plugin_activated) (AnjutaPluginManager *self,
50 AnjutaProfile* profile,
51 AnjutaPluginDescription* plugin_desc,
52 GObject *plugin);
53 void(* plugin_deactivated) (AnjutaPluginManager *self,
54 AnjutaProfile* profile,
55 AnjutaPluginDescription* plugin_desc);
58 struct _AnjutaPluginManager
60 GObject parent_instance;
61 AnjutaPluginManagerPriv *priv;
64 GType anjuta_plugin_manager_get_type (void) G_GNUC_CONST;
65 AnjutaPluginManager* anjuta_plugin_manager_new (GObject *shell,
66 AnjutaStatus *status,
67 GList* plugin_search_paths);
69 /* Plugin profiles */
70 gboolean anjuta_plugin_manager_push_profile (AnjutaPluginManager *plugin_manager,
71 const gchar *profile_name,
72 const gchar* profile_xml_file,
73 gboolean readonly,
74 gboolean unload_rest);
75 gboolean anjuta_plugin_manager_pop_profile (AnjutaPluginManager *plugin_manager,
76 const gchar *profile_name);
78 void anjuta_plugin_manager_freeze (AnjutaPluginManager *plugin_manager);
79 gboolean anjuta_plugin_manager_thaw (AnjutaPluginManager *plugin_manager,
80 GError **error);
82 /* Plugin activation, deactivation and retrival */
83 GObject* anjuta_plugin_manager_get_plugin (AnjutaPluginManager *plugin_manager,
84 const gchar *iface_name);
85 GObject* anjuta_plugin_manager_get_plugin_by_id (AnjutaPluginManager *plugin_manager,
86 const gchar *plugin_id);
87 gboolean anjuta_plugin_manager_unload_plugin (AnjutaPluginManager *plugin_manager,
88 GObject *plugin);
89 gboolean anjuta_plugin_manager_unload_plugin_by_id (AnjutaPluginManager *plugin_manager,
90 const gchar *plugin_id);
91 GList* anjuta_plugin_manager_get_active_plugins (AnjutaPluginManager *plugin_manager);
93 /* Selection dialogs */
94 GtkWidget* anjuta_plugin_manager_get_dialog (AnjutaPluginManager *plugin_manager);
96 /* Plugin queries based on meta-data */
97 /* Returns a list of plugin Descriptions */
98 GList* anjuta_plugin_manager_query (AnjutaPluginManager *plugin_manager,
99 const gchar *section_name,
100 const gchar *attribute_name,
101 const gchar *attribute_value,
102 ...);
104 /* Returns the plugin description that has been selected from the list */
105 AnjutaPluginDescription* anjuta_plugin_manager_select (AnjutaPluginManager *plugin_manager,
106 gchar *title, gchar *description,
107 GList *plugin_descriptions);
109 /* Returns the plugin that has been selected and activated */
110 GObject* anjuta_plugin_manager_select_and_activate (AnjutaPluginManager *plugin_manager,
111 gchar *title,
112 gchar *description,
113 GList *plugin_descriptions);
114 void anjuta_plugin_manager_unload_all_plugins (AnjutaPluginManager *plugin_manager);
117 * anjuta_plugin_manager_get_interface:
118 * @plugin_manager: A #AnjutaPluginManager object
119 * @iface_type: The interface type implemented by the object to be found
120 * @error: Error propagation object.
122 * Equivalent to anjuta_plugin_manager_get_object(), but additionally
123 * typecasts returned object to the interface type. It also takes
124 * interface type directly. A usage of this function is:
125 * <programlisting>
126 * IAnjutaDocumentManager *docman =
127 * anjuta_plugin_manager_get_interface (plugin_manager, IAnjutaDocumentManager, error);
128 * </programlisting>
130 #define anjuta_plugin_manager_get_interface(plugin_manager, iface_type, error) \
131 (((iface_type*) anjuta_plugin_manager_get_plugin((plugin_manager), #iface_type, (error)))
133 G_END_DECLS
135 #endif /* _ANJUTA_PLUGIN_MANAGER_H_ */