DesktopAppInfo

open class DesktopAppInfo(pointer: <Error class: unknown class><<Error class: unknown class>>) : AppInfo

#GDesktopAppInfo is an implementation of #GAppInfo based on desktop files.

Note that <gio/gdesktopappinfo.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

Skipped during bindings generation

  • parameter length: length: Out parameter is not supported

  • parameter pid_callback: DesktopAppLaunchCallback

  • parameter pid_callback: DesktopAppLaunchCallback

  • function search: Nested array types are not supported

Constructors

Link copied to clipboard
constructor(desktopId: String)

Creates a new #GDesktopAppInfo based on a desktop file id.

constructor(keyFile: <Error class: unknown class>)

Creates a new #GDesktopAppInfo.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val filename: String?

The origin filename of this #GDesktopAppInfo

Link copied to clipboard
open override val gioAppInfoPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gioDesktopAppInfoPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun addSupportsType(contentType: String): <Error class: unknown class><Boolean>

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

Link copied to clipboard
open fun canDelete(): Boolean

Obtains the information whether the #GAppInfo can be deleted. See g_app_info_delete().

Link copied to clipboard

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

Link copied to clipboard
open fun delete(): Boolean

Tries to delete a #GAppInfo.

Link copied to clipboard
open fun dup(): AppInfo

Creates a duplicate of a #GAppInfo.

Link copied to clipboard
open fun equal(appinfo2: AppInfo): Boolean

Checks if two #GAppInfos are equal.

Link copied to clipboard
open fun getActionName(actionName: String): String

Gets the user-visible display name of the "additional application action" specified by @action_name.

Link copied to clipboard
open fun getBoolean(key: String): Boolean

Looks up a boolean value in the keyfile backing @info.

Link copied to clipboard
open fun getCategories(): String?

Gets the categories from the desktop file.

Link copied to clipboard
open fun getCommandline(): String?

Gets the commandline with which the application will be started.

Link copied to clipboard
open fun getDescription(): String?

Gets a human-readable description of an installed application.

Link copied to clipboard

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

Link copied to clipboard
open fun getExecutable(): String

Gets the executable's name for the installed application.

Link copied to clipboard
open fun getFilename(): String?

When @info was created from a known filename, return it. In some situations such as the #GDesktopAppInfo returned from g_desktop_app_info_new_from_keyfile(), this function will return null.

Link copied to clipboard
open fun getGenericName(): String?

Gets the generic name from the desktop file.

Link copied to clipboard
open fun getIcon(): Icon?

Gets the icon for the application.

Link copied to clipboard
open fun getId(): 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.

Link copied to clipboard
open fun getIsHidden(): Boolean

A desktop file is hidden if the Hidden key in it is set to True.

Link copied to clipboard
open fun getKeywords(): List<String>

Gets the keywords from the desktop file.

Link copied to clipboard
open fun getLocaleString(key: String): String?

Looks up a localized string value in the keyfile backing @info translated to the current locale.

Link copied to clipboard
open fun getName(): String

Gets the installed name of the application.

Link copied to clipboard
open fun getNodisplay(): Boolean

Gets the value of the NoDisplay key, which helps determine if the application info should be shown in menus. See %G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().

Link copied to clipboard
open fun getShowIn(desktopEnv: String? = null): Boolean

Checks if the application info should be shown in menus that list available applications for a specific name of the desktop, based on the OnlyShowIn and NotShowIn keys.

Link copied to clipboard

Retrieves the StartupWMClass field from @info. This represents the WM_CLASS property of the main window of the application, if launched through @info.

Link copied to clipboard
open fun getString(key: String): String?

Looks up a string value in the keyfile backing @info.

Link copied to clipboard

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 g_app_info_add_supports_type(), but only those exported directly by the application.

Link copied to clipboard
open fun hasKey(key: String): Boolean

Returns whether @key exists in the "Desktop Entry" group of the keyfile backing @info.

Link copied to clipboard
open fun launch(files: <Error class: unknown class>? = null, context: AppLaunchContext? = null): <Error class: unknown class><Boolean>

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.

Link copied to clipboard
open fun launchAction(actionName: String, launchContext: AppLaunchContext? = null)

Activates the named application action.

Link copied to clipboard
open fun launchUris(uris: <Error class: unknown class>? = null, context: AppLaunchContext? = null): <Error class: unknown class><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.

Link copied to clipboard
open fun launchUrisAsync(uris: <Error class: unknown class>? = null, context: AppLaunchContext? = null, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Async version of g_app_info_launch_uris().

Link copied to clipboard
open fun launchUrisFinish(result: AsyncResult): <Error class: unknown class><Boolean>

Finishes a g_app_info_launch_uris_async() operation.

Link copied to clipboard
open fun listActions(): List<String>

Returns the list of "additional application actions" supported on the desktop file, as per the desktop file specification.

Link copied to clipboard
open fun removeSupportsType(contentType: String): <Error class: unknown class><Boolean>

Removes a supported type from an application, if possible.

Link copied to clipboard
open fun setAsDefaultForExtension(extension: String): <Error class: unknown class><Boolean>

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

Link copied to clipboard
open fun setAsDefaultForType(contentType: String): <Error class: unknown class><Boolean>

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

Link copied to clipboard
open fun setAsLastUsedForType(contentType: String): <Error class: unknown class><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 g_app_info_get_recommended_for_type(), regardless of the default application for that content type.

Link copied to clipboard
open fun shouldShow(): Boolean

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

Link copied to clipboard

Checks if the application accepts files as arguments.

Link copied to clipboard
open fun supportsUris(): Boolean

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