InvokeQuery
#include <bb/cascades/InvokeQuery>
Contains the query data to use in invoke items.
An InvokeQuery is used by other classes in Cascades that need to send a query to the MenuService to ask for handlers that are registered for handling certain types of data.
For more information about invocations and the Invoke framework, bb::system::InvokeManager, bb::system::InvokeAction and bb::system::InvokeTarget, bb::system::MenuManager might be good places to start.
At least one of mimeType and uri must be set. The data, invokeActionId, and invokeTargetId properties are optional (they don't need to be set). If left undefined, they will not be used to filter what handlers the Invoke framework will return.
Here's how you create an InvokeQuery using the builder pattern:
InvokeQuery* pInvokeQuery(InvokeQuery::create()
.mimeType("text/txt")
.uri("file:///path/to/my/textfile")
.invokeActionId("bb.action.OPEN"));
And here's how you create an InvokeQuery using QML:
InvokeQuery {
mimeType: "text/txt"
uri: "file:///path/to/my/textfile"
invokeActionId: "bb.action.OPEN"
}
BlackBerry 10.0.0
Inheritance
| bb::cascades::BaseObject | ||
| bb::cascades::InvokeQuery | ||
QML properties
| mimeType | : QString |
| uri | : QUrl |
| fileTransferMode | : bb::system::FileTransferMode::Type |
| perimeter | : bb::system::SecurityPerimeter::Type |
| data | : QByteArray |
| metadata | : QVariantMap |
| invokeActionId | : QString |
| invokeTargetId | : QString |
| invokerIncluded | : bool |
| objectName | : QString |
| parent | : QObject [read-only] |
QML signals
Properties Index
Public Functions Index
| ~InvokeQuery () | |
| QString | mimeType () const |
| QUrl | uri () const |
| bb::system::FileTransferMode::Type | fileTransferMode () const |
| bb::system::SecurityPerimeter::Type | perimeter () const |
| QByteArray | data () const |
| QVariantMap | metadata () const |
| QString | invokeActionId () const |
| QString | invokeTargetId () const |
| bool | invokerIncluded () const |
| Q_SLOT void | setMimeType (const QString &mimeType) |
| Q_SLOT void | setUri (const QUrl &uri) |
| Q_SLOT void | setFileTransferMode (bb::system::FileTransferMode::Type mode) |
| Q_SLOT void | setPerimeter (bb::system::SecurityPerimeter::Type perimeter) |
| Q_SLOT void | setData (const QByteArray &data) |
| void | setMetadata (const QVariantMap &metadata) |
| Q_SLOT void | setInvokeActionId (const QString &invokeActionId) |
| Q_SLOT void | setInvokeTargetId (const QString &invokeTargetId) |
| Q_SLOT void | setInvokerIncluded (bool invokerIncluded) |
| Q_SLOT void | updateQuery () |
| void | setObjectName (const QString &name) |
| virtual Q_INVOKABLE QString | toDebugString () const |
Static Public Functions Index
| Builder | create () |
Protected Functions Index
Only has inherited protected functions
| BaseObject (QObject *parent=0) |
Signals Index
| void | mimeTypeChanged (const QString &mimeType) |
| void | uriChanged (const QUrl &uri) |
| void | fileTransferModeChanged (bb::system::FileTransferMode::Type newFileTransferMode) |
| void | perimeterChanged (bb::system::SecurityPerimeter::Type newPerimeter) |
| void | dataChanged (const QByteArray &data) |
| void | metadataChanged (const QVariantMap &metadata) |
| void | invokeActionIdChanged (const QString &invokeActionId) |
| void | invokeTargetIdChanged (const QString &invokeTargetId) |
| void | invokerIncludedChanged (bool invokerIncluded) |
| void | queryChanged () |
| void | creationCompleted () |
| void | objectNameChanged (const QString &objectName) |
Properties
QString
Identifies the MIME type of the data to operate on.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is mandatory if uri is not set. If uri is set this property is optional.
BlackBerry 10.0.0
QUrl
Identifies the data to operate on.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is mandatory if mimeType is not set. If mimeType is set this property is optional.
BlackBerry 10.0.0
bb::system::FileTransferMode::Type
The mode to be used for transferring the file pointed to by the uri.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
The default value of this property is bb::system::FileTransferMode::Unspecified.
This property is optional.
BlackBerry 10.0.0
bb::system::SecurityPerimeter::Type
The security perimeter in which the selected action is to be invoked.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
The default value of this property is bb::system::SecurityPerimeter::Default.
This property is optional.
BlackBerry 10.0.0
QVariant
Arbitrary data to be used by the query.
This property holds a blob of data to send as part of the query. For example, the blob could be a line of text or other data that can be parsed and interpreted in the query.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is optional.
Its default value is an empty QVariant.
BlackBerry 10.0.0
QVariantMap
The metadata used when querying for an action/target.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is optional.
BlackBerry 10.0.0
QString
The ID of the invoke action to query for.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is optional.
BlackBerry 10.0.0
QString
The ID of the invoke target to query for.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is optional.
BlackBerry 10.0.0
bool
Indicates whether to include the invoking application itself as a potential target.
The default value is false, meaning the invoking application itself will not be considered as a potential target for this query.
If this property is changed, a call to updateQuery() is needed to trigger a re-query to MenuService with the changed parameter content.
This property is optional.
BlackBerry 10.0.0
QString
This property is overridden from QObject.
As the objectName property is overridden from the QObject class, this signal will not be emitted if setObjectName() function is called directly on QObject.
The default value of this property is QString::null.
QObject::objectName().
BlackBerry 10.0.0
QObject
A read-only property that represents this object's parent.
The parent of an object is specified using QObject::setParent(QObject*). The purpose of the property is to expose the object's parent to QML.
This property is read-only to prevent modifications from QML, where typically the parent is declaratively set. In C++ code, the parent can be explicitly set using QObject::setParent(QObject*), or implicitly set by adding it to a visual container.
The default value of this property is 0.
BlackBerry 10.0.0
Public Functions
Destructor.
QString
The data MIME type of this query.
The data MIME type of this query.
BlackBerry 10.0.0
bb::system::FileTransferMode::Type
The file transfer mode used during invocation.
The file transfer mode of this query.
BlackBerry 10.0.0
bb::system::SecurityPerimeter::Type
The security perimeter in which the selected action is to be invoked.
The security perimeter of this query.
BlackBerry 10.0.0
QByteArray
Gets the data to be used in a query by this InvokeQuery.
The data to be used in a query by this InvokeQuery.
BlackBerry 10.0.0
QVariantMap
Gets the metadata to be used in a query by this InvokeQuery.
The metadata used in a query by this InvokeQuery.
BlackBerry 10.0.0
bool
Flag indicating if invoking application shall be included in query result or not.
True if invoking application is to be included in query result, false otherwise.
BlackBerry 10.0.0
Q_SLOT void
Sets the data MIME type of this query.
| Parameters | |
|---|---|
| mimeType |
The new data MIME type of this query. |
BlackBerry 10.0.0
Q_SLOT void
Sets the data URI of this query.
| Parameters | |
|---|---|
| uri |
The new data URI of this query. |
BlackBerry 10.0.0
Q_SLOT void
Sets the file transfer mode to be used during invocation.
| Parameters | |
|---|---|
| mode |
The file transfer mode to be used during invocation. |
BlackBerry 10.0.0
Q_SLOT void
Sets the security perimeter to be used during invocation.
| Parameters | |
|---|---|
| perimeter |
The security perimeter to be used during invocation. |
BlackBerry 10.0.0
Q_SLOT void
Sets the data to be used in a query by this InvokeQuery.
| Parameters | |
|---|---|
| data |
The data to be used in a query by this InvokeQuery. |
BlackBerry 10.0.0
void
Sets the metadata to be used in a query by this InvokeQuery.
| Parameters | |
|---|---|
| metadata |
The metadata to be used in a query by this InvokeQuery. |
BlackBerry 10.0.0
Q_SLOT void
Gets the data to be used in a query by this InvokeQuery.
| Parameters | |
|---|---|
| invokeActionId |
The new action ID of this query. |
BlackBerry 10.0.0
Q_SLOT void
Sets the target ID of this query.
| Parameters | |
|---|---|
| invokeTargetId |
The new target ID of this query. |
BlackBerry 10.0.0
Q_SLOT void
Sets flag indicating if invoking application shall be included in query result or not.
| Parameters | |
|---|---|
| invokerIncluded |
Set to true for invoking application to be included in query result. |
BlackBerry 10.0.0
Q_SLOT void
Tell holding class InvokeQuery is updated.
Use updateQuery to tell the holding class that the InvokeQuery has been updated. The holding class will use the new properties in a re-query to MenuService and replace the previous result with the new result.
The preferred way of usage is to make all the needed property changes before calling updateQuery.
Below is a small example on how to trigger a new query on changed properties.
InvokeActionItem {
id: iai
query {
mimeType: "image/png"
onQueryChanged: iai.query.updateQuery()
}
}
BlackBerry 10.0.0
void 
Sets the objectName property.
| Parameters | |
|---|---|
| name |
The new name for the object. |
BlackBerry 10.0.0
virtual Q_INVOKABLE QString 
Returns a debug string representing this object.
A debug string for the object.
BlackBerry 10.0.0
Static Public Functions
Builder
Creates and returns a builder for constructing an InvokeQuery.
InvokeQuery* pInvokeQuery(InvokeQuery::create()
.uri("file:///mytextfile")
.invokeActionId("bb.action.OPEN"));
A builder used for constructing an InvokeQuery.
BlackBerry 10.0.0
Protected Functions
(Only has inherited protected functions)
Constructs an instance of BaseObject's subclass.
| Parameters | |
|---|---|
| parent |
An optional parent, defaults to 0. |
BlackBerry 10.0.0
Signals
void
Emitted when MIME type has been changed.
| Parameters | |
|---|---|
| mimeType |
The new mimeType set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when uri has been changed.
| Parameters | |
|---|---|
| uri |
The new uri set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when file transfer mode has been changed.
Due to a work around for a Qt Core issue with accessing enums from QML the argument of this signal doesn't follow naming convention for signals in which the signal arguments are typically named to match the associated property's name. Use the object's property to access current property value instead of the signal argument to avoid runtime errors (i.e. use fileTransferMode instead of newFileTransferMode).
| Parameters | |
|---|---|
| newFileTransferMode |
The new file transfer mode set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when perimeter has been changed.
Due to a work around for a Qt Core issue with accessing enums from QML the argument of this signal doesn't follow naming convention for signals in which the signal arguments are typically named to match the associated property's name. Use the object's property to access current property value instead of the signal argument to avoid runtime errors (i.e. use perimeter instead of newPerimeter).
| Parameters | |
|---|---|
| newPerimeter |
The new perimeter set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when data property has been changed.
| Parameters | |
|---|---|
| data |
The new data property set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when metadata has been changed.
| Parameters | |
|---|---|
| metadata |
The new metadata set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when invoke action id has been changed.
| Parameters | |
|---|---|
| invokeActionId |
The new invoke action id set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when invoke target id has been changed.
| Parameters | |
|---|---|
| invokeTargetId |
The new invoke target id set to be used by updateQuery. |
BlackBerry 10.0.0
void
Emitted when invokerIncluded has been changed.
| Parameters | |
|---|---|
| invokerIncluded |
The new value of invokerIncluded property. |
BlackBerry 10.0.0
void
Convenience signal emitted when any one of the properties has been changed.
BlackBerry 10.0.0
void 
This signal is emitted only when this object is instantiated as a result of loading a QML document and creating the root node, or when an object is being constructed using its builder class.
This signal is emitted only when this object is instantiated as a result of loading a QML document and creating the root node (only after the root component that caused this instantiation has completed construction), or when the object is being constructed from its builder class. This signal is emitted to indicate that the construction and initialization of the object has been completed, the properties are initialized, and any QML binding values have been assigned to the object.
This signal is not emitted when the object is constructed from C++ using the constructor. If the object is constructed using its builder class, the signal is emitted when the the builder class returns the fully constructed object.
This signal can be used when there is an activity that needs to be performed, such as a property state integrity verification after the object is instantiated from a QML document or a builder, but before control is returned to the application.
BlackBerry 10.0.0
void 
This signal is emitted when the objectName property is changed.
BlackBerry 10.0.0