* scripts/anjuta_import.sh.in,
[anjuta-git-plugin.git] / libanjuta / anjuta-plugin-description.h
blob9d4bf2884520d169ee4e36a430e1acf957d2ca73
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 typedef enum
44 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX,
45 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES,
46 ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS
47 } AnjutaPluginDescriptionParseError;
49 #define ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR \
50 anjuta_plugin_description_parse_error_quark()
52 GQuark anjuta_plugin_description_parse_error_quark (void);
55 AnjutaPluginDescription* anjuta_plugin_description_new (const gchar *filename,
56 GError **error);
58 AnjutaPluginDescription* anjuta_plugin_description_new_from_string (gchar *data,
59 GError **error);
61 gchar* anjuta_plugin_description_to_string (AnjutaPluginDescription *pf);
63 void anjuta_plugin_description_free (AnjutaPluginDescription *pf);
65 void anjuta_plugin_description_foreach_section (AnjutaPluginDescription *pf,
66 AnjutaPluginDescriptionSectionFunc func,
67 gpointer user_data);
69 void anjuta_plugin_description_foreach_key (AnjutaPluginDescription *df,
70 const gchar *section,
71 gboolean include_localized,
72 AnjutaPluginDescriptionLineFunc func,
73 gpointer user_data);
75 /* Gets the raw text of the key, unescaped */
76 gboolean anjuta_plugin_description_get_raw (AnjutaPluginDescription *df,
77 const gchar *section,
78 const gchar *keyname,
79 const gchar *locale,
80 gchar **val);
82 gboolean anjuta_plugin_description_get_integer (AnjutaPluginDescription *df,
83 const gchar *section,
84 const gchar *keyname,
85 gint *val);
87 gboolean anjuta_plugin_description_get_string (AnjutaPluginDescription *df,
88 const gchar *section,
89 const gchar *keyname,
90 gchar **val);
92 gboolean anjuta_plugin_description_get_locale_string (AnjutaPluginDescription *df,
93 const gchar *section,
94 const gchar *keyname,
95 gchar **val);
96 G_END_DECLS;
98 #endif /* ANJUTA_PLUGIN_PARSER_H */