1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ 2 /* 3 * anjuta-profile.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 21 #ifndef _ANJUTA_PROFILE_H_ 22 #define _ANJUTA_PROFILE_H_ 23 24 #include <glib-object.h> 25 #include <gio/gio.h> 26 #include <libanjuta/anjuta-plugin-handle.h> 27 #include <libanjuta/anjuta-plugin-manager.h> 28 29 G_BEGIN_DECLS 30 31 #define ANJUTA_TYPE_PROFILE (anjuta_profile_get_type ()) 32 #define ANJUTA_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PROFILE, AnjutaProfile)) 33 #define ANJUTA_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PROFILE, AnjutaProfileClass)) 34 #define ANJUTA_IS_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PROFILE)) 35 #define ANJUTA_IS_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PROFILE)) 36 #define ANJUTA_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PROFILE, AnjutaProfileClass)) 37 38 /** 39 * ANJUTA_PROFILE_ERROR: 40 * 41 * Error domain for Anjuta profile. Errors in this domain will be from the 42 * #AnjutaProfileError enumeration. See #GError for more information 43 * on error domains. 44 */ 45 #define ANJUTA_PROFILE_ERROR (anjuta_profile_error_quark()) 46 47 /** 48 * ANJUTA_SYSTEM_PROFILE_ERROR: 49 * 50 * Special name for a system profile. The content of such profile is never 51 * unloaded. 52 */ 53 #define ANJUTA_SYSTEM_PROFILE_NAME "system" 54 55 /** 56 * AnjutaProfileError: 57 * @ANJUTA_PROFILE_ERROR_URI_READ_FAILED: Fail to read xml plugins list file. 58 * @ANJUTA_PROFILE_ERROR_URI_WRITE_FAILED: Fail to write xml plugins list file. 59 * 60 * Error codes returned by anjuta profile functions. 61 * 62 */ 63 typedef enum 64 { 65 ANJUTA_PROFILE_ERROR_URI_READ_FAILED, 66 ANJUTA_PROFILE_ERROR_URI_WRITE_FAILED, 67 ANJUTA_PROFILE_ERROR_PLUGIN_MISSING 68 } AnjutaProfileError; 69 70 typedef struct _AnjutaProfileClass AnjutaProfileClass; 71 typedef struct _AnjutaProfile AnjutaProfile; 72 typedef struct _AnjutaProfilePriv AnjutaProfilePriv; 73 74 struct _AnjutaProfileClass 75 { 76 GObjectClass parent_class; 77 78 /* Signals */ 79 void(* plugin_added) (AnjutaProfile *self, 80 AnjutaPluginHandle *plugin); 81 void(* plugin_removed) (AnjutaProfile *self, 82 AnjutaPluginHandle *plugin); 83 void(* changed) (AnjutaProfile *self); 84 void(* descoped) (AnjutaProfile *self); 85 void(* scoped) (AnjutaProfile *self); 86 }; 87 88 /** 89 * AnjutaProfile: 90 * 91 * Stores a plugin list. 92 */ 93 struct _AnjutaProfile 94 { 95 GObject parent_instance; 96 AnjutaProfilePriv *priv; 97 }; 98 99 GQuark anjuta_profile_error_quark (void); 100 GType anjuta_profile_get_type (void) G_GNUC_CONST; 101 102 AnjutaProfile* anjuta_profile_new (const gchar *name, 103 AnjutaPluginManager *plugin_manager); 104 const gchar *anjuta_profile_get_name (AnjutaProfile *profile); 105 void anjuta_profile_add_plugin (AnjutaProfile *profile, 106 AnjutaPluginHandle *plugin); 107 void anjuta_profile_remove_plugin (AnjutaProfile *profile, 108 AnjutaPluginHandle *plugin); 109 gboolean anjuta_profile_add_plugins_from_xml (AnjutaProfile *profile, 110 GFile* profile_xml_file, 111 gboolean exclude_from_sync, 112 GError **error); 113 gboolean anjuta_profile_has_plugin (AnjutaProfile *profile, 114 AnjutaPluginHandle *plugin); 115 GList* anjuta_profile_get_plugins (AnjutaProfile *profile); 116 117 void anjuta_profile_set_sync_file (AnjutaProfile *profile, 118 GFile *sync_file); 119 gboolean anjuta_profile_sync (AnjutaProfile *profile, GError **error); 120 121 gboolean anjuta_profile_load (AnjutaProfile *profile, GError **error); 122 gboolean anjuta_profile_unload (AnjutaProfile *profile, GError **error); 123 124 G_END_DECLS 125 126 #endif /* _ANJUTA_PROFILE_H_ */ 127