Interface

Gio-2.0GioAppInfoNamespace

interface AppInfoNamespace {
    $gtype: GType<Gio.AppInfo>;
    prototype: Gio.AppInfo;
    create_from_commandline(
        commandline: string,
        application_name: string,
        flags: Gio.AppInfoCreateFlags,
    ): Gio.AppInfo;
    get_all(): Gio.AppInfo[];
    get_all_for_type(content_type: string): Gio.AppInfo[];
    get_default_for_type(
        content_type: string,
        must_support_uris: boolean,
    ): Gio.AppInfo;
    get_default_for_type_async(
        content_type: string,
        must_support_uris: boolean,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.AppInfo>,
    ): void;
    get_default_for_type_finish(result: Gio.AsyncResult): Gio.AppInfo;
    get_default_for_uri_scheme(uri_scheme: string): Gio.AppInfo;
    get_default_for_uri_scheme_async(
        uri_scheme: string,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.AppInfo>,
    ): void;
    get_default_for_uri_scheme_finish(result: Gio.AsyncResult): Gio.AppInfo;
    get_fallback_for_type(content_type: string): Gio.AppInfo[];
    get_recommended_for_type(content_type: string): Gio.AppInfo[];
    launch_default_for_uri(
        uri: string,
        context?: Gio.AppLaunchContext,
    ): boolean;
    launch_default_for_uri_async(
        uri: string,
        context?: Gio.AppLaunchContext,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.AppInfo>,
    ): void;
    launch_default_for_uri_finish(result: Gio.AsyncResult): boolean;
    reset_type_associations(content_type: string): void;
}
Index

Properties

$gtype: GType<Gio.AppInfo>
prototype: Gio.AppInfo

Methods

  • Gets the default application for handling URIs with the given URI scheme.

    A URI scheme is the initial part of the URI, up to but not including the :. For example, http, ftp or sip.

    Parameters

    • uri_scheme: string

      a string containing a URI scheme.

    Returns Gio.AppInfo

  • Gets a list of fallback Gio.AppInfos for a given content type, i.e. those applications which claim to support the given content type by MIME type subclassing and not directly.

    Parameters

    • content_type: string

      the content type to find a Gio.AppInfo for

    Returns Gio.AppInfo[]

  • Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detect the type of the file if required.

    The D-Bus–activated applications don’t have to be started if your application terminates too soon after this function. To prevent this, use Gio.AppInfo.launch_default_for_uri_async instead.

    Parameters

    Returns boolean