Use dist_doc_DATA for documentation text files
[anjuta.git] / libanjuta / anjuta-plugin-description.h
blob1d851705a1e10a3c219a011b0aec93b0b253864c
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-object.h>
26 G_BEGIN_DECLS
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,
34 const gchar *name,
35 gpointer user_data);
37 /* If @key is %NULL, @value is a comment line. */
38 /* @value is raw, unescaped data. */
39 typedef void (*AnjutaPluginDescriptionLineFunc) (AnjutaPluginDescription *df,
40 const gchar *key,
41 const gchar *locale,
42 const gchar *value,
43 gpointer data);
45 /**
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
53 typedef enum
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,
68 GError **error);
70 AnjutaPluginDescription* anjuta_plugin_description_new_from_string (gchar *data,
71 GError **error);
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,
80 gpointer user_data);
82 void anjuta_plugin_description_foreach_key (AnjutaPluginDescription *df,
83 const gchar *section_name,
84 gboolean include_localized,
85 AnjutaPluginDescriptionLineFunc func,
86 gpointer user_data);
88 /* Gets the raw text of the key, unescaped */
89 gboolean anjuta_plugin_description_get_raw (AnjutaPluginDescription *df,
90 const gchar *section_name,
91 const gchar *keyname,
92 const gchar *locale,
93 gchar **val);
95 gboolean anjuta_plugin_description_get_integer (AnjutaPluginDescription *df,
96 const gchar *section,
97 const gchar *keyname,
98 gint *val);
100 gboolean anjuta_plugin_description_get_boolean (AnjutaPluginDescription *df,
101 const gchar *section,
102 const gchar *keyname,
103 gboolean *val);
105 gboolean anjuta_plugin_description_get_string (AnjutaPluginDescription *df,
106 const gchar *section,
107 const gchar *keyname,
108 gchar **val);
110 gboolean anjuta_plugin_description_get_locale_string (AnjutaPluginDescription *df,
111 const gchar *section,
112 const gchar *keyname,
113 gchar **val);
114 G_END_DECLS
116 #endif /* ANJUTA_PLUGIN_PARSER_H */