IntentRequest QML Type

Each instance represents an outgoing or incoming intent request. More...

Import Statement: import QtApplicationManager 2.0

Properties

Signals

Methods

Detailed Description

This type is used both in applications as well as within the System UI to represent an intent request. This type can not be instantiated directly, but will be returned by IntentClient::sendIntentRequest() (for outgoing requests to the system) and IntentHandler::requestReceived() (for incoming requests to the application)

See the IntentClient type for a short example on how to send intent requests to the system.

The IntentHandler documenatation provides an example showing the use of this type when receiving requests from the system.

Property Documentation

applicationId : string [read-only]

The id of the application which should be handling this request. Returns an empty string if no specific application was requested.

Note: Constant, valid on both sent and received requests.


broadcast : bool [read-only, since 6.5]

Only Set to true, if the received request is a broadcast.

Note: Valid only on received requests.

This property was introduced in Qt 6.5.


direction : IntentRequest::Direction [read-only]

This property describes if this instance is an outgoing or incoming intent request:

Note: Constant, valid on both sent and received requests.


errorMessage : string [read-only]

As soon as the replyReceived() signal has been emitted, this property will hold a potential error message in case the request failed.

Note: Valid only on sent requests.

See also succeeded.


intentId : string [read-only]

The requested intent id.

Note: Constant, valid on both sent and received requests.


parameters : var [read-only]

All parameters attached to the request as a JavaScript object.

Note: Constant, valid on both sent and received requests.


requestId : uuid [read-only]

Every intent request in the system gets an unique requestId assigned by the server that will be used throughout the life-time of the request in every context (requesting application, handling application and intent server).

Note: Since this requestId is generated by the server, any IntentRequest object generated by IntentClient::sendIntentRequest() will start with a null requestId. The property will be updated asynchronously once the server has assigned a new requestId to the incoming request.

Note: Constant for requests received by IntentHandlers, valid on both sent and received requests.


requestingApplicationId : string [read-only]

The id of the application which created this intent request. Returns an empty string if called from within an application context - only the server side has access to this information in IntentServerHandler::requestReceived.

Note: Constant, valid on both sent and received requests.


result : var [read-only]

As soon as the replyReceived() signal has been emitted, this property will hold the result in form of a JavaScript object in case the request succeeded.

Note: Valid only on sent requests.

See also succeeded.


succeeded : bool [read-only]

As soon as the replyReceived() signal has been emitted, this property will show if the intent request was actually successful.

Note: Valid only on sent requests.


Signal Documentation

replyReceived()

This signal gets emitted when a reply to an intent request is available. The signal handler needs to check the succeeded property to decided whether errorMessage or result are actually valid.

Note: This signal will only ever by emitted for request objects created by IntentClient::sendIntentRequest().

Note: The corresponding handler is onReplyReceived.


Method Documentation

sendErrorReply(string errorMessage)

IntentHandlers can use this function to indicate that they are unable to handle a request that they received via IntentHandler::requestReceived(), stating the reason in errorMessage.

Only either sendReply() or sendErrorReply() can be used on a single IntentRequest.

Note: This function only works for request objects received from IntentHandler::requestReceived(). It will simply do nothing on requests created by IntentClient::sendIntentRequest().

See also sendReply.


sendReply(var result)

An IntentHandler needs to call this function to send its result back to the system in reply to an request received via IntentHandler::requestReceived().

Only either sendReply() or sendErrorReply() can be used on a single IntentRequest.

Note: This function only works for request objects received from IntentHandler::requestReceived(). It will simply do nothing on requests created by IntentClient::sendIntentRequest().

See also sendErrorReply.


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