1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A filter for selecting a file subset
7 <!-- ##### SECTION Long_Description ##### -->
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()).
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/*.
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().
30 <!-- ##### SECTION See_Also ##### -->
35 <!-- ##### SECTION Stability_Level ##### -->
38 <!-- ##### STRUCT GtkFileFilter ##### -->
40 The <structname>GtkFileFilter</structname> struct contains
41 only private fields and should not be directly accessed.
45 <!-- ##### STRUCT GtkFileFilterInfo ##### -->
47 A <structname>GtkFileFilterInfo</structname> struct is used
48 to pass information about the tested file to
49 gtk_file_filter_filter().
52 @contains: Flags indicating which of the following fields need
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
58 @mime_type: the mime type of the file
60 <!-- ##### ENUM GtkFileFilterFlags ##### -->
62 These flags indicate what parts of a #GtkFileFilterInfo struct
63 are filled or need to be filled.
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
72 <!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
74 The type of function that is used with custom filters,
75 see gtk_file_filter_add_custom().
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
84 <!-- ##### FUNCTION gtk_file_filter_new ##### -->
92 <!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
101 <!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
110 <!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
119 <!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
128 <!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
136 <!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
148 <!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
157 <!-- ##### FUNCTION gtk_file_filter_filter ##### -->