Reviewed by Sébastien Granjoux <seb.sfo@free.fr>:
[anjuta-git-plugin.git] / libanjuta / anjuta-shell.h
blobb9136d8bdc9f9f435c2bc3d4581dacbcbd34a8a7
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-shell.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _ANJUTA_SHELL_H
21 #define _ANJUTA_SHELL_H
23 #include <glib-object.h>
24 #include <gtk/gtkwidget.h>
26 #include <libanjuta/anjuta-shell.h>
27 #include <libanjuta/anjuta-status.h>
28 #include <libanjuta/anjuta-ui.h>
29 #include <libanjuta/anjuta-preferences.h>
30 #include <libanjuta/anjuta-plugin-manager.h>
31 #include <libanjuta/anjuta-profile-manager.h>
32 #include <libanjuta/anjuta-session.h>
33 #include <libanjuta/anjuta-save-prompt.h>
35 G_BEGIN_DECLS
37 #define ANJUTA_TYPE_SHELL (anjuta_shell_get_type ())
38 #define ANJUTA_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_SHELL, AnjutaShell))
39 #define ANJUTA_IS_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_SHELL))
40 #define ANJUTA_SHELL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ANJUTA_TYPE_SHELL, AnjutaShellIface))
42 #define ANJUTA_SHELL_ERROR anjuta_shell_error_quark()
44 typedef struct _AnjutaShell AnjutaShell;
45 typedef struct _AnjutaShellIface AnjutaShellIface;
47 typedef enum
49 ANJUTA_SHELL_ERROR_DOESNT_EXIST,
50 } AnjutaShellError;
52 typedef enum
54 ANJUTA_SHELL_PLACEMENT_NONE = 0,
55 ANJUTA_SHELL_PLACEMENT_TOP,
56 ANJUTA_SHELL_PLACEMENT_BOTTOM,
57 ANJUTA_SHELL_PLACEMENT_RIGHT,
58 ANJUTA_SHELL_PLACEMENT_LEFT,
59 ANJUTA_SHELL_PLACEMENT_CENTER,
60 ANJUTA_SHELL_PLACEMENT_FLOATING
61 } AnjutaShellPlacement;
63 struct _AnjutaShellIface {
64 GTypeInterface g_iface;
66 /* Signals */
67 void (*value_added) (AnjutaShell *shell, char *name, GValue *value);
68 void (*value_removed) (AnjutaShell *shell, char *name);
69 void (*save_session) (AnjutaShell *shell, AnjutaSessionPhase phase,
70 AnjutaSession *session);
71 void (*load_session) (AnjutaShell *shell, AnjutaSessionPhase phase,
72 AnjutaSession *session);
73 void (*save_prompt) (AnjutaShell *shell, AnjutaSavePrompt *save_prompt);
74 void (*exiting) (AnjutaShell *shell);
76 /* Virtual Table */
77 AnjutaStatus* (*get_status) (AnjutaShell *shell, GError **err);
78 AnjutaUI* (*get_ui) (AnjutaShell *shell, GError **err);
79 AnjutaPreferences* (*get_preferences) (AnjutaShell *shell, GError **err);
80 AnjutaPluginManager* (*get_plugin_manager) (AnjutaShell *shell,
81 GError **err);
82 AnjutaProfileManager* (*get_profile_manager) (AnjutaShell *shell,
83 GError **err);
85 void (*add_widget_full) (AnjutaShell *shell,
86 GtkWidget *widget,
87 const char *name,
88 const char *title,
89 const char *stock_id,
90 AnjutaShellPlacement placement,
91 gboolean locked,
92 GError **error);
94 void (*remove_widget) (AnjutaShell *shell,
95 GtkWidget *widget,
96 GError **error);
97 void (*present_widget) (AnjutaShell *shell,
98 GtkWidget *widget,
99 GError **error);
100 void (*add_value) (AnjutaShell *shell,
101 const char *name,
102 const GValue *value,
103 GError **error);
104 void (*get_value) (AnjutaShell *shell,
105 const char *name,
106 GValue *value,
107 GError **error);
108 void (*remove_value) (AnjutaShell *shell,
109 const char *name,
110 GError **error);
111 GObject* (*get_object) (AnjutaShell *shell,
112 const char *iface_name,
113 GError **error);
116 GQuark anjuta_shell_error_quark (void);
117 GType anjuta_shell_get_type (void);
119 AnjutaStatus* anjuta_shell_get_status (AnjutaShell *shell, GError **error);
121 AnjutaUI* anjuta_shell_get_ui (AnjutaShell *shell, GError **error);
123 AnjutaPreferences* anjuta_shell_get_preferences (AnjutaShell *shell,
124 GError **error);
126 AnjutaPluginManager* anjuta_shell_get_plugin_manager (AnjutaShell *shell,
127 GError **error);
129 AnjutaProfileManager* anjuta_shell_get_profile_manager (AnjutaShell *shell,
130 GError **error);
132 void anjuta_shell_freeze (AnjutaShell *shell, GError **error);
133 void anjuta_shell_thaw (AnjutaShell *shell, GError **error);
135 void anjuta_shell_add_widget (AnjutaShell *shell,
136 GtkWidget *widget,
137 const char *name,
138 const char *title,
139 const char *stock_id,
140 AnjutaShellPlacement placement,
141 GError **error);
143 void anjuta_shell_add_widget_full (AnjutaShell *shell,
144 GtkWidget *widget,
145 const char *name,
146 const char *title,
147 const char *stock_id,
148 AnjutaShellPlacement placement,
149 gboolean locked,
150 GError **error);
152 void anjuta_shell_remove_widget (AnjutaShell *shell,
153 GtkWidget *widget,
154 GError **error);
155 void anjuta_shell_present_widget (AnjutaShell *shell,
156 GtkWidget *widget,
157 GError **error);
158 void anjuta_shell_add_value (AnjutaShell *shell,
159 const char *name,
160 const GValue *value,
161 GError **error);
162 void anjuta_shell_add_valist (AnjutaShell *shell,
163 const char *first_name,
164 GType first_type,
165 va_list var_args);
166 void anjuta_shell_add (AnjutaShell *shell,
167 const char *first_name,
168 GType first_type,
169 ...);
170 void anjuta_shell_get_value (AnjutaShell *shell,
171 const char *name,
172 GValue *value,
173 GError **error);
174 void anjuta_shell_get_valist (AnjutaShell *shell,
175 const char *first_name,
176 GType first_type,
177 va_list var_args);
178 void anjuta_shell_get (AnjutaShell *shell,
179 const char *first_name,
180 GType first_type,
181 ...);
182 void anjuta_shell_remove_value (AnjutaShell *shell,
183 const char *name,
184 GError **error);
186 GObject *anjuta_shell_get_object (AnjutaShell *shell,
187 const gchar *iface_name,
188 GError **error);
189 void anjuta_shell_session_save (AnjutaShell *shell,
190 const gchar *session_directory,
191 GError **error);
192 void anjuta_shell_session_load (AnjutaShell *shell,
193 const gchar *session_directory,
194 GError **error);
195 void anjuta_shell_save_prompt (AnjutaShell *shell,
196 AnjutaSavePrompt *prompt,
197 GError **error);
198 void anjuta_shell_notify_exit (AnjutaShell *shell, GError **error);
201 * anjuta_shell_get_interface:
202 * @shell: A #AnjutaShell object
203 * @iface_type: The interface type implemented by the object to be found
204 * @error: Error propagation object.
206 * Equivalent to anjuta_shell_get_object(), but additionally typecasts returned
207 * object to the interface type. It also takes interface type directly. A
208 * usage of this function is:
209 * <programlisting>
210 * IAnjutaDocumentManager *docman =
211 * anjuta_shell_get_interface (shell, IAnjutaDocumentManager, error);
212 * </programlisting>
214 #define anjuta_shell_get_interface(shell, iface_type, error) \
215 ((iface_type*) anjuta_shell_get_object((shell), #iface_type, (error)))
217 G_END_DECLS
219 #endif