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

[read-only] applicationId : string

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.


[read-only] direction : IntentRequest::Direction

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

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


[read-only] errorMessage : string

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.


[read-only] intentId : string

The requested intent id.

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


[read-only] parameters : var

All parameters attached to the request as a JavaScript object.

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


[read-only] requestId : uuid

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.


[read-only] requestingApplicationId : string

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.


[read-only] result : var

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.


[read-only] succeeded : bool

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.


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