1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GAppInfo.html
27  * outPack = gio
28  * outFile = AppInfoT
29  * strct   = GAppInfo
30  * realStrct=
31  * ctorStrct=
32  * clss    = AppInfoT
33  * interf  = AppInfoIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- g_app_info_
42  * omit structs:
43  * omit prefixes:
44  * 	- g_app_launch_context_
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- glib.ErrorG
50  * 	- glib.GException
51  * 	- glib.ListG
52  * 	- gio.AppInfoIF
53  * 	- gio.AppLaunchContext
54  * 	- gio.Icon
55  * 	- gio.IconIF
56  * structWrap:
57  * 	- GAppInfo* -> AppInfoIF
58  * 	- GAppLaunchContext* -> AppLaunchContext
59  * 	- GIcon* -> IconIF
60  * 	- GList* -> ListG
61  * module aliases:
62  * local aliases:
63  * overrides:
64  */
65 
66 module gio.AppInfoT;
67 
68 public  import gtkc.giotypes;
69 
70 public import gtkc.gio;
71 public import glib.ConstructionException;
72 public import gobject.ObjectG;
73 
74 
75 public import glib.Str;
76 public import glib.ErrorG;
77 public import glib.GException;
78 public import glib.ListG;
79 public import gio.AppInfoIF;
80 public import gio.AppLaunchContext;
81 public import gio.Icon;
82 public import gio.IconIF;
83 
84 
85 
86 
87 /**
88  * Description
89  * GAppInfo and GAppLaunchContext are used for describing and launching
90  * applications installed on the system.
91  * As of GLib 2.20, URIs will always be converted to POSIX paths
92  * (using g_file_get_path()) when using g_app_info_launch() even if
93  * the application requested an URI and not a POSIX path. For example
94  * for an desktop-file based application with Exec key totem
95  * %U and a single URI,
96  * sftp://foo/file.avi, then
97  * /home/user/.gvfs/sftp on foo/file.avi will be
98  * passed. This will only work if a set of suitable GIO extensions
99  * (such as gvfs 2.26 compiled with FUSE support), is available and
100  * operational; if this is not the case, the URI will be passed
101  * unmodified to the application. Some URIs, such as
102  * mailto:, of course cannot be mapped to a POSIX
103  * path (in gvfs there's no FUSE mount for it); such URIs will be
104  * passed unmodified to the application.
105  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
106  * back to the GIO URI in the GFile constructors (since gvfs
107  * implements the GVfs extension point). As such, if the application
108  * needs to examine the URI, it needs to use g_file_get_uri() or
109  * similar on GFile. In other words, an application cannot assume
110  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
111  * equal to the result of g_file_get_uri(). The following snippet
112  * illustrates this:
113  * GFile *f;
114  * char *uri;
115  * file = g_file_new_for_commandline_arg (uri_from_commandline);
116  * uri = g_file_get_uri (file);
117  * strcmp (uri, uri_from_commandline) == 0; // FALSE
118  * g_free (uri);
119  * if (g_file_has_uri_scheme (file, "cdda"))
120  *  {
121 	 *  // do something special with uri
122  *  }
123  * g_object_unref (file);
124  * This code will work when both cdda://sr0/Track
125  * 1.wav and /home/user/.gvfs/cdda on sr0/Track
126  * 1.wav is passed to the application. It should be noted
127  * that it's generally not safe for applications to rely on the format
128  * of a particular URIs. Different launcher applications (e.g. file
129  * managers) may have different ideas of what a given URI means.
130  */
131 public template AppInfoT(TStruct)
132 {
133 	
134 	/** the main Gtk struct */
135 	protected GAppInfo* gAppInfo;
136 	
137 	
138 	public GAppInfo* getAppInfoTStruct()
139 	{
140 		return cast(GAppInfo*)getStruct();
141 	}
142 	
143 	
144 	/**
145 	 */
146 	
147 	/**
148 	 * Creates a new GAppInfo from the given information.
149 	 * Params:
150 	 * commandline = the commandline to use
151 	 * applicationName = the application name, or NULL to use commandline. [allow-none]
152 	 * flags = flags that can specify details of the created GAppInfo
153 	 * Returns: new GAppInfo for given command. [transfer full]
154 	 * Throws: GException on failure.
155 	 */
156 	public static AppInfoIF createFromCommandline(string commandline, string applicationName, GAppInfoCreateFlags flags)
157 	{
158 		// GAppInfo * g_app_info_create_from_commandline (const char *commandline,  const char *application_name,  GAppInfoCreateFlags flags,  GError **error);
159 		GError* err = null;
160 		
161 		auto p = g_app_info_create_from_commandline(Str.toStringz(commandline), Str.toStringz(applicationName), flags, &err);
162 		
163 		if (err !is null)
164 		{
165 			throw new GException( new ErrorG(err) );
166 		}
167 		
168 		
169 		if(p is null)
170 		{
171 			return null;
172 		}
173 		
174 		return ObjectG.getDObject!(AppInfo, AppInfoIF)(cast(GAppInfo*) p);
175 	}
176 	
177 	/**
178 	 * Creates a duplicate of a GAppInfo.
179 	 * Returns: a duplicate of appinfo. [transfer full]
180 	 */
181 	public AppInfoIF dup()
182 	{
183 		// GAppInfo * g_app_info_dup (GAppInfo *appinfo);
184 		auto p = g_app_info_dup(getAppInfoTStruct());
185 		
186 		if(p is null)
187 		{
188 			return null;
189 		}
190 		
191 		return ObjectG.getDObject!(AppInfo, AppInfoIF)(cast(GAppInfo*) p);
192 	}
193 	
194 	/**
195 	 * Checks if two GAppInfos are equal.
196 	 * Params:
197 	 * appinfo2 = the second GAppInfo.
198 	 * Returns: TRUE if appinfo1 is equal to appinfo2. FALSE otherwise.
199 	 */
200 	public int equal(AppInfoIF appinfo2)
201 	{
202 		// gboolean g_app_info_equal (GAppInfo *appinfo1,  GAppInfo *appinfo2);
203 		return g_app_info_equal(getAppInfoTStruct(), (appinfo2 is null) ? null : appinfo2.getAppInfoTStruct());
204 	}
205 	
206 	/**
207 	 * Gets the ID of an application. An id is a string that
208 	 * identifies the application. The exact format of the id is
209 	 * platform dependent. For instance, on Unix this is the
210 	 * desktop file id from the xdg menu specification.
211 	 * Note that the returned ID may be NULL, depending on how
212 	 * the appinfo has been constructed.
213 	 * Returns: a string containing the application's ID.
214 	 */
215 	public string getId()
216 	{
217 		// const char * g_app_info_get_id (GAppInfo *appinfo);
218 		return Str.toString(g_app_info_get_id(getAppInfoTStruct()));
219 	}
220 	
221 	/**
222 	 * Gets the installed name of the application.
223 	 * Returns: the name of the application for appinfo.
224 	 */
225 	public string getName()
226 	{
227 		// const char * g_app_info_get_name (GAppInfo *appinfo);
228 		return Str.toString(g_app_info_get_name(getAppInfoTStruct()));
229 	}
230 	
231 	/**
232 	 * Gets the display name of the application. The display name is often more
233 	 * descriptive to the user than the name itself.
234 	 * Since 2.24
235 	 * Returns: the display name of the application for appinfo, or the name if no display name is available.
236 	 */
237 	public string getDisplayName()
238 	{
239 		// const char * g_app_info_get_display_name (GAppInfo *appinfo);
240 		return Str.toString(g_app_info_get_display_name(getAppInfoTStruct()));
241 	}
242 	
243 	/**
244 	 * Gets a human-readable description of an installed application.
245 	 * Returns: a string containing a description of the application appinfo, or NULL if none.
246 	 */
247 	public string getDescription()
248 	{
249 		// const char * g_app_info_get_description (GAppInfo *appinfo);
250 		return Str.toString(g_app_info_get_description(getAppInfoTStruct()));
251 	}
252 	
253 	/**
254 	 * Gets the executable's name for the installed application.
255 	 * Returns: a string containing the appinfo's application binaries name
256 	 */
257 	public string getExecutable()
258 	{
259 		// const char * g_app_info_get_executable (GAppInfo *appinfo);
260 		return Str.toString(g_app_info_get_executable(getAppInfoTStruct()));
261 	}
262 	
263 	/**
264 	 * Gets the commandline with which the application will be
265 	 * started.
266 	 * Since 2.20
267 	 * Returns: a string containing the appinfo's commandline, or NULL if this information is not available
268 	 */
269 	public string getCommandline()
270 	{
271 		// const char * g_app_info_get_commandline (GAppInfo *appinfo);
272 		return Str.toString(g_app_info_get_commandline(getAppInfoTStruct()));
273 	}
274 	
275 	/**
276 	 * Gets the icon for the application.
277 	 * Returns: the default GIcon for appinfo. [transfer none]
278 	 */
279 	public IconIF getIcon()
280 	{
281 		// GIcon * g_app_info_get_icon (GAppInfo *appinfo);
282 		auto p = g_app_info_get_icon(getAppInfoTStruct());
283 		
284 		if(p is null)
285 		{
286 			return null;
287 		}
288 		
289 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
290 	}
291 	
292 	/**
293 	 * Launches the application. Passes files to the launched application
294 	 * as arguments, using the optional launch_context to get information
295 	 * about the details of the launcher (like what screen it is on).
296 	 * On error, error will be set accordingly.
297 	 * To launch the application without arguments pass a NULL files list.
298 	 * Note that even if the launch is successful the application launched
299 	 * can fail to start if it runs into problems during startup. There is
300 	 * no way to detect this.
301 	 * Some URIs can be changed when passed through a GFile (for instance
302 	 * unsupported uris with strange formats like mailto:), so if you have
303 	 * a textual uri you want to pass in as argument, consider using
304 	 * g_app_info_launch_uris() instead.
305 	 * On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE
306 	 * environment variable with the path of the launched desktop file and
307 	 * GIO_LAUNCHED_DESKTOP_FILE_PID to the process
308 	 * id of the launched process. This can be used to ignore
309 	 * GIO_LAUNCHED_DESKTOP_FILE, should it be inherited
310 	 * by further processes. The DISPLAY and
311 	 * DESKTOP_STARTUP_ID environment variables are also
312 	 * set, based on information provided in launch_context.
313 	 * Params:
314 	 * files = a GList of GFile objects. [element-type GFile]
315 	 * launchContext = a GAppLaunchContext or NULL. [allow-none]
316 	 * Returns: TRUE on successful launch, FALSE otherwise.
317 	 * Throws: GException on failure.
318 	 */
319 	public int launch(ListG files, AppLaunchContext launchContext)
320 	{
321 		// gboolean g_app_info_launch (GAppInfo *appinfo,  GList *files,  GAppLaunchContext *launch_context,  GError **error);
322 		GError* err = null;
323 		
324 		auto p = g_app_info_launch(getAppInfoTStruct(), (files is null) ? null : files.getListGStruct(), (launchContext is null) ? null : launchContext.getAppLaunchContextStruct(), &err);
325 		
326 		if (err !is null)
327 		{
328 			throw new GException( new ErrorG(err) );
329 		}
330 		
331 		return p;
332 	}
333 	
334 	/**
335 	 * Checks if the application accepts files as arguments.
336 	 * Returns: TRUE if the appinfo supports files.
337 	 */
338 	public int supportsFiles()
339 	{
340 		// gboolean g_app_info_supports_files (GAppInfo *appinfo);
341 		return g_app_info_supports_files(getAppInfoTStruct());
342 	}
343 	
344 	/**
345 	 * Checks if the application supports reading files and directories from URIs.
346 	 * Returns: TRUE if the appinfo supports URIs.
347 	 */
348 	public int supportsUris()
349 	{
350 		// gboolean g_app_info_supports_uris (GAppInfo *appinfo);
351 		return g_app_info_supports_uris(getAppInfoTStruct());
352 	}
353 	
354 	/**
355 	 * Launches the application. Passes uris to the launched application
356 	 * as arguments, using the optional launch_context to get information
357 	 * about the details of the launcher (like what screen it is on).
358 	 * On error, error will be set accordingly.
359 	 * To lauch the application without arguments pass a NULL uris list.
360 	 * Note that even if the launch is successful the application launched
361 	 * can fail to start if it runs into problems during startup. There is
362 	 * no way to detect this.
363 	 * Params:
364 	 * uris = a GList containing URIs to launch. [element-type utf8]
365 	 * launchContext = a GAppLaunchContext or NULL. [allow-none]
366 	 * Returns: TRUE on successful launch, FALSE otherwise.
367 	 * Throws: GException on failure.
368 	 */
369 	public int launchUris(ListG uris, AppLaunchContext launchContext)
370 	{
371 		// gboolean g_app_info_launch_uris (GAppInfo *appinfo,  GList *uris,  GAppLaunchContext *launch_context,  GError **error);
372 		GError* err = null;
373 		
374 		auto p = g_app_info_launch_uris(getAppInfoTStruct(), (uris is null) ? null : uris.getListGStruct(), (launchContext is null) ? null : launchContext.getAppLaunchContextStruct(), &err);
375 		
376 		if (err !is null)
377 		{
378 			throw new GException( new ErrorG(err) );
379 		}
380 		
381 		return p;
382 	}
383 	
384 	/**
385 	 * Checks if the application info should be shown in menus that
386 	 * list available applications.
387 	 * Returns: TRUE if the appinfo should be shown, FALSE otherwise.
388 	 */
389 	public int shouldShow()
390 	{
391 		// gboolean g_app_info_should_show (GAppInfo *appinfo);
392 		return g_app_info_should_show(getAppInfoTStruct());
393 	}
394 	
395 	/**
396 	 * Obtains the information whether the GAppInfo can be deleted.
397 	 * See g_app_info_delete().
398 	 * Since 2.20
399 	 * Returns: TRUE if appinfo can be deleted
400 	 */
401 	public int canDelete()
402 	{
403 		// gboolean g_app_info_can_delete (GAppInfo *appinfo);
404 		return g_app_info_can_delete(getAppInfoTStruct());
405 	}
406 	
407 	/**
408 	 * Tries to delete a GAppInfo.
409 	 * On some platforms, there may be a difference between user-defined
410 	 * GAppInfos which can be deleted, and system-wide ones which
411 	 * cannot. See g_app_info_can_delete().
412 	 * Virtual: do_delete
413 	 * Since 2.20
414 	 * Returns: TRUE if appinfo has been deleted
415 	 */
416 	public int delet()
417 	{
418 		// gboolean g_app_info_delete (GAppInfo *appinfo);
419 		return g_app_info_delete(getAppInfoTStruct());
420 	}
421 	
422 	/**
423 	 * Removes all changes to the type associations done by
424 	 * g_app_info_set_as_default_for_type(),
425 	 * g_app_info_set_as_default_for_extension(),
426 	 * g_app_info_add_supports_type() or g_app_info_remove_supports_type().
427 	 * Since 2.20
428 	 * Params:
429 	 * contentType = a content type
430 	 */
431 	public static void resetTypeAssociations(string contentType)
432 	{
433 		// void g_app_info_reset_type_associations (const char *content_type);
434 		g_app_info_reset_type_associations(Str.toStringz(contentType));
435 	}
436 	
437 	/**
438 	 * Sets the application as the default handler for a given type.
439 	 * Params:
440 	 * contentType = the content type.
441 	 * Returns: TRUE on success, FALSE on error.
442 	 * Throws: GException on failure.
443 	 */
444 	public int setAsDefaultForType(string contentType)
445 	{
446 		// gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo,  const char *content_type,  GError **error);
447 		GError* err = null;
448 		
449 		auto p = g_app_info_set_as_default_for_type(getAppInfoTStruct(), Str.toStringz(contentType), &err);
450 		
451 		if (err !is null)
452 		{
453 			throw new GException( new ErrorG(err) );
454 		}
455 		
456 		return p;
457 	}
458 	
459 	/**
460 	 * Sets the application as the default handler for the given file extension.
461 	 * Params:
462 	 * extension = a string containing the file extension (without the dot).
463 	 * Returns: TRUE on success, FALSE on error.
464 	 * Throws: GException on failure.
465 	 */
466 	public int setAsDefaultForExtension(string extension)
467 	{
468 		// gboolean g_app_info_set_as_default_for_extension  (GAppInfo *appinfo,  const char *extension,  GError **error);
469 		GError* err = null;
470 		
471 		auto p = g_app_info_set_as_default_for_extension(getAppInfoTStruct(), Str.toStringz(extension), &err);
472 		
473 		if (err !is null)
474 		{
475 			throw new GException( new ErrorG(err) );
476 		}
477 		
478 		return p;
479 	}
480 	
481 	/**
482 	 * Sets the application as the last used application for a given type.
483 	 * This will make the application appear as first in the list returned by
484 	 * g_app_info_get_recommended_for_type, regardless of the default application
485 	 * for that content type.
486 	 * Params:
487 	 * contentType = the content type.
488 	 * Returns: TRUE on success, FALSE on error.
489 	 * Throws: GException on failure.
490 	 */
491 	public int setAsLastUsedForType(string contentType)
492 	{
493 		// gboolean g_app_info_set_as_last_used_for_type  (GAppInfo *appinfo,  const char *content_type,  GError **error);
494 		GError* err = null;
495 		
496 		auto p = g_app_info_set_as_last_used_for_type(getAppInfoTStruct(), Str.toStringz(contentType), &err);
497 		
498 		if (err !is null)
499 		{
500 			throw new GException( new ErrorG(err) );
501 		}
502 		
503 		return p;
504 	}
505 	
506 	/**
507 	 * Adds a content type to the application information to indicate the
508 	 * application is capable of opening files with the given content type.
509 	 * Params:
510 	 * contentType = a string.
511 	 * Returns: TRUE on success, FALSE on error.
512 	 * Throws: GException on failure.
513 	 */
514 	public int addSupportsType(string contentType)
515 	{
516 		// gboolean g_app_info_add_supports_type (GAppInfo *appinfo,  const char *content_type,  GError **error);
517 		GError* err = null;
518 		
519 		auto p = g_app_info_add_supports_type(getAppInfoTStruct(), Str.toStringz(contentType), &err);
520 		
521 		if (err !is null)
522 		{
523 			throw new GException( new ErrorG(err) );
524 		}
525 		
526 		return p;
527 	}
528 	
529 	/**
530 	 * Checks if a supported content type can be removed from an application.
531 	 * Returns: TRUE if it is possible to remove supported content types from a given appinfo, FALSE if not.
532 	 */
533 	public int canRemoveSupportsType()
534 	{
535 		// gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo);
536 		return g_app_info_can_remove_supports_type(getAppInfoTStruct());
537 	}
538 	
539 	/**
540 	 * Removes a supported type from an application, if possible.
541 	 * Params:
542 	 * contentType = a string.
543 	 * Returns: TRUE on success, FALSE on error.
544 	 * Throws: GException on failure.
545 	 */
546 	public int removeSupportsType(string contentType)
547 	{
548 		// gboolean g_app_info_remove_supports_type (GAppInfo *appinfo,  const char *content_type,  GError **error);
549 		GError* err = null;
550 		
551 		auto p = g_app_info_remove_supports_type(getAppInfoTStruct(), Str.toStringz(contentType), &err);
552 		
553 		if (err !is null)
554 		{
555 			throw new GException( new ErrorG(err) );
556 		}
557 		
558 		return p;
559 	}
560 	
561 	/**
562 	 * Gets a list of all of the applications currently registered
563 	 * on this system.
564 	 * For desktop files, this includes applications that have
565 	 * NoDisplay=true set or are excluded from
566 	 * display by means of OnlyShowIn or
567 	 * NotShowIn. See g_app_info_should_show().
568 	 * The returned list does not include applications which have
569 	 * the Hidden key set.
570 	 * Returns: a newly allocated GList of references to GAppInfos. [element-type GAppInfo][transfer full]
571 	 */
572 	public static ListG getAll()
573 	{
574 		// GList * g_app_info_get_all (void);
575 		auto p = g_app_info_get_all();
576 		
577 		if(p is null)
578 		{
579 			return null;
580 		}
581 		
582 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
583 	}
584 	
585 	/**
586 	 * Gets a list of all GAppInfos for a given content type.
587 	 * Params:
588 	 * contentType = the content type to find a GAppInfo for
589 	 * Returns: GList of GAppInfos for given content_type or NULL on error. [element-type GAppInfo][transfer full]
590 	 */
591 	public static ListG getAllForType(string contentType)
592 	{
593 		// GList * g_app_info_get_all_for_type (const char *content_type);
594 		auto p = g_app_info_get_all_for_type(Str.toStringz(contentType));
595 		
596 		if(p is null)
597 		{
598 			return null;
599 		}
600 		
601 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
602 	}
603 	
604 	/**
605 	 * Gets the GAppInfo that corresponds to a given content type.
606 	 * Params:
607 	 * contentType = the content type to find a GAppInfo for
608 	 * mustSupportUris = if TRUE, the GAppInfo is expected to
609 	 * support URIs
610 	 * Returns: GAppInfo for given content_type or NULL on error. [transfer full]
611 	 */
612 	public static AppInfoIF getDefaultForType(string contentType, int mustSupportUris)
613 	{
614 		// GAppInfo * g_app_info_get_default_for_type (const char *content_type,  gboolean must_support_uris);
615 		auto p = g_app_info_get_default_for_type(Str.toStringz(contentType), mustSupportUris);
616 		
617 		if(p is null)
618 		{
619 			return null;
620 		}
621 		
622 		return ObjectG.getDObject!(AppInfo, AppInfoIF)(cast(GAppInfo*) p);
623 	}
624 	
625 	/**
626 	 * Gets the default application for launching applications
627 	 * using this URI scheme. A URI scheme is the initial part
628 	 * of the URI, up to but not including the ':', e.g. "http",
629 	 * "ftp" or "sip".
630 	 * Params:
631 	 * uriScheme = a string containing a URI scheme.
632 	 * Returns: GAppInfo for given uri_scheme or NULL on error. [transfer full]
633 	 */
634 	public static AppInfoIF getDefaultForUriScheme(string uriScheme)
635 	{
636 		// GAppInfo * g_app_info_get_default_for_uri_scheme  (const char *uri_scheme);
637 		auto p = g_app_info_get_default_for_uri_scheme(Str.toStringz(uriScheme));
638 		
639 		if(p is null)
640 		{
641 			return null;
642 		}
643 		
644 		return ObjectG.getDObject!(AppInfo, AppInfoIF)(cast(GAppInfo*) p);
645 	}
646 	
647 	/**
648 	 * Gets a list of fallback GAppInfos for a given content type, i.e.
649 	 * those applications which claim to support the given content type
650 	 * by MIME type subclassing and not directly.
651 	 * Since 2.28
652 	 * Params:
653 	 * contentType = the content type to find a GAppInfo for
654 	 * Returns: GList of GAppInfos for given content_type or NULL on error. [element-type GAppInfo][transfer full]
655 	 */
656 	public static ListG getFallbackForType(string contentType)
657 	{
658 		// GList * g_app_info_get_fallback_for_type (const gchar *content_type);
659 		auto p = g_app_info_get_fallback_for_type(Str.toStringz(contentType));
660 		
661 		if(p is null)
662 		{
663 			return null;
664 		}
665 		
666 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
667 	}
668 	
669 	/**
670 	 * Gets a list of recommended GAppInfos for a given content type, i.e.
671 	 * those applications which claim to support the given content type exactly,
672 	 * and not by MIME type subclassing.
673 	 * Note that the first application of the list is the last used one, i.e.
674 	 * the last one for which g_app_info_set_as_last_used_for_type has been
675 	 * called.
676 	 * Since 2.28
677 	 * Params:
678 	 * contentType = the content type to find a GAppInfo for
679 	 * Returns: GList of GAppInfos for given content_type or NULL on error. [element-type GAppInfo][transfer full]
680 	 */
681 	public static ListG getRecommendedForType(string contentType)
682 	{
683 		// GList * g_app_info_get_recommended_for_type (const gchar *content_type);
684 		auto p = g_app_info_get_recommended_for_type(Str.toStringz(contentType));
685 		
686 		if(p is null)
687 		{
688 			return null;
689 		}
690 		
691 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
692 	}
693 	
694 	/**
695 	 * Utility function that launches the default application
696 	 * registered to handle the specified uri. Synchronous I/O
697 	 * is done on the uri to detect the type of the file if
698 	 * required.
699 	 * Params:
700 	 * uri = the uri to show
701 	 * launchContext = an optional GAppLaunchContext. [allow-none]
702 	 * Returns: TRUE on success, FALSE on error.
703 	 * Throws: GException on failure.
704 	 */
705 	public static int launchDefaultForUri(string uri, AppLaunchContext launchContext)
706 	{
707 		// gboolean g_app_info_launch_default_for_uri (const char *uri,  GAppLaunchContext *launch_context,  GError **error);
708 		GError* err = null;
709 		
710 		auto p = g_app_info_launch_default_for_uri(Str.toStringz(uri), (launchContext is null) ? null : launchContext.getAppLaunchContextStruct(), &err);
711 		
712 		if (err !is null)
713 		{
714 			throw new GException( new ErrorG(err) );
715 		}
716 		
717 		return p;
718 	}
719 }