]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkrecentmanager.sgml
2.9.1
[~andy/gtk] / docs / reference / gtk / tmpl / gtkrecentmanager.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkRecentManager
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Managing Recently Used Files
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GtkRecentManager provides a facility for adding, removing and
10 looking up recently used files.  Each recently used file is
11 identified by its URI, and has meta-data associated to it, like
12 the names and command lines of the applications that have
13 registered it, the number of time each application has registered
14 the same file, the mime type of the file and whether the file
15 should be displayed only by the applications that have
16 registered it.
17 </para>
18
19 <para>
20 The #GtkRecentManager acts like a database of all the recently
21 used files.  You can create new #GtkRecentManager objects, but
22 it is more efficient to use the standard recent manager for
23 the #GdkScreen so that informations about the recently used
24 files is shared with other people using them.  In case the
25 default screen is being used, adding a new recently used
26 file is as simple as:
27 </para>
28
29 <informalexample>
30   <programlisting>
31 GtkRecentManager *manager;
32
33 manager = gtk_recent_manager_get_default ();
34 gtk_recent_manager_add_item (manager, file_uri);
35   </programlisting>
36 </informalexample>
37
38 While looking up a recently used file is as simple as:
39
40 <informalexample>
41   <programlisting>
42 GtkRecentManager *manager;
43 GtkRecentInfo *info;
44 GError *error = NULL;
45
46 manager = gtk_recent_manager_get_default ();
47 info = gtk_recent_manager_lookup_item (manager, file_uri, &amp;error);
48 if (error)
49   {
50     g_warning ("Could not find the file: &percnt;s", error-&gt;message);
51     g_error_free (error);
52   }
53 else
54   {
55     /* Use the info object */
56     g_object_unref (info);
57   }
58   </programlisting>
59 </informalexample>
60
61 <para>
62 Recently used files are supported since GTK+ 2.10.
63 </para>
64
65 <!-- ##### SECTION See_Also ##### -->
66 <para>
67
68 </para>
69
70 <!-- ##### SECTION Stability_Level ##### -->
71
72
73 <!-- ##### STRUCT GtkRecentManager ##### -->
74 <para>
75 Acts as a database of information about the list of recently
76 used files.  Normally, you retrieve the recent manager for a
77 particular screen using gtk_recent_manager_get_for_screen()
78 and it will contain information about current recent manager
79 for that screen.</para>
80
81
82 <!-- ##### STRUCT GtkRecentInfo ##### -->
83 <para>
84 Contains informations found when looking up an entry of the
85 recently used files list.
86 </para>
87
88
89 <!-- ##### STRUCT GtkRecentData ##### -->
90 <para>
91 Meta-data passed to gtk_recent_manager_add_full().  You should
92 use #GtkRecentData if you want to control the meta-data associated
93 to an entry of the recently used files list when you are adding
94 a new file to it.
95 </para>
96
97 @display_name: the string to be used when displaying the file
98   inside a #GtkRecentChooser
99 @description: a user readable description of the file
100 @mime_type: the mime type of the file
101 @app_name: the name of the application that is registering
102   the file
103 @app_exec: the command line that should be used when launching
104   the file
105 @groups: the list of group names to which the file belongs to
106 @is_private: whether the file should be displayed only by
107   the applications that have registered it
108
109 <!-- ##### MACRO GTK_RECENT_MANAGER_ERROR ##### -->
110 <para>
111 The #GQuark used for #GtkRecentManagerError errors.
112 </para>
113
114
115
116 <!-- ##### ENUM GtkRecentManagerError ##### -->
117 <para>
118
119 </para>
120
121 @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: 
122 @GTK_RECENT_MANAGER_ERROR_INVALID_URI: 
123 @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: 
124 @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: 
125 @GTK_RECENT_MANAGER_ERROR_READ: 
126 @GTK_RECENT_MANAGER_ERROR_WRITE: 
127 @GTK_RECENT_MANAGER_ERROR_UNKNOWN: 
128
129 <!-- ##### FUNCTION gtk_recent_manager_new ##### -->
130 <para>
131
132 </para>
133
134 @Returns: 
135
136
137 <!-- ##### FUNCTION gtk_recent_manager_get_default ##### -->
138 <para>
139
140 </para>
141
142 @Returns: 
143
144
145 <!-- ##### FUNCTION gtk_recent_manager_get_for_screen ##### -->
146 <para>
147
148 </para>
149
150 @screen: 
151 @Returns: 
152
153
154 <!-- ##### FUNCTION gtk_recent_manager_set_screen ##### -->
155 <para>
156
157 </para>
158
159 @manager: 
160 @screen: 
161
162
163 <!-- ##### FUNCTION gtk_recent_manager_add_item ##### -->
164 <para>
165
166 </para>
167
168 @manager: 
169 @uri: 
170 @Returns: 
171
172
173 <!-- ##### FUNCTION gtk_recent_manager_add_full ##### -->
174 <para>
175
176 </para>
177
178 @manager: 
179 @uri: 
180 @recent_data: 
181 @Returns: 
182
183
184 <!-- ##### FUNCTION gtk_recent_manager_remove_item ##### -->
185 <para>
186
187 </para>
188
189 @manager: 
190 @uri: 
191 @error: 
192 @Returns: 
193
194
195 <!-- ##### FUNCTION gtk_recent_manager_lookup_item ##### -->
196 <para>
197
198 </para>
199
200 @manager: 
201 @uri: 
202 @error: 
203 @Returns: 
204
205
206 <!-- ##### FUNCTION gtk_recent_manager_has_item ##### -->
207 <para>
208
209 </para>
210
211 @manager: 
212 @uri: 
213 @Returns: 
214
215
216 <!-- ##### FUNCTION gtk_recent_manager_move_item ##### -->
217 <para>
218
219 </para>
220
221 @manager: 
222 @uri: 
223 @new_uri: 
224 @error: 
225 @Returns: 
226
227
228 <!-- ##### FUNCTION gtk_recent_manager_get_limit ##### -->
229 <para>
230
231 </para>
232
233 @manager: 
234 @Returns: 
235
236
237 <!-- ##### FUNCTION gtk_recent_manager_set_limit ##### -->
238 <para>
239
240 </para>
241
242 @manager: 
243 @limit: 
244
245
246 <!-- ##### FUNCTION gtk_recent_manager_get_items ##### -->
247 <para>
248
249 </para>
250
251 @manager: 
252 @Returns: 
253
254
255 <!-- ##### FUNCTION gtk_recent_manager_purge_items ##### -->
256 <para>
257
258 </para>
259
260 @manager: 
261 @error: 
262 @Returns: 
263
264
265 <!-- ##### FUNCTION gtk_recent_info_ref ##### -->
266 <para>
267
268 </para>
269
270 @info: 
271 @Returns: 
272
273
274 <!-- ##### FUNCTION gtk_recent_info_unref ##### -->
275 <para>
276
277 </para>
278
279 @info: 
280
281
282 <!-- ##### FUNCTION gtk_recent_info_get_uri ##### -->
283 <para>
284
285 </para>
286
287 @info: 
288 @Returns: 
289
290
291 <!-- ##### FUNCTION gtk_recent_info_get_display_name ##### -->
292 <para>
293
294 </para>
295
296 @info: 
297 @Returns: 
298
299
300 <!-- ##### FUNCTION gtk_recent_info_get_description ##### -->
301 <para>
302
303 </para>
304
305 @info: 
306 @Returns: 
307
308
309 <!-- ##### FUNCTION gtk_recent_info_get_mime_type ##### -->
310 <para>
311
312 </para>
313
314 @info: 
315 @Returns: 
316
317
318 <!-- ##### FUNCTION gtk_recent_info_get_added ##### -->
319 <para>
320
321 </para>
322
323 @info: 
324 @Returns: 
325
326
327 <!-- ##### FUNCTION gtk_recent_info_get_modified ##### -->
328 <para>
329
330 </para>
331
332 @info: 
333 @Returns: 
334
335
336 <!-- ##### FUNCTION gtk_recent_info_get_visited ##### -->
337 <para>
338
339 </para>
340
341 @info: 
342 @Returns: 
343
344
345 <!-- ##### FUNCTION gtk_recent_info_get_private_hint ##### -->
346 <para>
347
348 </para>
349
350 @info: 
351 @Returns: 
352
353
354 <!-- ##### FUNCTION gtk_recent_info_get_application_info ##### -->
355 <para>
356
357 </para>
358
359 @info: 
360 @app_name: 
361 @app_exec: 
362 @count: 
363 @time: 
364 @Returns: 
365
366
367 <!-- ##### FUNCTION gtk_recent_info_get_applications ##### -->
368 <para>
369
370 </para>
371
372 @info: 
373 @length: 
374 @Returns: 
375
376
377 <!-- ##### FUNCTION gtk_recent_info_last_application ##### -->
378 <para>
379
380 </para>
381
382 @info: 
383 @Returns: 
384
385
386 <!-- ##### FUNCTION gtk_recent_info_get_groups ##### -->
387 <para>
388
389 </para>
390
391 @info: 
392 @length: 
393 @Returns: 
394
395
396 <!-- ##### FUNCTION gtk_recent_info_has_group ##### -->
397 <para>
398
399 </para>
400
401 @info: 
402 @group_name: 
403 @Returns: 
404
405
406 <!-- ##### FUNCTION gtk_recent_info_has_application ##### -->
407 <para>
408
409 </para>
410
411 @info: 
412 @app_name: 
413 @Returns: 
414
415
416 <!-- ##### FUNCTION gtk_recent_info_get_icon ##### -->
417 <para>
418
419 </para>
420
421 @info: 
422 @size: 
423 @Returns: 
424
425
426 <!-- ##### FUNCTION gtk_recent_info_get_short_name ##### -->
427 <para>
428
429 </para>
430
431 @info: 
432 @Returns: 
433
434
435 <!-- ##### FUNCTION gtk_recent_info_get_uri_display ##### -->
436 <para>
437
438 </para>
439
440 @info: 
441 @Returns: 
442
443
444 <!-- ##### FUNCTION gtk_recent_info_get_age ##### -->
445 <para>
446
447 </para>
448
449 @info: 
450 @Returns: 
451
452
453 <!-- ##### FUNCTION gtk_recent_info_is_local ##### -->
454 <para>
455
456 </para>
457
458 @info: 
459 @Returns: 
460
461
462 <!-- ##### FUNCTION gtk_recent_info_exists ##### -->
463 <para>
464
465 </para>
466
467 @info: 
468 @Returns: 
469
470
471 <!-- ##### FUNCTION gtk_recent_info_match ##### -->
472 <para>
473
474 </para>
475
476 @info_a: 
477 @info_b: 
478 @Returns: 
479
480