InvokeRequest
#include <bb/system/InvokeRequest>
To link against this class, add the following line to your .pro file: LIBS += -lbbsystem
Encapsulates a request to invoke a remote application, card or service.
Clients send invoke messages to a target by creating an instance of InvokeRequest, populating it with data, and passing the object to InvokeManager::invoke(). An invoke messages must contain a MIME type. All other fields are optional.
Targets handle invoke messages by connecting to the InvokeManager::invoked() signal and parsing the InvokeRequest object passed to their slot.
Invoke requests can also belong to a specific invoke list. When the target of an invoke request belongs to a invoke list, then the user will be able to navigate among the list targets using gestures and keyboard shortcuts (bb::system::InvokeManager for more details).
BlackBerry 10.0.0
Public Functions Index
| InvokeRequest () | |
| InvokeRequest (const InvokeRequest &other) | |
| ~InvokeRequest () | |
| InvokeRequest & | operator= (const InvokeRequest &other) |
| bb::system::InvokeSource | source () const |
| QString | target () const |
| QString | action () const |
| QString | mimeType () const |
| QUrl | uri () const |
| bb::system::FileTransferMode::Type | fileTransferMode () const |
| bb::system::InvokeTarget::Types | targetTypes () const |
| QByteArray | data () const |
| QVariantMap | metadata () const |
| bb::system::SecurityPerimeter::Type | perimeter () const |
| int | listId () const |
| void | setTarget (const QString &name) |
| void | setAction (const QString &name) |
| void | setMimeType (const QString &type) |
| void | setUri (const QUrl &uri) |
| void | setUri (const QString &uri) |
| void | setUri (const char *uri) |
| void | setFileTransferMode (bb::system::FileTransferMode::Type fileTransferMode) |
| void | setData (const QByteArray &data) |
| void | setMetadata (const QVariantMap &metadata) |
| void | setPerimeter (bb::system::SecurityPerimeter::Type perimeter) |
| void | setListId (int listId) |
| void | setTargetTypes (bb::system::InvokeTarget::Types types) |
Public Functions
Creates a copy of an existing InvokeRequest object.
| Parameters | |
|---|---|
| other |
The source InvokeRequest object to copy. |
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
InvokeRequest &
Copies the data of an existing InvokeRequest object to this object.
| Parameters | |
|---|---|
| other |
The source InvokeRequest object to copy. |
The InvokeRequest instance.
BlackBerry 10.0.0
bb::system::InvokeSource
Returns the source of this request.
This property is set when the application receives an invocation request.
The source of the request.
BlackBerry 10.0.0
QString
Returns the identity of the receiver as stated in its BAR manifest file.
If omitted, the invocation service performs brokering to find the most appropriate target for the action and MIME type in this invocation request.
Required: NO.
The identity of the receiver or an empty string if invocation service should perform brokering.
BlackBerry 10.0.0
QString
Returns the operation the client is asking the target to perform.
Valid values are target-specific. If omitted, the invocation service or target will choose an appropriate action based on the MIME type.
Required: NO.
The operation the client is asking the target to perform or an empty string if the invocation service or target should choose an appropriate action.
BlackBerry 10.0.0
QString
Returns the format of the data sent to the target.
The MIME type must be a valid Internet media type, such as "image/png".
Required: YES.
The Internet media type of the data.
BlackBerry 10.0.0
QUrl
Returns the uniform resource identifier (URI) sent to the target.
If omitted, the MIME type, action, and/or data are sufficient for the target to do its work.
Required: NO.
The uniform resource identifier (URI) sent to the target or an empty URI if the target does not require a URI.
BlackBerry 10.0.0
bb::system::FileTransferMode::Type
Returns the file transfer mode for this request.
The file transfer mode controls how a file specified by the URI in an invocation request (if present) is transferred to the target.
If omitted, the default transfer mode will apply.
Required: NO.
The file transfer mode for this request. See bb::system::FileTransferMode for the list of file transfer modes.
BlackBerry 10.0.0
bb::system::InvokeTarget::Types
Returns the class of targets that will be considered for an unbound invocation.
Required: NO.
bb::system::InvokeTarget::Type for the list of individual target types.
targetTypes() only applies to the InvokeRequest sent to the invocation framework. It is not available in the InvokeRequest received by the invoked target.
The class of targets that will be considered for an unbound invocation.
BlackBerry 10.0.0
QByteArray
Returns the binary data sent to the target.
Valid values are target-specific. If omitted, the specified MIME type, action, and URI must be sufficient for the target to complete the request.
Required: NO.
The binary data sent to the target or an empty array if the target does not require any data.
BlackBerry 10.0.0
QVariantMap
Returns the metadata sent to the target.
Metadata is optional and can be included to pass additional information to the target. It will be encoded as a JSON object and sent to the target.
Required: NO.
The metadata.
BlackBerry 10.0.0
bb::system::SecurityPerimeter::Type
Returns the security perimeter requested for the target.
Required: NO.
The security perimeter for the request. See bb::system::SecurityPerimeter for the list of perimeters.
BlackBerry 10.0.0
int
Returns the list that this request belongs to.
Requests can belong to lists that are navigable. This allows the user to navigate to the previous and next items in the list.
Required: NO.
The list the request belongs to or 0 if the request should not belong to a list.
BlackBerry 10.2.0
void
Sets the identity of the receiver as stated in its BAR manifest.
If omitted, the invocation service performs brokering to find the most appropriate target for the action and MIME type in this invocation request.
Required: NO.
| Parameters | |
|---|---|
| name |
The identity of the receiver or an empty string if invocation service should perform brokering. |
BlackBerry 10.0.0
void
Sets the operation the client is asking the target to perform.
Valid values are target-specific. If omitted, the invocation service or target will choose an appropriate action based on the MIME type.
Required: NO.
| Parameters | |
|---|---|
| name |
The operation the client is asking the target to perform or an empty string if the invocation service or target should choose an appropriate action. |
BlackBerry 10.0.0
void
Sets the format of the data sent to the target.
The MIME type must be a valid Internet media type, such as "image/png".
Required: YES.
| Parameters | |
|---|---|
| type |
The Internet media type of the data. |
BlackBerry 10.0.0
void
Sets the uniform resource identifier (URI) sent to the target.
If omitted, the specified MIME type, action, and data must be sufficient for the target to do its work.
For URIs to local files, consider using QUrl::fromLocalFile() to construct a QUrl instance.
| Parameters | |
|---|---|
| uri |
The uniform resource identifier (URI) sent to the target or an empty URI if the target does not require a URI. |
BlackBerry 10.0.0
void
Sets the uniform resource identifier (URI) sent to the target.
If omitted, the specified MIME type, action, and data must be sufficient for the target to do its work.
Use this method to pass a URI that is in human-readable format.
,QUrl(const QString&) will be used for constructing the URI.
| Parameters | |
|---|---|
| uri |
A string representing the uniform resource identifier (URI) sent to the target, or an empty string if the target does not require a URI. |
BlackBerry 10.0.0
void
Sets the uniform resource identifier (URI) sent to the target.
If omitted, the specified MIME type, action, and data must be sufficient for the target to do its work.
Use this method to pass a URI that is in human-readable format in UTF-8 encoding.
,QUrl(const QString&) will be used for constructing the URI.
| Parameters | |
|---|---|
| uri |
A character array representing the uniform resource identifier (URI) sent to the target, or an empty character array if the target does not require a URI. |
BlackBerry 10.0.0
void
Sets the file transfer mode for the request.
The file transfer mode controls how a file specified by the URI in an invocation request (if present) is transferred to the target.
Required: NO.
| Parameters | |
|---|---|
| fileTransferMode |
The file transfer mode for this request. See bb::system::FileTransferMode for the list of file transfer modes. |
BlackBerry 10.0.0
void
Sets the binary data sent to the target.
Valid values are target-specific. If omitted, the specified MIME type, action and URI must be sufficient for the target to complete the request.
Required: NO.
| Parameters | |
|---|---|
| data |
The binary data sent to the target or an empty array if the target does not require any data. |
BlackBerry 10.0.0
void
Sets the metadata sent to the target.
Metadata is optional and can be included to pass additional information to the target. It will be encoded as a JSON object and sent to the target.
Required: NO.
| Parameters | |
|---|---|
| metadata |
The metadata to be sent to the target. |
BlackBerry 10.0.0
void
Sets the security perimeter in which the target should be invoked.
Required: NO.
The service can override this value to invoke the target in the same perimeter as the calling application based on its permissions.
| Parameters | |
|---|---|
| perimeter |
The security perimeter for the invoked target. See bb::system::SecurityPerimeter for the list of valid values. |
BlackBerry 10.0.0
void
Sets the list that this request belongs to.
Requests can belong to lists that are navigable. This allows the user to navigate to the previous and next items in the list. bb::system::InvokeManager includes signals and functions that allow for list operations.
The invoke target must have a list-compatible bb::system::InvokeTarget::Type for list navigation to be enabled. bb::system::InvokeTarget::Card is currently the only list-enabled type.
,An application can have only one currently active list.
| Parameters | |
|---|---|
| listId |
The list the request belongs to or 0 if the request should not belong to a list. |
BlackBerry 10.2.0
void
Sets the class of targets that will be considered for an unbound invocation.
Required: NO.
targetTypes() only applies to the InvokeRequest sent to the invocation framework. It is not available in the InvokeRequest received by the invoked target.
| Parameters | |
|---|---|
| types |
The class of targets that will be considered for an unbound invocation. See bb::system::InvokeTarget::Type for the list of individual target types. |
BlackBerry 10.0.0