AppInfo
Object Hierarchy:
Description:
public interface AppInfo :
Object
Application Information interface, for operating system portability.
Namespace: GLib
Package: gio-2.0
Content:
Static methods:
-
public static weak AppInfo create_from_commandline (string commandline, string? application_name, AppInfoCreateFlags flags) throws Error
Creates a new AppInfo from the given information.
-
public static List<AppInfo> get_all ()
Gets a list of all of the applications currently registered on this system.
-
public static List<AppInfo> get_all_for_type (string content_type)
Gets a list of all GAppInfos for a given content type.
-
public static weak AppInfo get_default_for_type (string content_type, bool must_support_uris)
Gets the AppInfo that corresponds to a given content
type.
-
public static weak AppInfo get_default_for_uri_scheme (string uri_scheme)
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".
-
public static unowned List get_fallback_for_type (string content_type)
Gets a list of fallback GAppInfos for a given content type, i.e. those applications which
claim to support the given content type by MIME type subclassing and not directly.
-
public static unowned List get_recommended_for_type (string content_type)
Gets a list of recommended GAppInfos for a given content type, i.e. those applications
which claim to support the given content type exactly, and not by MIME type subclassing. Note that the first application of the list
is the last used one, i.e. the last one for which
set_as_last_used_for_type has been called.
-
public static bool launch_default_for_uri (string uri, AppLaunchContext? launch_context) throws Error
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.
-
public static void reset_type_associations (string content_type)
Methods:
-
public abstract bool add_supports_type (string content_type) throws Error
Adds a content type to the application information to indicate the application is capable of opening
files with the given content type.
-
public abstract bool can_delete ()
Obtains the information whether the AppInfo can be
deleted. See delete.
-
public abstract bool can_remove_supports_type ()
Checks if a supported content type can be removed from an application.
-
public bool delete ()
-
public abstract bool do_delete ()
-
public abstract weak AppInfo dup ()
-
public abstract bool equal (AppInfo appinfo2)
-
public abstract unowned string get_commandline ()
Gets the commandline with which the application will be started.
-
public abstract unowned string get_description ()
Gets a human-readable description of an installed application.
-
public abstract unowned string get_display_name ()
Gets the display name of the application. The display name is often more descriptive to the user than
the name itself.
-
public abstract unowned string get_executable ()
Gets the executable's name for the installed application.
-
public abstract weak Icon get_icon ()
Gets the icon for the application.
-
public abstract unowned string get_id ()
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.
-
public abstract unowned string get_name ()
Gets the installed name of the application.
-
public abstract bool launch (List<File>? files, AppLaunchContext? launch_context) throws Error
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.
-
public abstract bool launch_uris (List<string>? uris, AppLaunchContext launch_context) throws Error
Launches the application. This passes the 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.
-
public abstract bool remove_supports_type (string content_type) throws Error
Removes a supported type from an application, if possible.
-
public abstract bool set_as_default_for_extension (string extension) throws Error
Sets the application as the default handler for the given file extension.
-
public abstract bool set_as_default_for_type (string content_type) throws Error
Sets the application as the default handler for a given type.
-
public abstract bool set_as_last_used_for_type (string content_type) throws Error
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
get_recommended_for_type, regardless of the default application for that content type.
-
public abstract bool should_show ()
Checks if the application info should be shown in menus that list available applications.
-
public abstract bool supports_files ()
Checks if the application accepts files as arguments.
-
public abstract bool supports_uris ()
Checks if the application supports reading files and directories from URIs.