gdkcontentformats.h 6.21 KB
Newer Older
Benjamin Otte's avatar
Benjamin Otte committed
1
/* GTK - The GIMP Toolkit
2
 * Copyright (C) 2017 Benjamin Otte
Benjamin Otte's avatar
Benjamin Otte committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __GTK_CONTENT_FORMATS_H__
#define __GTK_CONTENT_FORMATS_H__

21
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
Benjamin Otte's avatar
Benjamin Otte committed
22
23
24
25
26
27
28
29
30
#error "Only <gdk/gdk.h> can be included directly."
#endif


#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>

G_BEGIN_DECLS

31
#define GDK_TYPE_CONTENT_FORMATS    (gdk_content_formats_get_type ())
Benjamin Otte's avatar
Benjamin Otte committed
32

Matthias Clasen's avatar
Matthias Clasen committed
33
GDK_AVAILABLE_IN_ALL
34
35
const char *            gdk_intern_mime_type                    (const char                     *string);

Matthias Clasen's avatar
Matthias Clasen committed
36
GDK_AVAILABLE_IN_ALL
37
GType                   gdk_content_formats_get_type            (void) G_GNUC_CONST;
Matthias Clasen's avatar
Matthias Clasen committed
38
GDK_AVAILABLE_IN_ALL
39
40
GdkContentFormats *     gdk_content_formats_new                 (const char                    **mime_types,
                                                                 guint                           n_mime_types);
Matthias Clasen's avatar
Matthias Clasen committed
41
GDK_AVAILABLE_IN_ALL
42
GdkContentFormats *     gdk_content_formats_new_for_gtype       (GType                           type);
43
44
GDK_AVAILABLE_IN_4_4
GdkContentFormats *     gdk_content_formats_parse               (const char                     *string);
Matthias Clasen's avatar
Matthias Clasen committed
45
GDK_AVAILABLE_IN_ALL
46
GdkContentFormats *     gdk_content_formats_ref                 (GdkContentFormats              *formats);
Matthias Clasen's avatar
Matthias Clasen committed
47
GDK_AVAILABLE_IN_ALL
48
void                    gdk_content_formats_unref               (GdkContentFormats              *formats);
Benjamin Otte's avatar
Benjamin Otte committed
49

Matthias Clasen's avatar
Matthias Clasen committed
50
GDK_AVAILABLE_IN_ALL
51
52
void                    gdk_content_formats_print               (GdkContentFormats              *formats,
                                                                 GString                        *string);
Matthias Clasen's avatar
Matthias Clasen committed
53
GDK_AVAILABLE_IN_ALL
54
55
char *                  gdk_content_formats_to_string           (GdkContentFormats              *formats);

Matthias Clasen's avatar
Matthias Clasen committed
56
GDK_AVAILABLE_IN_ALL
57
const GType *           gdk_content_formats_get_gtypes          (const GdkContentFormats        *formats,
58
                                                                 gsize                          *n_gtypes);
Matthias Clasen's avatar
Matthias Clasen committed
59
GDK_AVAILABLE_IN_ALL
60
const char * const *    gdk_content_formats_get_mime_types      (const GdkContentFormats        *formats,
61
62
                                                                 gsize                          *n_mime_types);

Matthias Clasen's avatar
Matthias Clasen committed
63
GDK_AVAILABLE_IN_ALL
64
65
GdkContentFormats *     gdk_content_formats_union               (GdkContentFormats              *first,
                                                                 const GdkContentFormats        *second) G_GNUC_WARN_UNUSED_RESULT;
Matthias Clasen's avatar
Matthias Clasen committed
66
GDK_AVAILABLE_IN_ALL
67
gboolean                gdk_content_formats_match               (const GdkContentFormats        *first,
68
                                                                 const GdkContentFormats        *second);
Matthias Clasen's avatar
Matthias Clasen committed
69
GDK_AVAILABLE_IN_ALL
70
71
GType                   gdk_content_formats_match_gtype         (const GdkContentFormats        *first,
                                                                 const GdkContentFormats        *second);
Matthias Clasen's avatar
Matthias Clasen committed
72
GDK_AVAILABLE_IN_ALL
73
74
const char *            gdk_content_formats_match_mime_type     (const GdkContentFormats        *first,
                                                                 const GdkContentFormats        *second);
Matthias Clasen's avatar
Matthias Clasen committed
75
GDK_AVAILABLE_IN_ALL
76
77
gboolean                gdk_content_formats_contain_gtype       (const GdkContentFormats        *formats,
                                                                 GType                           type);
Matthias Clasen's avatar
Matthias Clasen committed
78
GDK_AVAILABLE_IN_ALL
79
gboolean                gdk_content_formats_contain_mime_type   (const GdkContentFormats        *formats,
80
                                                                 const char                     *mime_type);
Benjamin Otte's avatar
Benjamin Otte committed
81

82
83
#define GDK_TYPE_CONTENT_FORMATS_BUILDER (gdk_content_formats_builder_get_type ())

84
85
typedef struct _GdkContentFormatsBuilder GdkContentFormatsBuilder;

Matthias Clasen's avatar
Matthias Clasen committed
86
GDK_AVAILABLE_IN_ALL
87
88
GType                   gdk_content_formats_builder_get_type    (void) G_GNUC_CONST;

Matthias Clasen's avatar
Matthias Clasen committed
89
GDK_AVAILABLE_IN_ALL
90
GdkContentFormatsBuilder *gdk_content_formats_builder_new        (void);
Matthias Clasen's avatar
Matthias Clasen committed
91
GDK_AVAILABLE_IN_ALL
92
GdkContentFormatsBuilder *gdk_content_formats_builder_ref       (GdkContentFormatsBuilder       *builder);
Matthias Clasen's avatar
Matthias Clasen committed
93
GDK_AVAILABLE_IN_ALL
94
void                    gdk_content_formats_builder_unref       (GdkContentFormatsBuilder       *builder);
Matthias Clasen's avatar
Matthias Clasen committed
95
GDK_AVAILABLE_IN_ALL
96
GdkContentFormats *     gdk_content_formats_builder_free_to_formats (GdkContentFormatsBuilder  *builder) G_GNUC_WARN_UNUSED_RESULT;
Matthias Clasen's avatar
Matthias Clasen committed
97
GDK_AVAILABLE_IN_ALL
98
GdkContentFormats *     gdk_content_formats_builder_to_formats  (GdkContentFormatsBuilder  *builder) G_GNUC_WARN_UNUSED_RESULT;
Matthias Clasen's avatar
Matthias Clasen committed
99
GDK_AVAILABLE_IN_ALL
100
void                    gdk_content_formats_builder_add_formats (GdkContentFormatsBuilder       *builder,
101
                                                                 const GdkContentFormats        *formats);
Matthias Clasen's avatar
Matthias Clasen committed
102
GDK_AVAILABLE_IN_ALL
103
104
void                    gdk_content_formats_builder_add_mime_type(GdkContentFormatsBuilder      *builder,
                                                                 const char                     *mime_type);
Matthias Clasen's avatar
Matthias Clasen committed
105
GDK_AVAILABLE_IN_ALL
106
107
void                    gdk_content_formats_builder_add_gtype   (GdkContentFormatsBuilder       *builder,
                                                                 GType                           type);
108

109
110
/* dunno where else to put this */
#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
Matthias Clasen's avatar
Matthias Clasen committed
111
GDK_AVAILABLE_IN_ALL
Emmanuele Bassi's avatar
Emmanuele Bassi committed
112
GType gdk_file_list_get_type (void) G_GNUC_CONST;
113

Emmanuele Bassi's avatar
Emmanuele Bassi committed
114
115
116
117
118
119
120
121
122
123
124
/**
 * GdkFileList:
 *
 * An opaque type representing a list of files.
 *
 * Since: 4.6
 */
typedef struct _GdkFileList GdkFileList;

GDK_AVAILABLE_IN_4_6
GSList *        gdk_file_list_get_files (GdkFileList *file_list);
125

Benjamin Otte's avatar
Benjamin Otte committed
126
127
128
G_END_DECLS

#endif /* __GTK_CONTENT_FORMATS_H__ */