]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkfilefilter.sgml
Make 3.0 parallel-installable to 2.x
[~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 <!-- ##### SECTION Image ##### -->
39
40
41 <!-- ##### STRUCT GtkFileFilter ##### -->
42 <para>
43 The <structname>GtkFileFilter</structname> struct contains
44 only private fields and should not be directly accessed.
45 </para>
46
47
48 <!-- ##### STRUCT GtkFileFilterInfo ##### -->
49 <para>
50 A <structname>GtkFileFilterInfo</structname> struct is used
51 to pass information about the tested file to 
52 gtk_file_filter_filter(). 
53 </para>
54
55 @contains: Flags indicating which of the following fields need
56   are filled
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
60   in the file chooser
61 @mime_type: the mime type of the file
62
63 <!-- ##### ENUM GtkFileFilterFlags ##### -->
64 <para>
65 These flags indicate what parts of a #GtkFileFilterInfo struct
66 are filled or need to be filled. 
67 </para>
68
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
74
75 <!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
76 <para>
77 The type of function that is used with custom filters,
78 see gtk_file_filter_add_custom().
79 </para>
80
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
85
86
87 <!-- ##### FUNCTION gtk_file_filter_new ##### -->
88 <para>
89
90 </para>
91
92 @void: 
93 @Returns: 
94
95
96 <!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
97 <para>
98
99 </para>
100
101 @filter: 
102 @name: 
103
104
105 <!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
106 <para>
107
108 </para>
109
110 @filter: 
111 @Returns: 
112
113
114 <!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
115 <para>
116
117 </para>
118
119 @filter: 
120 @mime_type: 
121
122
123 <!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
124 <para>
125
126 </para>
127
128 @filter: 
129 @pattern: 
130
131
132 <!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
133 <para>
134
135 </para>
136
137 @filter: 
138
139
140 <!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
141 <para>
142
143 </para>
144
145 @filter: 
146 @needed: 
147 @func: 
148 @data: 
149 @notify: 
150
151
152 <!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
153 <para>
154
155 </para>
156
157 @filter: 
158 @Returns: 
159
160
161 <!-- ##### FUNCTION gtk_file_filter_filter ##### -->
162 <para>
163
164 </para>
165
166 @filter: 
167 @filter_info: 
168 @Returns: 
169
170