git: Implement the Tags pane
[anjuta.git] / libanjuta / anjuta-plugin-description.h
blob8710faf216dfff9ad30f7fca0875bbe21eb35282
1 /*
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.h>
26 G_BEGIN_DECLS
28 typedef struct _AnjutaPluginDescription AnjutaPluginDescription;
30 typedef void (*AnjutaPluginDescriptionSectionFunc) (AnjutaPluginDescription *df,
31 const gchar *name,
32 gpointer user_data);
34 /* If @key is %NULL, @value is a comment line. */
35 /* @value is raw, unescaped data. */
36 typedef void (*AnjutaPluginDescriptionLineFunc) (AnjutaPluginDescription *df,
37 const gchar *key,
38 const gchar *locale,
39 const gchar *value,
40 gpointer data);
42 /**
43 * AnjutaPluginDescriptionParseError:
44 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX: Syntax of plugin file is invalid
45 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES: Invalid escape sequence
46 * @ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS: Invalid characters
48 * Possible errors when parsing a plugin file
50 typedef enum
52 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX,
53 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES,
54 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS
55 } AnjutaPluginDescriptionParseError;
57 #define ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR \
58 anjuta_plugin_description_parse_error_quark()
60 GQuark anjuta_plugin_description_parse_error_quark (void);
63 AnjutaPluginDescription* anjuta_plugin_description_new (const gchar *filename,
64 GError **error);
66 AnjutaPluginDescription* anjuta_plugin_description_new_from_string (gchar *data,
67 GError **error);
69 gchar* anjuta_plugin_description_to_string (AnjutaPluginDescription *df);
71 void anjuta_plugin_description_free (AnjutaPluginDescription *df);
73 void anjuta_plugin_description_foreach_section (AnjutaPluginDescription *df,
74 AnjutaPluginDescriptionSectionFunc func,
75 gpointer user_data);
77 void anjuta_plugin_description_foreach_key (AnjutaPluginDescription *df,
78 const gchar *section_name,
79 gboolean include_localized,
80 AnjutaPluginDescriptionLineFunc func,
81 gpointer user_data);
83 /* Gets the raw text of the key, unescaped */
84 gboolean anjuta_plugin_description_get_raw (AnjutaPluginDescription *df,
85 const gchar *section_name,
86 const gchar *keyname,
87 const gchar *locale,
88 gchar **val);
90 gboolean anjuta_plugin_description_get_integer (AnjutaPluginDescription *df,
91 const gchar *section,
92 const gchar *keyname,
93 gint *val);
95 gboolean anjuta_plugin_description_get_boolean (AnjutaPluginDescription *df,
96 const gchar *section,
97 const gchar *keyname,
98 gboolean *val);
100 gboolean anjuta_plugin_description_get_string (AnjutaPluginDescription *df,
101 const gchar *section,
102 const gchar *keyname,
103 gchar **val);
105 gboolean anjuta_plugin_description_get_locale_string (AnjutaPluginDescription *df,
106 const gchar *section,
107 const gchar *keyname,
108 gchar **val);
109 G_END_DECLS
111 #endif /* ANJUTA_PLUGIN_PARSER_H */