]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkrecentmanager.sgml
Update the error enum and the gtk_recent_manager_add and
[~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_MIME: 
124 @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: 
125 @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: 
126 @GTK_RECENT_MANAGER_ERROR_READ: 
127 @GTK_RECENT_MANAGER_ERROR_WRITE: 
128 @GTK_RECENT_MANAGER_ERROR_UNKNOWN: 
129
130 <!-- ##### FUNCTION gtk_recent_manager_new ##### -->
131 <para>
132
133 </para>
134
135 @Returns: 
136
137
138 <!-- ##### FUNCTION gtk_recent_manager_get_default ##### -->
139 <para>
140
141 </para>
142
143 @Returns: 
144
145
146 <!-- ##### FUNCTION gtk_recent_manager_get_for_screen ##### -->
147 <para>
148
149 </para>
150
151 @screen: 
152 @Returns: 
153
154
155 <!-- ##### FUNCTION gtk_recent_manager_set_screen ##### -->
156 <para>
157
158 </para>
159
160 @manager: 
161 @screen: 
162
163
164 <!-- ##### FUNCTION gtk_recent_manager_add_item ##### -->
165 <para>
166
167 </para>
168
169 @manager: 
170 @uri: 
171 @Returns: 
172
173
174 <!-- ##### FUNCTION gtk_recent_manager_add_full ##### -->
175 <para>
176
177 </para>
178
179 @manager: 
180 @uri: 
181 @recent_data: 
182 @Returns: 
183
184
185 <!-- ##### FUNCTION gtk_recent_manager_remove_item ##### -->
186 <para>
187
188 </para>
189
190 @manager: 
191 @uri: 
192 @error: 
193 @Returns: 
194
195
196 <!-- ##### FUNCTION gtk_recent_manager_lookup_item ##### -->
197 <para>
198
199 </para>
200
201 @manager: 
202 @uri: 
203 @error: 
204 @Returns: 
205
206
207 <!-- ##### FUNCTION gtk_recent_manager_has_item ##### -->
208 <para>
209
210 </para>
211
212 @manager: 
213 @uri: 
214 @Returns: 
215
216
217 <!-- ##### FUNCTION gtk_recent_manager_move_item ##### -->
218 <para>
219
220 </para>
221
222 @manager: 
223 @uri: 
224 @new_uri: 
225 @error: 
226 @Returns: 
227
228
229 <!-- ##### FUNCTION gtk_recent_manager_get_limit ##### -->
230 <para>
231
232 </para>
233
234 @manager: 
235 @Returns: 
236
237
238 <!-- ##### FUNCTION gtk_recent_manager_set_limit ##### -->
239 <para>
240
241 </para>
242
243 @manager: 
244 @limit: 
245
246
247 <!-- ##### FUNCTION gtk_recent_manager_get_items ##### -->
248 <para>
249
250 </para>
251
252 @manager: 
253 @Returns: 
254
255
256 <!-- ##### FUNCTION gtk_recent_manager_purge_items ##### -->
257 <para>
258
259 </para>
260
261 @manager: 
262 @error: 
263 @Returns: 
264
265
266 <!-- ##### FUNCTION gtk_recent_info_ref ##### -->
267 <para>
268
269 </para>
270
271 @info: 
272 @Returns: 
273
274
275 <!-- ##### FUNCTION gtk_recent_info_unref ##### -->
276 <para>
277
278 </para>
279
280 @info: 
281
282
283 <!-- ##### FUNCTION gtk_recent_info_get_uri ##### -->
284 <para>
285
286 </para>
287
288 @info: 
289 @Returns: 
290
291
292 <!-- ##### FUNCTION gtk_recent_info_get_display_name ##### -->
293 <para>
294
295 </para>
296
297 @info: 
298 @Returns: 
299
300
301 <!-- ##### FUNCTION gtk_recent_info_get_description ##### -->
302 <para>
303
304 </para>
305
306 @info: 
307 @Returns: 
308
309
310 <!-- ##### FUNCTION gtk_recent_info_get_mime_type ##### -->
311 <para>
312
313 </para>
314
315 @info: 
316 @Returns: 
317
318
319 <!-- ##### FUNCTION gtk_recent_info_get_added ##### -->
320 <para>
321
322 </para>
323
324 @info: 
325 @Returns: 
326
327
328 <!-- ##### FUNCTION gtk_recent_info_get_modified ##### -->
329 <para>
330
331 </para>
332
333 @info: 
334 @Returns: 
335
336
337 <!-- ##### FUNCTION gtk_recent_info_get_visited ##### -->
338 <para>
339
340 </para>
341
342 @info: 
343 @Returns: 
344
345
346 <!-- ##### FUNCTION gtk_recent_info_get_private_hint ##### -->
347 <para>
348
349 </para>
350
351 @info: 
352 @Returns: 
353
354
355 <!-- ##### FUNCTION gtk_recent_info_get_application_info ##### -->
356 <para>
357
358 </para>
359
360 @info: 
361 @app_name: 
362 @app_exec: 
363 @count: 
364 @time: 
365 @Returns: 
366
367
368 <!-- ##### FUNCTION gtk_recent_info_get_applications ##### -->
369 <para>
370
371 </para>
372
373 @info: 
374 @length: 
375 @Returns: 
376
377
378 <!-- ##### FUNCTION gtk_recent_info_last_application ##### -->
379 <para>
380
381 </para>
382
383 @info: 
384 @Returns: 
385
386
387 <!-- ##### FUNCTION gtk_recent_info_get_groups ##### -->
388 <para>
389
390 </para>
391
392 @info: 
393 @length: 
394 @Returns: 
395
396
397 <!-- ##### FUNCTION gtk_recent_info_has_group ##### -->
398 <para>
399
400 </para>
401
402 @info: 
403 @group_name: 
404 @Returns: 
405
406
407 <!-- ##### FUNCTION gtk_recent_info_has_application ##### -->
408 <para>
409
410 </para>
411
412 @info: 
413 @app_name: 
414 @Returns: 
415
416
417 <!-- ##### FUNCTION gtk_recent_info_get_icon ##### -->
418 <para>
419
420 </para>
421
422 @info: 
423 @size: 
424 @Returns: 
425
426
427 <!-- ##### FUNCTION gtk_recent_info_get_short_name ##### -->
428 <para>
429
430 </para>
431
432 @info: 
433 @Returns: 
434
435
436 <!-- ##### FUNCTION gtk_recent_info_get_uri_display ##### -->
437 <para>
438
439 </para>
440
441 @info: 
442 @Returns: 
443
444
445 <!-- ##### FUNCTION gtk_recent_info_get_age ##### -->
446 <para>
447
448 </para>
449
450 @info: 
451 @Returns: 
452
453
454 <!-- ##### FUNCTION gtk_recent_info_is_local ##### -->
455 <para>
456
457 </para>
458
459 @info: 
460 @Returns: 
461
462
463 <!-- ##### FUNCTION gtk_recent_info_exists ##### -->
464 <para>
465
466 </para>
467
468 @info: 
469 @Returns: 
470
471
472 <!-- ##### FUNCTION gtk_recent_info_match ##### -->
473 <para>
474
475 </para>
476
477 @info_a: 
478 @info_b: 
479 @Returns: 
480
481