summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkfilefilter.sgml
blob: 34cc4d8f5897c64f4370f0a5c33b1ea0a41954ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!-- ##### SECTION Title ##### -->
GtkFileFilter

<!-- ##### SECTION Short_Description ##### -->
A filter for selecting a file subset

<!-- ##### SECTION Long_Description ##### -->
<para>
A GtkFileFilter can be used to restrict the files being shown
in a #GtkFileChooser. Files can be filtered based on their name
(with gtk_file_filter_add_pattern()), on their mime type (with
gtk_file_filter_add_mime_type()), or by a custom filter function
(with gtk_file_filter_add_custom()). 
</para>

<para>
Filtering by mime types handles aliasing and subclassing of mime
types; e.g. a filter for text/plain also matches a file with mime 
type application/rtf, since application/rtf is a subclass of 
text/plain. Note that #GtkFileFilter allows wildcards for the 
subtype of a mime type, so you can e.g. filter for image/*.
</para>

<para>
Normally, filters are used by adding them to a #GtkFileChooser,
see gtk_file_chooser_add_filter(), but it is also possible
to manually use a filter on a file with gtk_file_filter_filter().
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#GtkFileChooser
</para>

<!-- ##### STRUCT GtkFileFilter ##### -->
<para>
The <structname>GtkFileFilter</structname> struct contains
only private fields and should not be directly accessed.
</para>


<!-- ##### STRUCT GtkFileFilterInfo ##### -->
<para>
A <structname>GtkFileFilterInfo</structname> struct is used
to pass information about the tested file to 
gtk_file_filter_filter(). 
</para>

@contains: Flags indicating which of the following fields need
  are filled
@filename: the filename of the file being tested
@uri: the URI for the file being tested
@display_name: the string that will be used to display the file
  in the file chooser
@mime_type: the mime type of the file

<!-- ##### ENUM GtkFileFilterFlags ##### -->
<para>
These flags indicate what parts of a #GtkFileFilterInfo struct
are filled or need to be filled. 
</para>

@GTK_FILE_FILTER_FILENAME: the filename of the file being tested
@GTK_FILE_FILTER_URI: the URI for the file being tested
@GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to 
  display the file in the file chooser
@GTK_FILE_FILTER_MIME_TYPE: the mime type of the file

<!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
<para>
The type of function that is used with custom filters,
see gtk_file_filter_add_custom().
</para>

@filter_info: a #GtkFileFilterInfo that is filled according
  to the @needed flags passed to gtk_file_filter_add_custom()
@data: user data passed to gtk_file_filter_add_custom()
@Returns: %TRUE if the file should be displayed


<!-- ##### FUNCTION gtk_file_filter_new ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
<para>

</para>

@filter: 
@name: 


<!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
<para>

</para>

@filter: 
@Returns: 


<!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
<para>

</para>

@filter: 
@mime_type: 


<!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
<para>

</para>

@filter: 
@pattern: 


<!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
<para>

</para>

@filter: 


<!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
<para>

</para>

@filter: 
@needed: 
@func: 
@data: 
@notify: 


<!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
<para>

</para>

@filter: 
@Returns: 


<!-- ##### FUNCTION gtk_file_filter_filter ##### -->
<para>

</para>

@filter: 
@filter_info: 
@Returns: