1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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
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
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
407
408
409
410
411
412
413
414
415
416
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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gioappinfo">
<refnamediv>
<refname>gio.AppInfo</refname>
<refpurpose>Information about an installed application and methods to launch it (with file arguments).</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gio.AppInfo</classname></ooclass>
<ooclass><classname><link linkend="class-gobjectginterface">gobject.GInterface</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link linkend="constructor-gioappinfo">gio.AppInfo</link></methodname>
<methodparam><parameter role="keyword">commandline</parameter></methodparam>
<methodparam><parameter role="keyword">application_name</parameter><initializer><literal>None</literal></initializer></methodparam>
<methodparam><parameter role="keyword">flags</parameter><initializer>gio.APP_INFO_CREATE_NONE</initializer></methodparam>
</constructorsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--add-supports-type">add_supports_type</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--can-delete">can_delete</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--can-remove-supports-type">can_remove_supports_type</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--delete">delete</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--dup">dup</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--equal">equal</link></methodname>
<methodparam><parameter role="keyword">appinfo2</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-commandline">get_commandline</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-description">get_description</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-executable">get_executable</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-icon">get_icon</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-id">get_id</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--get-name">get_name</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--launch">launch</link></methodname>
<methodparam><parameter role="keyword">files</parameter></methodparam>
<methodparam><parameter role="keyword">launch_context</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--launch-uris">launch_uris</link></methodname>
<methodparam><parameter role="keyword">uris</parameter></methodparam>
<methodparam><parameter role="keyword">launch_context</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--remove-supports-type">remove_supports_type</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--set-as-default-for-extension">set_as_default_for_extension</link></methodname>
<methodparam><parameter role="keyword">extension</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--set-as-default-for-type">set_as_default_for_type</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--should-show">should_show</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--supports-files">supports_files</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gioappinfo--supports-uris">supports_uris</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
</classsynopsis>
<programlisting>
<emphasis role="bold">Functions</emphasis>
<methodsynopsis language="python">
<methodname><link linkend="function-gio--app-info-get-all">gio.app_info_get_all</link></methodname>
<methodparam></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--app-info-get-all-for-type">gio.app_info_get_all_for_type</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--app-info-get-default-for-type">gio.app_info_get_default_for_type</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
<methodparam><parameter role="keyword">must_support_uris</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--app-info-get-default-for-uri-scheme">gio.app_info_get_default_for_uri_scheme</link></methodname>
<methodparam><parameter role="keyword">uri_scheme</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--app-info-reset-type-association">gio.app_info_reset_type_association</link></methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobjectginterface">gobject.GInterface</link>
+-- <link linkend="class-gioappinfo">gio.AppInfo</link>
</synopsis>
</refsect1>
<refsect1>
<title>Known Implementation</title>
<para>
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link> is implemented by
<link linkend="class-giodesktopappinfo"><classname>gio.DesktopAppInfo</classname></link>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
and <link linkend="class-gioapplaunchcontext"><classname>gio.AppLaunchContext</classname></link>
are used for describing and launching applications installed on the system.
</para>
<para>
As of GLib 2.20, URIs will always be converted to POSIX paths (using
<methodname><link linkend="method-giofile--get-path">gio.File.get_path</link></methodname>()) when using
<methodname><link linkend="method-gioappinfo--launch">gio.AppInfo.launch</link></methodname>()
even if the application requested an URI and not a POSIX path. For example for an desktop-file
based application with Exec key totem %U and a single URI, sftp://foo/file.avi, then /home/user/.gvfs/sftp
on foo/file.avi will be passed. This will only work if a set of suitable GIO extensions (such as gvfs 2.26
compiled with FUSE support), is available and operational; if this is not the case, the URI will be passed
unmodified to the application. Some URIs, such as mailto:, of course cannot be mapped to a POSIX path
(in gvfs there's no FUSE mount for it); such URIs will be passed unmodified to the application.
</para>
<para>
Specifically for gvfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the
<link linkend="class-giofile"><classname>gio.File</classname></link> constructors
(since gvfs implements the GVfs extension point). As such, if the application needs to examine the URI,
it needs to use
<methodname><link linkend="method-giofile--get-uri">gio.File.get_uri</link></methodname>()
or similar on
<link linkend="class-giofile"><classname>gio.File</classname></link>.
In other words, an application cannot assume that the URI passed to e.g.
<methodname><link linkend="constructor-giofile">gio.File</link></methodname>() constructor
is equal to the result of
<methodname><link linkend="method-giofile--get-uri">gio.File.get_uri</link></methodname>().
</para>
</refsect1>
<refsect1 id="constructor-gioappinfo">
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname>gio.AppInfo</methodname>
<methodparam><parameter role="keyword">commandline</parameter></methodparam>
<methodparam><parameter role="keyword">application_name</parameter><initializer><literal>None</literal></initializer></methodparam>
<methodparam><parameter role="keyword">flags</parameter><initializer>gio.APP_INFO_CREATE_NONE</initializer></methodparam>
</constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>commandline</parameter> :</term>
<listitem><simpara>the commandline to use
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>application_name</parameter> :</term>
<listitem><simpara>the application name, or <literal>None</literal> to use commandline.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter> :</term>
<listitem><simpara>flags that can specify details of the created,
from <xref linkend="gio-app-info-constants" endterm="gio-app-info-constants-title"></xref>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a new
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
for given command.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
Creates a new <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
from the given information.
</para>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gioappinfo--add-supports-type">
<title>gio.AppInfo.add_supports_type</title>
<programlisting><methodsynopsis language="python">
<methodname>add_supports_type</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>A string.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>add_supports_type</methodname>() method adds a content type
to the application information to indicate the application is capable of
opening files with the given content type.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--can-delete">
<title>gio.AppInfo.can_delete</title>
<programlisting><methodsynopsis language="python">
<methodname>can_delete</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if appinfo can be deleted.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>can_delete</methodname>() method obtains the information
whether the <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
can be deleted. See
<methodname><link linkend="method-gioappinfo--delete">gio.AppInfo.delete</link></methodname>().
</para>
</refsect2>
<refsect2 id="method-gioappinfo--can-remove-supports-type">
<title>gio.AppInfo.can_remove_supports_type</title>
<programlisting><methodsynopsis language="python">
<methodname>can_remove_supports_type</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if it is possible to remove
supported content types from a given appinfo, <literal>False</literal>
if not. </simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>can_remove_supports_type</methodname>() method checks if a
supported content type can be removed from an application.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--delete">
<title>gio.AppInfo.delete</title>
<programlisting><methodsynopsis language="python">
<methodname>delete</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if appinfo has been deleted.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>delete</methodname>() method tries to delete an
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>.
</para>
<para>
On some platforms, there may be a difference between user-defined
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>s
which can be deleted, and system-wide ones which cannot. See
<methodname><link linkend="method-gioappinfo--can-delete">gio.AppInfo.can_delete</link></methodname>().
</para>
</refsect2>
<refsect2 id="method-gioappinfo--dup">
<title>gio.AppInfo.dup</title>
<programlisting><methodsynopsis language="python">
<methodname>dup</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>A duplicate of appinfo.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>dup</methodname>() method creates a duplicate of a
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--equal">
<title>gio.AppInfo.equal</title>
<programlisting><methodsynopsis language="python">
<methodname>equal</methodname>
<methodparam><parameter role="keyword">icon2</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>appinfo2</parameter> :</term>
<listitem><simpara>the second
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if appinfo1 is equal to appinfo2.
<literal>False</literal> otherwise.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>equal</methodname>() method checks if two
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>s are equal.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-commandline">
<title>gio.AppInfo.get_commandline</title>
<programlisting><methodsynopsis language="python">
<methodname>get_commandline</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a string containing the appinfo's commandline, or
<literal>None</literal> if this information is not available.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_commandline</methodname>() method gets the
commandline with which the application will be started.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-description">
<title>gio.AppInfo.get_description</title>
<programlisting><methodsynopsis language="python">
<methodname>get_description</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>A string containing a description of the application
appinfo, or <literal>None</literal> if none.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_description</methodname>() method gets a human-readable
description of an installed application.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-executable">
<title>gio.AppInfo.get_executable</title>
<programlisting><methodsynopsis language="python">
<methodname>get_executable</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a string containing the appinfo's application
binary's name.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_description</methodname>() method gets the executable's
name for the installed application.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-icon">
<title>gio.AppInfo.get_icon</title>
<programlisting><methodsynopsis language="python">
<methodname>get_icon</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the default
<link linkend="class-gioicon"><classname>gio.Icon</classname></link> for appinfo.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_icon</methodname>() method gets the icon for the application.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-id">
<title>gio.AppInfo.get_id</title>
<programlisting><methodsynopsis language="python">
<methodname>get_id</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a string containing the application's ID.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_id</methodname>() method gets the ID of an application.
An id is a string that identifies the application. The exact format of the
id is platform dependent. For instance, on Unix this is the desktop file id
from the xdg menu specification.
</para>
<para>
Note that the returned ID may be <literal>None</literal>, depending on
how the appinfo has been constructed.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--get-name">
<title>gio.AppInfo.get_name</title>
<programlisting><methodsynopsis language="python">
<methodname>get_name</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the name of the application for appinfo.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_name</methodname>() method gets the installed
name of the application.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--launch">
<title>gio.AppInfo.launch</title>
<programlisting><methodsynopsis language="python">
<methodname>launch</methodname>
<methodparam><parameter role="keyword">files</parameter></methodparam>
<methodparam><parameter role="keyword">launch_context</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>files</parameter> :</term>
<listitem><simpara>a list of <link linkend="class-giofile"><classname>gio.File</classname></link> objects.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>launch_context</parameter> :</term>
<listitem><simpara>a <link linkend="class-gioapplaunchcontext"><classname>gio.AppLaunchContext</classname></link>
or <literal>None</literal>.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> on successful launch,
<literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>launch</methodname>() method launches the application.
Passes files to the launched application as arguments, using the optional
launch_context to get information about the details of the launcher
(like what screen it is on). On error, error will be set accordingly.
</para>
<para>
To lauch the application without arguments pass a <literal>None</literal> for files list.
</para>
<para>
Note that even if the launch is successful the application launched can fail
to start if it runs into problems during startup. There is no way to detect this.
</para>
<para>
Some URIs can be changed when passed through a
<link linkend="class-giofile"><classname>gio.File</classname></link>
(for instance unsupported uris with strange formats like mailto:), so
if you have a textual uri you want to pass in as argument, consider using
<methodname><link linkend="method-gioappinfo--launch-uris">gio.File.launch_uris</link></methodname>()
instead.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--launch-uris">
<title>gio.AppInfo.launch_uris</title>
<programlisting><methodsynopsis language="python">
<methodname>launch_uris</methodname>
<methodparam><parameter role="keyword">uris</parameter></methodparam>
<methodparam><parameter role="keyword">launch_context</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>uris</parameter> :</term>
<listitem><simpara>a list containing URIs to launch.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>launch_context</parameter> :</term>
<listitem><simpara>a <link linkend="class-gioapplaunchcontext"><classname>gio.AppLaunchContext</classname></link>
or <literal>None</literal>.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> on successful launch,
<literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>launch_uris</methodname>() method launches the application.
Passes uris to the launched application as arguments, using the optional
launch_context to get information about the details of the launcher
(like what screen it is on). On error, error will be set accordingly.
</para>
<para>
To lauch the application without arguments pass a <literal>None</literal> for files list.
</para>
<para>
Note that even if the launch is successful the application launched can fail
to start if it runs into problems during startup. There is no way to detect this.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--remove-supports-type">
<title>gio.AppInfo.remove_supports_type</title>
<programlisting><methodsynopsis language="python">
<methodname>remove_supports_type</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>A string.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>remove_supports_type</methodname>() method removes a
supported type from an application, if possible.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--set-as-default-for-extension">
<title>gio.AppInfo.set_as_default_for_extension</title>
<programlisting><methodsynopsis language="python">
<methodname>set_as_default_for_extension</methodname>
<methodparam><parameter role="keyword">extension</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>extension</parameter> :</term>
<listitem><simpara>A string containing the file extension (without the dot).
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_as_default_for_extension</methodname>() method sets the
application as the default handler for the given file extention.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--set-as-default-for-type">
<title>gio.AppInfo.set_as_default_for_type</title>
<programlisting><methodsynopsis language="python">
<methodname>set_as_default_for_type</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>The content type.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_as_default_for_type</methodname>() method sets the
application as the default handler for a given type.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--should-show">
<title>gio.AppInfo.should_show</title>
<programlisting><methodsynopsis language="python">
<methodname>should_show</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the appinfo should be shown,
<literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>should_show</methodname>() method checks if the application
info should be shown in menus that list available applications.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--supports-files">
<title>gio.AppInfo.supports_files</title>
<programlisting><methodsynopsis language="python">
<methodname>supports_files</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the appinfo supports files.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>supports_files</methodname>() method checks if the application
accepts files as arguments.
</para>
</refsect2>
<refsect2 id="method-gioappinfo--supports-uris">
<title>gio.AppInfo.supports_uris</title>
<programlisting><methodsynopsis language="python">
<methodname>supports_uris</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the appinfo supports uris.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>supports_uris</methodname>() method checks if the application
accepts uris as arguments.
</para>
</refsect2>
</refsect1>
<refsect1>
<title>Functions</title>
<refsect2 id="function-gio--app-info-get-all">
<title>gio.app_info_get_all</title>
<programlisting><methodsynopsis language="python">
<methodname>app_info_get_all</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>A list of <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>s.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>app_info_get_all</methodname>() function gets a list of all of
the applications currently registered on this system.
</para>
<para>
For desktop files, this includes applications that have NoDisplay=true set or are
excluded from display by means of OnlyShowIn or NotShowIn. See
<methodname><link linkend="method-gioappinfo--should-show">gio.AppInfo.should_show</link></methodname>().
The returned list does not include applications which have the Hidden key set.
</para>
</refsect2>
<refsect2 id="function-gio--app-info-get-all-for-type">
<title>gio.app_info_get_all_for_type</title>
<programlisting><methodsynopsis language="python">
<methodname>app_info_get_all_for_type</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>the content type to find a
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
for.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>A list of <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>s
for a given content type or <literal>None</literal> on error.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>app_info_get_all_for_type</methodname>() function gets a list of all
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>s
for a given content type.
</para>
</refsect2>
<refsect2 id="function-gio--app-info-get-default-for-type">
<title>gio.app_info_get_default_for_type</title>
<programlisting><methodsynopsis language="python">
<methodname>app_info_get_default_for_type</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
<methodparam><parameter role="keyword">must_support_uris</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>the content type to find a
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
for.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>must_support_uris</parameter> :</term>
<listitem><simpara>if <literal>True</literal>, the
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
is expected to support URIs </simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
for given content_type or <literal>None</literal> on error.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>app_info_get_default_for_type</methodname>() function gets the
<link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
that correspond to a given content type.
</para>
</refsect2>
<refsect2 id="function-gio--app-info-get-default-for-uri-scheme">
<title>gio.app_info_get_default_for_uri_scheme</title>
<programlisting><methodsynopsis language="python">
<methodname>app_info_get_default_for_uri_scheme</methodname>
<methodparam><parameter role="keyword">uri_scheme</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>uri_scheme</parameter> :</term>
<listitem><simpara>a string containing a URI scheme.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
for given uri_scheme or <literal>None</literal> on error.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>app_info_get_default_for_uri_scheme</methodname>() function gets
the default application for launching applications using this URI scheme. A URI
scheme is the initial part of the URI, up to but not including the
':', e.g. "http", "ftp" or "sip".
</para>
</refsect2>
<refsect2 id="function-gio--app-info-reset-type-association">
<title>gio.app_info_reset_type_association</title>
<programlisting><methodsynopsis language="python">
<methodname>app_info_reset_type_association</methodname>
<methodparam><parameter role="keyword">content_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>content_type</parameter> :</term>
<listitem><simpara>a content type</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>app_info_reset_type_association</methodname>() function
removes all changes to the type associations done by
<methodname><link linkend="method-gioappinfo--set-as-default-for-type">set_as_default_for_type</link></methodname>(),
<methodname><link linkend="method-gioappinfo--set-as-default-for-extension">set_as_default_for_extension</link></methodname>(),
<methodname><link linkend="method-gioappinfo--add-supports-type">add_supports_type</link></methodname>() or
<methodname><link linkend="method-gioappinfo--remove-supports-type">remove_supports_type</link></methodname>().
</para>
</refsect2>
</refsect1>
</refentry>
|