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 <!-- ##### SECTION Image ##### -->
41 <!-- ##### STRUCT GtkFileFilter ##### -->
43 The <structname>GtkFileFilter</structname> struct contains
44 only private fields and should not be directly accessed.
48 <!-- ##### STRUCT GtkFileFilterInfo ##### -->
50 A <structname>GtkFileFilterInfo</structname> struct is used
51 to pass information about the tested file to
52 gtk_file_filter_filter().
55 @contains: Flags indicating which of the following fields need
57 @filename: the filename of the file being tested
58 @uri: the URI for the file being tested
59 @display_name: the string that will be used to display the file
61 @mime_type: the mime type of the file
63 <!-- ##### ENUM GtkFileFilterFlags ##### -->
65 These flags indicate what parts of a #GtkFileFilterInfo struct
66 are filled or need to be filled.
69 @GTK_FILE_FILTER_FILENAME: the filename of the file being tested
70 @GTK_FILE_FILTER_URI: the URI for the file being tested
71 @GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to
72 display the file in the file chooser
73 @GTK_FILE_FILTER_MIME_TYPE: the mime type of the file
75 <!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
77 The type of function that is used with custom filters,
78 see gtk_file_filter_add_custom().
81 @filter_info: a #GtkFileFilterInfo that is filled according
82 to the @needed flags passed to gtk_file_filter_add_custom()
83 @data: user data passed to gtk_file_filter_add_custom()
84 @Returns: %TRUE if the file should be displayed
87 <!-- ##### FUNCTION gtk_file_filter_new ##### -->
96 <!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
105 <!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
114 <!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
123 <!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
132 <!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
140 <!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
152 <!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
161 <!-- ##### FUNCTION gtk_file_filter_filter ##### -->