Interface

Gio-2.0GioAppInfoInterface

Interface for implementing AppInfo. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_add_supports_type(content_type: string): boolean;
    vfunc_can_delete(): boolean;
    vfunc_can_remove_supports_type(): boolean;
    vfunc_do_delete(): boolean;
    vfunc_dup(): Gio.AppInfo;
    vfunc_equal(appinfo2: Gio.AppInfo): boolean;
    vfunc_get_commandline(): string;
    vfunc_get_description(): string;
    vfunc_get_display_name(): string;
    vfunc_get_executable(): string;
    vfunc_get_icon(): Gio.Icon;
    vfunc_get_id(): string;
    vfunc_get_name(): string;
    vfunc_get_supported_types(): string[];
    vfunc_launch(files?: Gio.File[], context?: Gio.AppLaunchContext): boolean;
    vfunc_launch_uris(uris?: string[], context?: Gio.AppLaunchContext): boolean;
    vfunc_launch_uris_async(
        uris?: string[],
        context?: Gio.AppLaunchContext,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.AppInfo.Interface>,
    ): void;
    vfunc_launch_uris_finish(result: Gio.AsyncResult): boolean;
    vfunc_remove_supports_type(content_type: string): boolean;
    vfunc_set_as_default_for_extension(extension: string): boolean;
    vfunc_set_as_default_for_type(content_type: string): boolean;
    vfunc_set_as_last_used_for_type(content_type: string): boolean;
    vfunc_should_show(): boolean;
    vfunc_supports_files(): boolean;
    vfunc_supports_uris(): boolean;
}

Hierarchy (View Summary)

Index

Methods

  • Adds a content type to the application information to indicate the application is capable of opening files with the given content type.

    Parameters

    • content_type: string

      a string.

    Returns boolean

  • Checks if a supported content type can be removed from an application.

    Returns boolean

  • Checks if two Gio.AppInfos are equal.

    Note that the check may not compare each individual field, and only does an identity check. In case detecting changes in the contents is needed, program code must additionally compare relevant fields.

    Parameters

    Returns boolean

  • Gets the commandline with which the application will be started.

    Returns string

  • Gets a human-readable description of an installed application.

    Returns string

  • Gets the display name of the application. The display name is often more descriptive to the user than the name itself.

    Returns string

  • Gets the executable’s name for the installed application.

    This is intended to be used for debugging or labelling what program is going to be run. To launch the executable, use Gio.AppInfo.launch and related functions, rather than spawning the return value from this function.

    Returns string

  • 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.

    Note that the returned ID may be NULL, depending on how the appinfo has been constructed.

    Returns string

  • Retrieves the list of content types that app_info claims to support. If this information is not provided by the environment, this function will return NULL.

    This function does not take in consideration associations added with Gio.AppInfo.add_supports_type, but only those exported directly by the application.

    Returns string[]

  • Launches the application. Passes files to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly.

    To launch the application without arguments pass a NULL files list.

    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.

    Some URIs can be changed when passed through a GFile (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 Gio.AppInfo.launch_uris instead.

    The launched application inherits the environment of the launching process, but it can be modified with Gio.AppLaunchContext.setenv and Gio.AppLaunchContext.unsetenv.

    On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE environment variable with the path of the launched desktop file and GIO_LAUNCHED_DESKTOP_FILE_PID to the process id of the launched process. This can be used to ignore GIO_LAUNCHED_DESKTOP_FILE, should it be inherited by further processes. The DISPLAY, XDG_ACTIVATION_TOKEN and DESKTOP_STARTUP_ID environment variables are also set, based on information provided in context.

    Parameters

    Returns boolean

  • Launches the application. This passes the uris to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly. If the application only supports one URI per invocation as part of their command-line, multiple instances of the application will be spawned.

    To launch the application without arguments pass a NULL uris list.

    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.

    Parameters

    • Optionaluris: string[]

      a list of URIs to launch.

    • Optionalcontext: Gio.AppLaunchContext

      the launch context

    Returns boolean

  • Removes a supported type from an application, if possible.

    Parameters

    • content_type: string

      a string.

    Returns boolean

  • Sets the application as the default handler for the given file extension.

    Parameters

    • extension: string

      a string containing the file extension (without the dot).

    Returns boolean

  • Sets the application as the default handler for a given type.

    Parameters

    • content_type: string

      the content type.

    Returns boolean

  • Sets the application as the last used application for a given type. This will make the application appear as first in the list returned by Gio.AppInfo.get_recommended_for_type, regardless of the default application for that content type.

    Parameters

    • content_type: string

      the content type.

    Returns boolean

  • Checks if the application info should be shown in menus that list available applications.

    Returns boolean

  • Checks if the application accepts files as arguments.

    Returns boolean

  • Checks if the application supports reading files and directories from URIs.

    Returns boolean