]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkfilefilter.sgml
6bc5e54c7eb2bd746cc0304919da9752ad022413
[~andy/gtk] / docs / reference / gtk / tmpl / gtkfilefilter.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkFileFilter
3
4 <!-- ##### SECTION Short_Description ##### -->
5 A filter for selecting a file subset
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 A GtkFileFilter can be used to restrict the files being shown
10 in a #GtkFileChooser. Files can be filtered based on their name
11 (with gtk_file_filter_add_pattern()), on their mime type (with
12 gtk_file_filter_add_mime_type()), or by a custom filter function
13 (with gtk_file_filter_add_custom()). 
14 </para>
15
16 <para>
17 Filtering by mime types handles aliasing and subclassing of mime
18 types; e.g. a filter for text/plain also matches a file with mime 
19 type application/rtf, since application/rtf is a subclass of 
20 text/plain. Note that #GtkFileFilter allows wildcards for the 
21 subtype of a mime type, so you can e.g. filter for image/*.
22 </para>
23
24 <para>
25 Normally, filters are used by adding them to a #GtkFileChooser,
26 see gtk_file_chooser_add_filter(), but it is also possible
27 to manually use a filter on a file with gtk_file_filter_filter().
28 </para>
29
30 <!-- ##### SECTION See_Also ##### -->
31 <para>
32 #GtkFileChooser
33 </para>
34
35 <!-- ##### SECTION Stability_Level ##### -->
36
37
38 <!-- ##### STRUCT GtkFileFilter ##### -->
39 <para>
40 The <structname>GtkFileFilter</structname> struct contains
41 only private fields and should not be directly accessed.
42 </para>
43
44
45 <!-- ##### STRUCT GtkFileFilterInfo ##### -->
46 <para>
47 A <structname>GtkFileFilterInfo</structname> struct is used
48 to pass information about the tested file to 
49 gtk_file_filter_filter(). 
50 </para>
51
52 @contains: Flags indicating which of the following fields need
53   are filled
54 @filename: the filename of the file being tested
55 @uri: the URI for the file being tested
56 @display_name: the string that will be used to display the file
57   in the file chooser
58 @mime_type: the mime type of the file
59
60 <!-- ##### ENUM GtkFileFilterFlags ##### -->
61 <para>
62 These flags indicate what parts of a #GtkFileFilterInfo struct
63 are filled or need to be filled. 
64 </para>
65
66 @GTK_FILE_FILTER_FILENAME: the filename of the file being tested
67 @GTK_FILE_FILTER_URI: the URI for the file being tested
68 @GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to 
69   display the file in the file chooser
70 @GTK_FILE_FILTER_MIME_TYPE: the mime type of the file
71
72 <!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
73 <para>
74 The type of function that is used with custom filters,
75 see gtk_file_filter_add_custom().
76 </para>
77
78 @filter_info: a #GtkFileFilterInfo that is filled according
79   to the @needed flags passed to gtk_file_filter_add_custom()
80 @data: user data passed to gtk_file_filter_add_custom()
81 @Returns: %TRUE if the file should be displayed
82
83
84 <!-- ##### FUNCTION gtk_file_filter_new ##### -->
85 <para>
86
87 </para>
88
89 @Returns: 
90
91
92 <!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
93 <para>
94
95 </para>
96
97 @filter: 
98 @name: 
99
100
101 <!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
102 <para>
103
104 </para>
105
106 @filter: 
107 @Returns: 
108
109
110 <!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
111 <para>
112
113 </para>
114
115 @filter: 
116 @mime_type: 
117
118
119 <!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
120 <para>
121
122 </para>
123
124 @filter: 
125 @pattern: 
126
127
128 <!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
129 <para>
130
131 </para>
132
133 @filter: 
134
135
136 <!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
137 <para>
138
139 </para>
140
141 @filter: 
142 @needed: 
143 @func: 
144 @data: 
145 @notify: 
146
147
148 <!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
149 <para>
150
151 </para>
152
153 @filter: 
154 @Returns: 
155
156
157 <!-- ##### FUNCTION gtk_file_filter_filter ##### -->
158 <para>
159
160 </para>
161
162 @filter: 
163 @filter_info: 
164 @Returns: 
165
166