1/* GTK - The GIMP Toolkit
2 * Copyright (C) 2017 Benjamin Otte
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_CONTENT_FORMATS_H__
19#define __GTK_CONTENT_FORMATS_H__
20
21#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
22#error "Only <gdk/gdk.h> can be included directly."
23#endif
24
25
26#include <gdk/gdkversionmacros.h>
27#include <gdk/gdktypes.h>
28
29G_BEGIN_DECLS
30
31#define GDK_TYPE_CONTENT_FORMATS (gdk_content_formats_get_type ())
32
33GDK_AVAILABLE_IN_ALL
34const char * gdk_intern_mime_type (const char *string);
35
36GDK_AVAILABLE_IN_ALL
37GType gdk_content_formats_get_type (void) G_GNUC_CONST;
38GDK_AVAILABLE_IN_ALL
39GdkContentFormats * gdk_content_formats_new (const char **mime_types,
40 guint n_mime_types);
41GDK_AVAILABLE_IN_ALL
42GdkContentFormats * gdk_content_formats_new_for_gtype (GType type);
43GDK_AVAILABLE_IN_4_4
44GdkContentFormats * gdk_content_formats_parse (const char *string);
45GDK_AVAILABLE_IN_ALL
46GdkContentFormats * gdk_content_formats_ref (GdkContentFormats *formats);
47GDK_AVAILABLE_IN_ALL
48void gdk_content_formats_unref (GdkContentFormats *formats);
49
50GDK_AVAILABLE_IN_ALL
51void gdk_content_formats_print (GdkContentFormats *formats,
52 GString *string);
53GDK_AVAILABLE_IN_ALL
54char * gdk_content_formats_to_string (GdkContentFormats *formats);
55
56GDK_AVAILABLE_IN_ALL
57const GType * gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
58 gsize *n_gtypes);
59GDK_AVAILABLE_IN_ALL
60const char * const * gdk_content_formats_get_mime_types (const GdkContentFormats *formats,
61 gsize *n_mime_types);
62
63GDK_AVAILABLE_IN_ALL
64GdkContentFormats * gdk_content_formats_union (GdkContentFormats *first,
65 const GdkContentFormats *second) G_GNUC_WARN_UNUSED_RESULT;
66GDK_AVAILABLE_IN_ALL
67gboolean gdk_content_formats_match (const GdkContentFormats *first,
68 const GdkContentFormats *second);
69GDK_AVAILABLE_IN_ALL
70GType gdk_content_formats_match_gtype (const GdkContentFormats *first,
71 const GdkContentFormats *second);
72GDK_AVAILABLE_IN_ALL
73const char * gdk_content_formats_match_mime_type (const GdkContentFormats *first,
74 const GdkContentFormats *second);
75GDK_AVAILABLE_IN_ALL
76gboolean gdk_content_formats_contain_gtype (const GdkContentFormats *formats,
77 GType type);
78GDK_AVAILABLE_IN_ALL
79gboolean gdk_content_formats_contain_mime_type (const GdkContentFormats *formats,
80 const char *mime_type);
81
82#define GDK_TYPE_CONTENT_FORMATS_BUILDER (gdk_content_formats_builder_get_type ())
83
84typedef struct _GdkContentFormatsBuilder GdkContentFormatsBuilder;
85
86GDK_AVAILABLE_IN_ALL
87GType gdk_content_formats_builder_get_type (void) G_GNUC_CONST;
88
89GDK_AVAILABLE_IN_ALL
90GdkContentFormatsBuilder *gdk_content_formats_builder_new (void);
91GDK_AVAILABLE_IN_ALL
92GdkContentFormatsBuilder *gdk_content_formats_builder_ref (GdkContentFormatsBuilder *builder);
93GDK_AVAILABLE_IN_ALL
94void gdk_content_formats_builder_unref (GdkContentFormatsBuilder *builder);
95GDK_AVAILABLE_IN_ALL
96GdkContentFormats * gdk_content_formats_builder_free_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT;
97GDK_AVAILABLE_IN_ALL
98GdkContentFormats * gdk_content_formats_builder_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT;
99GDK_AVAILABLE_IN_ALL
100void gdk_content_formats_builder_add_formats (GdkContentFormatsBuilder *builder,
101 const GdkContentFormats *formats);
102GDK_AVAILABLE_IN_ALL
103void gdk_content_formats_builder_add_mime_type(GdkContentFormatsBuilder *builder,
104 const char *mime_type);
105GDK_AVAILABLE_IN_ALL
106void gdk_content_formats_builder_add_gtype (GdkContentFormatsBuilder *builder,
107 GType type);
108
109/* dunno where else to put this */
110#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
111GDK_AVAILABLE_IN_ALL
112GType gdk_file_list_get_type (void) G_GNUC_CONST;
113
114/**
115 * GdkFileList:
116 *
117 * An opaque type representing a list of files.
118 *
119 * Since: 4.6
120 */
121typedef struct _GdkFileList GdkFileList;
122
123GDK_AVAILABLE_IN_4_6
124GSList * gdk_file_list_get_files (GdkFileList *file_list);
125
126G_END_DECLS
127
128#endif /* __GTK_CONTENT_FORMATS_H__ */
129

source code of gtk/gdk/gdkcontentformats.h