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 | |
29 | G_BEGIN_DECLS |
30 | |
31 | #define GDK_TYPE_CONTENT_FORMATS (gdk_content_formats_get_type ()) |
32 | |
33 | GDK_AVAILABLE_IN_ALL |
34 | const char * gdk_intern_mime_type (const char *string); |
35 | |
36 | GDK_AVAILABLE_IN_ALL |
37 | GType gdk_content_formats_get_type (void) G_GNUC_CONST; |
38 | GDK_AVAILABLE_IN_ALL |
39 | GdkContentFormats * gdk_content_formats_new (const char **mime_types, |
40 | guint n_mime_types); |
41 | GDK_AVAILABLE_IN_ALL |
42 | GdkContentFormats * gdk_content_formats_new_for_gtype (GType type); |
43 | GDK_AVAILABLE_IN_4_4 |
44 | GdkContentFormats * gdk_content_formats_parse (const char *string); |
45 | GDK_AVAILABLE_IN_ALL |
46 | GdkContentFormats * gdk_content_formats_ref (GdkContentFormats *formats); |
47 | GDK_AVAILABLE_IN_ALL |
48 | void gdk_content_formats_unref (GdkContentFormats *formats); |
49 | |
50 | GDK_AVAILABLE_IN_ALL |
51 | void gdk_content_formats_print (GdkContentFormats *formats, |
52 | GString *string); |
53 | GDK_AVAILABLE_IN_ALL |
54 | char * gdk_content_formats_to_string (GdkContentFormats *formats); |
55 | |
56 | GDK_AVAILABLE_IN_ALL |
57 | const GType * gdk_content_formats_get_gtypes (const GdkContentFormats *formats, |
58 | gsize *n_gtypes); |
59 | GDK_AVAILABLE_IN_ALL |
60 | const char * const * gdk_content_formats_get_mime_types (const GdkContentFormats *formats, |
61 | gsize *n_mime_types); |
62 | |
63 | GDK_AVAILABLE_IN_ALL |
64 | GdkContentFormats * gdk_content_formats_union (GdkContentFormats *first, |
65 | const GdkContentFormats *second) G_GNUC_WARN_UNUSED_RESULT; |
66 | GDK_AVAILABLE_IN_ALL |
67 | gboolean gdk_content_formats_match (const GdkContentFormats *first, |
68 | const GdkContentFormats *second); |
69 | GDK_AVAILABLE_IN_ALL |
70 | GType gdk_content_formats_match_gtype (const GdkContentFormats *first, |
71 | const GdkContentFormats *second); |
72 | GDK_AVAILABLE_IN_ALL |
73 | const char * gdk_content_formats_match_mime_type (const GdkContentFormats *first, |
74 | const GdkContentFormats *second); |
75 | GDK_AVAILABLE_IN_ALL |
76 | gboolean gdk_content_formats_contain_gtype (const GdkContentFormats *formats, |
77 | GType type); |
78 | GDK_AVAILABLE_IN_ALL |
79 | gboolean 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 | |
84 | typedef struct _GdkContentFormatsBuilder GdkContentFormatsBuilder; |
85 | |
86 | GDK_AVAILABLE_IN_ALL |
87 | GType gdk_content_formats_builder_get_type (void) G_GNUC_CONST; |
88 | |
89 | GDK_AVAILABLE_IN_ALL |
90 | GdkContentFormatsBuilder *gdk_content_formats_builder_new (void); |
91 | GDK_AVAILABLE_IN_ALL |
92 | GdkContentFormatsBuilder *gdk_content_formats_builder_ref (GdkContentFormatsBuilder *builder); |
93 | GDK_AVAILABLE_IN_ALL |
94 | void gdk_content_formats_builder_unref (GdkContentFormatsBuilder *builder); |
95 | GDK_AVAILABLE_IN_ALL |
96 | GdkContentFormats * gdk_content_formats_builder_free_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT; |
97 | GDK_AVAILABLE_IN_ALL |
98 | GdkContentFormats * gdk_content_formats_builder_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT; |
99 | GDK_AVAILABLE_IN_ALL |
100 | void gdk_content_formats_builder_add_formats (GdkContentFormatsBuilder *builder, |
101 | const GdkContentFormats *formats); |
102 | GDK_AVAILABLE_IN_ALL |
103 | void gdk_content_formats_builder_add_mime_type(GdkContentFormatsBuilder *builder, |
104 | const char *mime_type); |
105 | GDK_AVAILABLE_IN_ALL |
106 | void 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 ()) |
111 | GDK_AVAILABLE_IN_ALL |
112 | GType 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 | */ |
121 | typedef struct _GdkFileList GdkFileList; |
122 | |
123 | GDK_AVAILABLE_IN_4_6 |
124 | GSList * gdk_file_list_get_files (GdkFileList *file_list); |
125 | |
126 | G_END_DECLS |
127 | |
128 | #endif /* __GTK_CONTENT_FORMATS_H__ */ |
129 | |