IntentObject QML Type

This type represents an Intent definition on the System UI side. More...

Import Statement: import QtApplicationManager.SystemUI 2.0

Properties

Detailed Description

Each instance of this class represents a single Intent definition for a specific application.

Most of the read-only properties map directly to values read from the package's info.yaml file - these are documented in the Manifest Definition.

Items of this type are not creatable from QML code. Only functions and properties of IntentServer and IntentModel will return pointers to this class.

Make sure to not save references to an IntentObject across function calls: packages (and with that, the intents contained within) can be deinstalled at any time, invalidating your reference. In case you do need a persistent handle, use the intentId together with the applicationId string.

Property Documentation

applicationId : string [read-only]

The id of the application responsible for handling this intent.


categories : list<string> [read-only]

A list of category names the intent should be associated with. This is mainly for displaying the intent within a fixed set of categories in the System UI. If the intent does not specify a categories list, this will return the same as the containing PackageObject::categories.


description : string [read-only]

Returns the localized description of the intent - as provided in the info.yaml file - in the currently active locale.

This property uses the same algorithm as the name property, but for the description.


descriptions : var [read-only]

Returns an object with all the language code to localized description mappings as provided in the intent's info.yaml file. If the intent does not specify a descriptions object, this will return the same as the containing PackageObject::descriptions.


handleOnlyWhenRunning : bool [read-only, since 6.5]

By default, applications are automatically started when a request is targeted at them, but they are not currently running. If this property is set to true, then any requests for this intent will only be forwarded to its handling application, if the application is actuallly running. This is useful for system-wide broadcasts that are only relevant if an application is active (e.g. changes in internet availability).

This property was introduced in Qt 6.5.


icon : url [read-only]

The URL of the intent's icon - can be used as the source property of an Image. If the intent does not specify an icon, this will return the same as the containing PackageObject::icon.


intentId : string [read-only]

The id of the intent.


name : string [read-only]

Returns the localized name of the intent - as provided in the info.yaml file - in the currently active locale.

This is a convenience property, that takes the mapping returned by the names property, and then tries to return the value for these keys if available: first the current locale's id, then en_US, then en and lastly the first available key.

If no mapping is available, this will return the intentId.


names : var [read-only]

Returns an object with all the language code to localized name mappings as provided in the intent's info.yaml file. If the intent does not specify a names object, this will return the same as the containing PackageObject::names.


packageId : string [read-only]

The id of the package that the handling application of this intent is part of.


parameterMatch : var [read-only]

A handling application can limit what parameter values it accepts. The property itself is an object that corresponds to a subset of allowed parameter object of this intent. When set, the parameters of each incoming intent request are matched against this object, following these rules:

  • a field missing from parameterMatch is ignored.
  • a field of type string specified in parameterMatch is matched as a regular expressions against the corresponding parameter value.
  • for fields of type list specified in parameterMatch, the corresponding parameter value has to match any of the values in the list (using QVariant compare).
  • any other fields in parameterMatch are compared as QVariants to the corresponding parameter value.

One example would be an open-mime-type intent that is implemented by many applications: there would be a mimeType parameter and each application could limit the requests it wants to receive by setting a parameterMatch on this mimeType parameter, e.g. { mimeType: "^image/.*\.png$" }


requiredCapabilities : list<string> [read-only]

An application requesting this intent needs to have all of the given capabilities.

See also ApplicationObject::capabilities.


visibility : IntentObject.Visibility [read-only]

The visibility of this intent for other packages.

  • IntentObject.Public - Any application can request this intent.
  • IntentObject.Private - Only applications from the same package can request this intent.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.