2 * AnjutaPluginDescription - Plugin meta data
3 * anjuta-plugin-description.h Copyright (C) 2002 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef ANJUTA_PLUGIN_PARSER_H
22 #define ANJUTA_PLUGIN_PARSER_H
24 #include <glib-object.h>
28 #define ANJUTA_TYPE_PLUGIN_DESCRIPTION (anjuta_project_property_get_type ())
29 #define ANJUTA_IS_PLUGIN_DESCIRPTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_DESCRIPTION))
31 typedef struct _AnjutaPluginDescription AnjutaPluginDescription
;
33 typedef void (*AnjutaPluginDescriptionSectionFunc
) (AnjutaPluginDescription
*df
,
37 /* If @key is %NULL, @value is a comment line. */
38 /* @value is raw, unescaped data. */
39 typedef void (*AnjutaPluginDescriptionLineFunc
) (AnjutaPluginDescription
*df
,
46 * AnjutaPluginDescriptionParseError:
47 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX: Syntax of plugin file is invalid
48 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES: Invalid escape sequence
49 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS: Invalid characters
51 * Possible errors when parsing a plugin file
55 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX
,
56 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES
,
57 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS
58 } AnjutaPluginDescriptionParseError
;
60 #define ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR \
61 anjuta_plugin_description_parse_error_quark()
63 GQuark
anjuta_plugin_description_parse_error_quark (void);
65 GType
anjuta_plugin_description_get_type (void);
67 AnjutaPluginDescription
* anjuta_plugin_description_new (const gchar
*filename
,
70 AnjutaPluginDescription
* anjuta_plugin_description_new_from_string (gchar
*data
,
73 gchar
* anjuta_plugin_description_to_string (AnjutaPluginDescription
*df
);
75 void anjuta_plugin_description_free (AnjutaPluginDescription
*df
);
76 AnjutaPluginDescription
*anjuta_plugin_description_copy (AnjutaPluginDescription
*df
);
78 void anjuta_plugin_description_foreach_section (AnjutaPluginDescription
*df
,
79 AnjutaPluginDescriptionSectionFunc func
,
82 void anjuta_plugin_description_foreach_key (AnjutaPluginDescription
*df
,
83 const gchar
*section_name
,
84 gboolean include_localized
,
85 AnjutaPluginDescriptionLineFunc func
,
88 /* Gets the raw text of the key, unescaped */
89 gboolean
anjuta_plugin_description_get_raw (AnjutaPluginDescription
*df
,
90 const gchar
*section_name
,
95 gboolean
anjuta_plugin_description_get_integer (AnjutaPluginDescription
*df
,
100 gboolean
anjuta_plugin_description_get_boolean (AnjutaPluginDescription
*df
,
101 const gchar
*section
,
102 const gchar
*keyname
,
105 gboolean
anjuta_plugin_description_get_string (AnjutaPluginDescription
*df
,
106 const gchar
*section
,
107 const gchar
*keyname
,
110 gboolean
anjuta_plugin_description_get_locale_string (AnjutaPluginDescription
*df
,
111 const gchar
*section
,
112 const gchar
*keyname
,
115 gboolean
anjuta_plugin_description_override (AnjutaPluginDescription
*df
,
116 const gchar
*section_name
,
117 const gchar
*keyname
,
120 gboolean
anjuta_plugin_description_remove (AnjutaPluginDescription
*df
,
121 const gchar
*section_name
,
122 const gchar
*keyname
);
125 #endif /* ANJUTA_PLUGIN_PARSER_H */