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