Change LGPL-2.1+ to LGPL-2.1-or-later
[platform/upstream/glib.git] / gobject / glib-types.h
1 /* GObject - GLib Type, Object, Parameter and Signal Library
2  * Copyright (C) 2000-2001 Red Hat, Inc.
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General
17  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef __GLIB_TYPES_H__
20 #define __GLIB_TYPES_H__
21
22 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION) && !defined(GLIB_COMPILATION)
23 #error "Only <glib-object.h> can be included directly."
24 #endif
25
26 #include <glib.h>
27 #include <gobject/gobject-visibility.h>
28
29 G_BEGIN_DECLS
30
31 /* A hack necesssary to preprocess this file with g-ir-scanner */
32 #ifdef __GI_SCANNER__
33 typedef gsize GType;
34 #endif
35
36 /* --- GLib boxed types --- */
37 /**
38  * G_TYPE_DATE:
39  *
40  * The #GType for #GDate.
41  */
42 #define G_TYPE_DATE (g_date_get_type ())
43
44 /**
45  * G_TYPE_STRV:
46  *
47  * The #GType for a boxed type holding a %NULL-terminated array of strings.
48  *
49  * The code fragments in the following example show the use of a property of
50  * type %G_TYPE_STRV with g_object_class_install_property(), g_object_set()
51  * and g_object_get().
52  *
53  * |[
54  * g_object_class_install_property (object_class,
55  *                                  PROP_AUTHORS,
56  *                                  g_param_spec_boxed ("authors",
57  *                                                      _("Authors"),
58  *                                                      _("List of authors"),
59  *                                                      G_TYPE_STRV,
60  *                                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
61  *
62  * gchar *authors[] = { "Owen", "Tim", NULL };
63  * g_object_set (obj, "authors", authors, NULL);
64  *
65  * gchar *writers[];
66  * g_object_get (obj, "authors", &writers, NULL);
67  * /&ast; do something with writers &ast;/
68  * g_strfreev (writers);
69  * ]|
70  *
71  * Since: 2.4
72  */
73 #define G_TYPE_STRV (g_strv_get_type ())
74
75 /**
76  * G_TYPE_GSTRING:
77  *
78  * The #GType for #GString.
79  */
80 #define G_TYPE_GSTRING (g_gstring_get_type ())
81
82 /**
83  * G_TYPE_HASH_TABLE:
84  *
85  * The #GType for a boxed type holding a #GHashTable reference.
86  *
87  * Since: 2.10
88  */
89 #define G_TYPE_HASH_TABLE (g_hash_table_get_type ())
90
91 /**
92  * G_TYPE_REGEX:
93  *
94  * The #GType for a boxed type holding a #GRegex reference.
95  *
96  * Since: 2.14
97  */
98 #define G_TYPE_REGEX (g_regex_get_type ())
99
100 /**
101  * G_TYPE_MATCH_INFO:
102  *
103  * The #GType for a boxed type holding a #GMatchInfo reference.
104  *
105  * Since: 2.30
106  */
107 #define G_TYPE_MATCH_INFO (g_match_info_get_type ())
108
109 /**
110  * G_TYPE_ARRAY:
111  *
112  * The #GType for a boxed type holding a #GArray reference.
113  *
114  * Since: 2.22
115  */
116 #define G_TYPE_ARRAY (g_array_get_type ())
117
118 /**
119  * G_TYPE_BYTE_ARRAY:
120  *
121  * The #GType for a boxed type holding a #GByteArray reference.
122  *
123  * Since: 2.22
124  */
125 #define G_TYPE_BYTE_ARRAY (g_byte_array_get_type ())
126
127 /**
128  * G_TYPE_PTR_ARRAY:
129  *
130  * The #GType for a boxed type holding a #GPtrArray reference.
131  *
132  * Since: 2.22
133  */
134 #define G_TYPE_PTR_ARRAY (g_ptr_array_get_type ())
135
136 /**
137  * G_TYPE_BYTES:
138  *
139  * The #GType for #GBytes.
140  *
141  * Since: 2.32
142  */
143 #define G_TYPE_BYTES (g_bytes_get_type ())
144
145 /**
146  * G_TYPE_VARIANT_TYPE:
147  *
148  * The #GType for a boxed type holding a #GVariantType.
149  *
150  * Since: 2.24
151  */
152 #define G_TYPE_VARIANT_TYPE (g_variant_type_get_gtype ())
153
154 /**
155  * G_TYPE_ERROR:
156  *
157  * The #GType for a boxed type holding a #GError.
158  *
159  * Since: 2.26
160  */
161 #define G_TYPE_ERROR (g_error_get_type ())
162
163 /**
164  * G_TYPE_DATE_TIME:
165  *
166  * The #GType for a boxed type holding a #GDateTime.
167  *
168  * Since: 2.26
169  */
170 #define G_TYPE_DATE_TIME (g_date_time_get_type ())
171
172 /**
173  * G_TYPE_TIME_ZONE:
174  *
175  * The #GType for a boxed type holding a #GTimeZone.
176  *
177  * Since: 2.34
178  */
179 #define G_TYPE_TIME_ZONE (g_time_zone_get_type ())
180
181 /**
182  * G_TYPE_IO_CHANNEL:
183  *
184  * The #GType for #GIOChannel.
185  */
186 #define G_TYPE_IO_CHANNEL (g_io_channel_get_type ())
187
188 /**
189  * G_TYPE_IO_CONDITION:
190  *
191  * The #GType for #GIOCondition.
192  */
193 #define G_TYPE_IO_CONDITION (g_io_condition_get_type ())
194
195 /**
196  * G_TYPE_VARIANT_BUILDER:
197  *
198  * The #GType for a boxed type holding a #GVariantBuilder.
199  *
200  * Since: 2.30
201  */
202 #define G_TYPE_VARIANT_BUILDER (g_variant_builder_get_type ())
203
204 /**
205  * G_TYPE_VARIANT_DICT:
206  *
207  * The #GType for a boxed type holding a #GVariantDict.
208  *
209  * Since: 2.40
210  */
211 #define G_TYPE_VARIANT_DICT (g_variant_dict_get_type ())
212
213 /**
214  * G_TYPE_MAIN_LOOP:
215  *
216  * The #GType for a boxed type holding a #GMainLoop.
217  *
218  * Since: 2.30
219  */
220 #define G_TYPE_MAIN_LOOP (g_main_loop_get_type ())
221
222 /**
223  * G_TYPE_MAIN_CONTEXT:
224  *
225  * The #GType for a boxed type holding a #GMainContext.
226  *
227  * Since: 2.30
228  */
229 #define G_TYPE_MAIN_CONTEXT (g_main_context_get_type ())
230
231 /**
232  * G_TYPE_SOURCE:
233  *
234  * The #GType for a boxed type holding a #GSource.
235  *
236  * Since: 2.30
237  */
238 #define G_TYPE_SOURCE (g_source_get_type ())
239
240 /**
241  * G_TYPE_POLLFD:
242  *
243  * The #GType for a boxed type holding a #GPollFD.
244  *
245  * Since: 2.36
246  */
247 #define G_TYPE_POLLFD (g_pollfd_get_type ())
248
249 /**
250  * G_TYPE_MARKUP_PARSE_CONTEXT:
251  *
252  * The #GType for a boxed type holding a #GMarkupParseContext.
253  *
254  * Since: 2.36
255  */
256 #define G_TYPE_MARKUP_PARSE_CONTEXT (g_markup_parse_context_get_type ())
257
258 /**
259  * G_TYPE_KEY_FILE:
260  *
261  * The #GType for a boxed type holding a #GKeyFile.
262  *
263  * Since: 2.32
264  */
265 #define G_TYPE_KEY_FILE (g_key_file_get_type ())
266
267 /**
268  * G_TYPE_MAPPED_FILE:
269  *
270  * The #GType for a boxed type holding a #GMappedFile.
271  *
272  * Since: 2.40
273  */
274 #define G_TYPE_MAPPED_FILE (g_mapped_file_get_type ())
275
276 /**
277  * G_TYPE_THREAD:
278  *
279  * The #GType for a boxed type holding a #GThread.
280  *
281  * Since: 2.36
282  */
283 #define G_TYPE_THREAD (g_thread_get_type ())
284
285 /**
286  * G_TYPE_CHECKSUM:
287  *
288  * The #GType for a boxed type holding a #GChecksum.
289  *
290  * Since: 2.36
291  */
292 #define G_TYPE_CHECKSUM (g_checksum_get_type ())
293
294 /**
295  * G_TYPE_OPTION_GROUP:
296  *
297  * The #GType for a boxed type holding a #GOptionGroup.
298  *
299  * Since: 2.44
300  */
301 #define G_TYPE_OPTION_GROUP (g_option_group_get_type ())
302
303 /**
304  * G_TYPE_URI:
305  *
306  * The #GType for a boxed type holding a #GUri.
307  *
308  * Since: 2.66
309  */
310 #define G_TYPE_URI (g_uri_get_type ())
311
312 /**
313  * G_TYPE_TREE:
314  *
315  * The #GType for #GTree.
316  *
317  * Since: 2.68
318  */
319 #define G_TYPE_TREE (g_tree_get_type ())
320
321 /**
322  * G_TYPE_PATTERN_SPEC:
323  *
324  * The #GType for #GPatternSpec.
325  *
326  * Since: 2.70
327  */
328 #define G_TYPE_PATTERN_SPEC (g_pattern_spec_get_type ())
329
330 /**
331  * G_TYPE_BOOKMARK_FILE:
332  *
333  * The #GType for a boxed type holding a #GBookmarkFile.
334  *
335  * Since: 2.76
336  */
337 #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type ())
338
339 GOBJECT_AVAILABLE_IN_ALL
340 GType   g_date_get_type            (void) G_GNUC_CONST;
341 GOBJECT_AVAILABLE_IN_ALL
342 GType   g_strv_get_type            (void) G_GNUC_CONST;
343 GOBJECT_AVAILABLE_IN_ALL
344 GType   g_gstring_get_type         (void) G_GNUC_CONST;
345 GOBJECT_AVAILABLE_IN_ALL
346 GType   g_hash_table_get_type      (void) G_GNUC_CONST;
347 GOBJECT_AVAILABLE_IN_ALL
348 GType   g_array_get_type           (void) G_GNUC_CONST;
349 GOBJECT_AVAILABLE_IN_ALL
350 GType   g_byte_array_get_type      (void) G_GNUC_CONST;
351 GOBJECT_AVAILABLE_IN_ALL
352 GType   g_ptr_array_get_type       (void) G_GNUC_CONST;
353 GOBJECT_AVAILABLE_IN_ALL
354 GType   g_bytes_get_type           (void) G_GNUC_CONST;
355 GOBJECT_AVAILABLE_IN_ALL
356 GType   g_variant_type_get_gtype   (void) G_GNUC_CONST;
357 GOBJECT_AVAILABLE_IN_ALL
358 GType   g_regex_get_type           (void) G_GNUC_CONST;
359 GOBJECT_AVAILABLE_IN_2_30
360 GType   g_match_info_get_type      (void) G_GNUC_CONST;
361 GOBJECT_AVAILABLE_IN_ALL
362 GType   g_error_get_type           (void) G_GNUC_CONST;
363 GOBJECT_AVAILABLE_IN_ALL
364 GType   g_date_time_get_type       (void) G_GNUC_CONST;
365 GOBJECT_AVAILABLE_IN_ALL
366 GType   g_time_zone_get_type       (void) G_GNUC_CONST;
367 GOBJECT_AVAILABLE_IN_ALL
368 GType   g_io_channel_get_type      (void) G_GNUC_CONST;
369 GOBJECT_AVAILABLE_IN_ALL
370 GType   g_io_condition_get_type    (void) G_GNUC_CONST;
371 GOBJECT_AVAILABLE_IN_ALL
372 GType   g_variant_builder_get_type (void) G_GNUC_CONST;
373 GOBJECT_AVAILABLE_IN_2_40
374 GType   g_variant_dict_get_type    (void) G_GNUC_CONST;
375 GOBJECT_AVAILABLE_IN_ALL
376 GType   g_key_file_get_type        (void) G_GNUC_CONST;
377 GOBJECT_AVAILABLE_IN_2_30
378 GType   g_main_loop_get_type       (void) G_GNUC_CONST;
379 GOBJECT_AVAILABLE_IN_2_30
380 GType   g_main_context_get_type    (void) G_GNUC_CONST;
381 GOBJECT_AVAILABLE_IN_2_30
382 GType   g_source_get_type          (void) G_GNUC_CONST;
383 GOBJECT_AVAILABLE_IN_2_36
384 GType   g_pollfd_get_type          (void) G_GNUC_CONST;
385 GOBJECT_AVAILABLE_IN_2_36
386 GType   g_thread_get_type          (void) G_GNUC_CONST;
387 GOBJECT_AVAILABLE_IN_2_36
388 GType   g_checksum_get_type        (void) G_GNUC_CONST;
389 GOBJECT_AVAILABLE_IN_2_36
390 GType   g_markup_parse_context_get_type (void) G_GNUC_CONST;
391 GOBJECT_AVAILABLE_IN_2_40
392 GType   g_mapped_file_get_type (void) G_GNUC_CONST;
393 GOBJECT_AVAILABLE_IN_2_44
394 GType   g_option_group_get_type    (void) G_GNUC_CONST;
395 GOBJECT_AVAILABLE_IN_2_66
396 GType   g_uri_get_type             (void) G_GNUC_CONST;
397 GOBJECT_AVAILABLE_IN_2_68
398 GType   g_tree_get_type            (void) G_GNUC_CONST;
399 GOBJECT_AVAILABLE_IN_2_70
400 GType g_pattern_spec_get_type (void) G_GNUC_CONST;
401 GOBJECT_AVAILABLE_IN_2_76
402 GType   g_bookmark_file_get_type   (void) G_GNUC_CONST;
403
404 GOBJECT_DEPRECATED_FOR('G_TYPE_VARIANT')
405 GType   g_variant_get_gtype        (void) G_GNUC_CONST;
406
407 G_END_DECLS
408
409 #endif  /* __GLIB_TYPES_H__ */