gtkrecentmanager.sgml 7.25 KB
Newer Older
1
2
3
4
<!-- ##### SECTION Title ##### -->
GtkRecentManager

<!-- ##### SECTION Short_Description ##### -->
Matthias Clasen's avatar
Matthias Clasen committed
5
Managing Recently Used Files
6
7
8

<!-- ##### SECTION Long_Description ##### -->
<para>
Emmanuele Bassi's avatar
Emmanuele Bassi committed
9
10
11
12
13
14
15
16
17
#GtkRecentManager provides a facility for adding, removing and
looking up recently used files.  Each recently used file is
identified by its URI, and has meta-data associated to it, like
the names and command lines of the applications that have
registered it, the number of time each application has registered
the same file, the mime type of the file and whether the file
should be displayed only by the applications that have
registered it.
</para>
18

Emmanuele Bassi's avatar
Emmanuele Bassi committed
19
20
21
22
23
24
25
26
<para>
The #GtkRecentManager acts like a database of all the recently
used files.  You can create new #GtkRecentManager objects, but
it is more efficient to use the standard recent manager for
the #GdkScreen so that informations about the recently used
files is shared with other people using them.  In case the
default screen is being used, adding a new recently used
file is as simple as:
27
28
</para>

Emmanuele Bassi's avatar
Emmanuele Bassi committed
29
30
31
32
33
<informalexample>
  <programlisting>
GtkRecentManager *manager;

manager = gtk_recent_manager_get_default ();
34
gtk_recent_manager_add_item (manager, file_uri);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  </programlisting>
</informalexample>

While looking up a recently used file is as simple as:

<informalexample>
  <programlisting>
GtkRecentManager *manager;
GtkRecentInfo *info;
GError *error = NULL;

manager = gtk_recent_manager_get_default ();
info = gtk_recent_manager_lookup_item (manager, file_uri, &amp;error);
if (error)
  {
    g_warning ("Could not find the file: &percnt;s", error-&gt;message);
    g_error_free (error);
  }
else
  {
    /* Use the info object */
    g_object_unref (info);
  }
  </programlisting>
</informalexample>

Matthias Clasen's avatar
Matthias Clasen committed
61
62
63
64
<para>
Recently used files are supported since GTK+ 2.10.
</para>

65
66
67
68
69
70
71
72
73
74
<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkRecentManager ##### -->
<para>
Emmanuele Bassi's avatar
Emmanuele Bassi committed
75
76
77
78
79
Acts as a database of information about the list of recently
used files.  Normally, you retrieve the recent manager for a
particular screen using gtk_recent_manager_get_for_screen()
and it will contain information about current recent manager
for that screen.</para>
80
81
82
83


<!-- ##### STRUCT GtkRecentInfo ##### -->
<para>
Emmanuele Bassi's avatar
Emmanuele Bassi committed
84
85
Contains informations found when looking up an entry of the
recently used files list.
86
87
88
89
90
</para>


<!-- ##### STRUCT GtkRecentData ##### -->
<para>
Emmanuele Bassi's avatar
Emmanuele Bassi committed
91
92
93
94
Meta-data passed to gtk_recent_manager_add_full().  You should
use #GtkRecentData if you want to control the meta-data associated
to an entry of the recently used files list when you are adding
a new file to it.
95
96
</para>

Emmanuele Bassi's avatar
Emmanuele Bassi committed
97
98
99
100
101
102
103
104
105
106
107
@display_name: the string to be used when displaying the file
  inside a #GtkRecentChooser
@description: a user readable description of the file
@mime_type: the mime type of the file
@app_name: the name of the application that is registering
  the file
@app_exec: the command line that should be used when launching
  the file
@groups: the list of group names to which the file belongs to
@is_private: whether the file should be displayed only by
  the applications that have registered it
108
109
110

<!-- ##### MACRO GTK_RECENT_MANAGER_ERROR ##### -->
<para>
Matthias Clasen's avatar
Matthias Clasen committed
111
The #GQuark used for #GtkRecentManagerError errors.
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
</para>



<!-- ##### ENUM GtkRecentManagerError ##### -->
<para>

</para>

@GTK_RECENT_MANAGER_ERROR_NOT_FOUND: 
@GTK_RECENT_MANAGER_ERROR_INVALID_URI: 
@GTK_RECENT_MANAGER_ERROR_INVALID_MIME: 
@GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: 
@GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: 
@GTK_RECENT_MANAGER_ERROR_READ: 
@GTK_RECENT_MANAGER_ERROR_WRITE: 
@GTK_RECENT_MANAGER_ERROR_UNKNOWN: 

<!-- ##### FUNCTION gtk_recent_manager_new ##### -->
<para>

</para>

@Returns: 


Matthias Clasen's avatar
Matthias Clasen committed
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!-- ##### FUNCTION gtk_recent_manager_get_default ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_get_for_screen ##### -->
<para>

</para>

@screen: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_set_screen ##### -->
<para>

</para>

@manager: 
@screen: 


164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<!-- ##### FUNCTION gtk_recent_manager_add_item ##### -->
<para>

</para>

@manager: 
@uri: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_add_full ##### -->
<para>

</para>

@manager: 
@uri: 
@recent_data: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_remove_item ##### -->
<para>

</para>

@manager: 
@uri: 
@error: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_lookup_item ##### -->
<para>

</para>

@manager: 
@uri: 
@error: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_has_item ##### -->
<para>

</para>

@manager: 
@uri: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_move_item ##### -->
<para>

</para>

@manager: 
@uri: 
@new_uri: 
@error: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_get_limit ##### -->
<para>

</para>

@manager: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_set_limit ##### -->
<para>

</para>

@manager: 
@limit: 


<!-- ##### FUNCTION gtk_recent_manager_get_items ##### -->
<para>

</para>

@manager: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_manager_purge_items ##### -->
<para>

</para>

@manager: 
@error: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_ref ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_unref ##### -->
<para>

</para>

@info: 


<!-- ##### FUNCTION gtk_recent_info_get_uri ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_display_name ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_description ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_mime_type ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_added ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_modified ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_visited ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_private_hint ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_application_info ##### -->
<para>

</para>

@info: 
@app_name: 
@app_exec: 
@count: 
@time: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_applications ##### -->
<para>

</para>

@info: 
@length: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_last_application ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_groups ##### -->
<para>

</para>

@info: 
@length: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_has_group ##### -->
<para>

</para>

@info: 
@group_name: 
@Returns: 


Matthias Clasen's avatar
Matthias Clasen committed
407
408
409
410
411
412
413
414
415
416
<!-- ##### FUNCTION gtk_recent_info_has_application ##### -->
<para>

</para>

@info: 
@app_name: 
@Returns: 


417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
<!-- ##### FUNCTION gtk_recent_info_get_icon ##### -->
<para>

</para>

@info: 
@size: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_short_name ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_uri_display ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_get_age ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_is_local ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_exists ##### -->
<para>

</para>

@info: 
@Returns: 


<!-- ##### FUNCTION gtk_recent_info_match ##### -->
<para>

</para>

@info_a: 
@info_b: 
@Returns: