1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Naba Kumar <naba@gnome.org>
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
21 #ifndef _ANJUTA_PROFILE_H_
22 #define _ANJUTA_PROFILE_H_
24 #include <glib-object.h>
26 #include <libanjuta/anjuta-plugin-handle.h>
27 #include <libanjuta/anjuta-plugin-manager.h>
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))
39 * ANJUTA_PROFILE_ERROR:
41 * Error domain for Anjuta profile. Errors in this domain will be from the
42 * #AnjutaProfileError enumeration. See #GError for more information
45 #define ANJUTA_PROFILE_ERROR (anjuta_profile_error_quark())
48 * ANJUTA_SYSTEM_PROFILE_ERROR:
50 * Special name for a system profile. The content of such profile is never
53 #define ANJUTA_SYSTEM_PROFILE_NAME "system"
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.
60 * Error codes returned by anjuta profile functions.
65 ANJUTA_PROFILE_ERROR_URI_READ_FAILED
,
66 ANJUTA_PROFILE_ERROR_URI_WRITE_FAILED
,
67 ANJUTA_PROFILE_ERROR_PLUGIN_MISSING
70 typedef struct _AnjutaProfileClass AnjutaProfileClass
;
71 typedef struct _AnjutaProfile AnjutaProfile
;
72 typedef struct _AnjutaProfilePriv AnjutaProfilePriv
;
74 struct _AnjutaProfileClass
76 GObjectClass parent_class
;
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
);
91 * Stores a plugin list.
95 GObject parent_instance
;
96 AnjutaProfilePriv
*priv
;
99 GQuark
anjuta_profile_error_quark (void);
100 GType
anjuta_profile_get_type (void) G_GNUC_CONST
;
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
,
113 gboolean
anjuta_profile_has_plugin (AnjutaProfile
*profile
,
114 AnjutaPluginHandle
*plugin
);
115 GList
* anjuta_profile_get_plugins (AnjutaProfile
*profile
);
117 void anjuta_profile_set_sync_file (AnjutaProfile
*profile
,
119 gboolean
anjuta_profile_sync (AnjutaProfile
*profile
, GError
**error
);
121 gboolean
anjuta_profile_load (AnjutaProfile
*profile
, GError
**error
);
122 gboolean
anjuta_profile_unload (AnjutaProfile
*profile
, GError
**error
);
126 #endif /* _ANJUTA_PROFILE_H_ */