InvokeTargetFilter
#include <bb/system/InvokeTargetFilter>
To link against this class, add the following line to your .pro file: LIBS += -lbbsystem
Describes the kinds of unbound invocations supported by a target.
Through unbound invocation a target will only receive invocations that match one of its filters. A filter describes the action/MIME type/URI combinations for which the target supports unbound invocation.
- The filter must contain at least one valid action in actionList(). An action can be up to 50 characters based on the following grammar:
action: <domain><sub-domain>
domain: [a-zA-Z] ([a-zA-Z0-9_])*
sub-domain: NUL | .<domain><sub-domain>
An example action is "bb.action.VIEW". This maps to the "actions" attribute of an Invoke-Target-Filter as defined in the BAR manifest.
- The filter must contain at least one valid MIME type in mimeTypeList(). A valid MIME type is of the form:
mimetype: type subtype
type: [a-zA-Z0-9_]+
subtype: NUL | / [a-zA-Z0-9_-.+]+
A MIME type may include wildcards for the complete type (e.g., "*") or for the subtype only (e.g., "image/*"). The MIME type maps to the "types" attribute of an Invoke-Target-Filter as defined in the BAR manifest.
The filter may contain a list of URI prefixes in uriList() which can be used as criteria to match the URI in the invocation request (e.g., "file://", "http://localhost:port", or "file://specific/path/"). This maps to the "uris" attribute of an Invoke-Target-Filter as defined in the BAR manifest. If no URIs are specified then the in-band URI ("data://local") is implied.
The filter may contain a list of supported file extensions in fileExtensionList() that must be suffix of the path to be a match (e.g. "jpg"). This maps to the "exts" attribute of an Invoke-Target-Filter as defined in the BAR manifest.
Note that the file extensions are only applied if the scheme of the accompanying URI is "file://". Also note that combining file extensions and specific MIME types in a filter means both must be specified by a client for the filter to match. This can also work if the extension is for a known MIME type where the invocation framework will perform type inference. However, for most cases it is best to have the "exts" filter as a separate Target-Invoke-Filter declaration in the BAR manifest file that accepts any file of any MIME type (that is, the filter should include "uris=file://;types=*;" so the only filtering criteria will be the file extensions in the "exts" attribute).
An example of an invoke target filter, as defined in a BAR manifest, is as follows:
Invoke-Target-Filter:actions=bb.action.OPEN;types=vnd.custom.type;uris=file://;exts=acme;
BlackBerry 10.0.0
Public Functions Index
| InvokeTargetFilter () | |
| InvokeTargetFilter (const InvokeTargetFilter &other) | |
| ~InvokeTargetFilter () | |
| InvokeTargetFilter & | operator= (const InvokeTargetFilter &other) |
| QStringList | actionList () const |
| bool | addAction (const QString &action) |
| void | removeAction (const QString &action) |
| QStringList | mimeTypeList () const |
| bool | addMimeType (const QString &mimeType) |
| void | removeMimeType (const QString &mimeType) |
| QStringList | uriList () const |
| void | addUri (const QString &uri) |
| void | removeUri (const QString &uri) |
| QStringList | fileExtensionList () const |
| void | addFileExtension (const QString &fileExtension) |
| void | removeFileExtension (const QString &fileExtension) |
| QStringList | customAttributeNames () const |
| QStringList | customAttributeList (const QString &customAttribute) const |
| void | addCustomAttributeValue (const QString &customAttribute, const QString &attributeValue) |
| void | removeCustomAttributeValue (const QString &customAttribute, const QString &attributeValue) |
| void | removeCustomAttribute (const QString &customAttribute) |
| bool | isValid () const |
Public Functions
Creates a copy of an existing InvokeTargetFilter object.
| Parameters | |
|---|---|
| other |
The source InvokeTargetFilter object to copy. |
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
InvokeTargetFilter &
Copies the data of an existing InvokeTargetFilter object to this object.
| Parameters | |
|---|---|
| other |
The source InvokeTargetFilter object to copy. |
The InvokeTargetFilter instance.
BlackBerry 10.0.0
bool
Adds an action to the action list.
action: <domain><sub-domain>
domain: [a-zA-Z] ([a-zA-Z0-9_])*
sub-domain: NUL | .<domain><sub-domain>
| Parameters | |
|---|---|
| action |
The action to add. If the action is already in the list, it is not added again. |
Returns true if the action was added; false otherwise. An action is rejected if it is invalid (it is too long or does not match the grammar) or if it is already in the list.
BlackBerry 10.0.0
void
Removes an action from the action list.
| Parameters | |
|---|---|
| action |
The action to remove. |
BlackBerry 10.0.0
QStringList
Returns the list of MIME types.
The list of MIME types.
BlackBerry 10.0.0
bool
Adds a MIME type to the MIME type list.
mimeType: type subtype
type: [a-zA-Z0-9_]+
subtype: NUL | / [a-zA-Z0-9_-.+]+
| Parameters | |
|---|---|
| mimeType |
The MIME type to add. If the MIME type is already in the list, it is not added again. |
Returns true if the supplied MIME type was added to the list, false otherwise. A MIME type is rejected if it is invalid (it does not match the grammar) or if it is already in the list.
BlackBerry 10.0.0
void
Removes a MIME type from the MIME type list.
| Parameters | |
|---|---|
| mimeType |
The action to remove. |
BlackBerry 10.0.0
void
Adds a URI to the URI list.
| Parameters | |
|---|---|
| uri |
A string representing the URI to add. If the URI is already in the list, it is not added again. |
BlackBerry 10.0.0
void
Removes a URI from the URI list.
| Parameters | |
|---|---|
| uri |
A string representing the URI to remove. |
BlackBerry 10.0.0
QStringList
Returns the list of file extensions.
The list of file extensions.
BlackBerry 10.0.0
void
Adds a file extension to the file extension list.
| Parameters | |
|---|---|
| fileExtension |
The file extension to add. If the file extension is already in the list, it is not added again. |
BlackBerry 10.0.0
void
Removes a file extension from the file extension list.
| Parameters | |
|---|---|
| fileExtension |
The file extension to remove. |
BlackBerry 10.0.0
QStringList
Returns a list of custom attribute names of the filter.
Use addCustomAttributeValue() and removeCustomAttributeValue()to manipulate the values of the custom attributes.
The list of custom attribute names.
BlackBerry 10.0.0
QStringList
Returns the list of values for custom attribute customAttribute.
Use customAttributeNames() to retrieve the list of attribute names that can be used.
| Parameters | |
|---|---|
| customAttribute |
The name of the custom attribute for which the values are requested. |
The list of values for customAttribute.
BlackBerry 10.0.0
void
Adds attributeValue to the list of values for custom attribute customAttribute.
If attributeValue has already been added to the list for customAttribute, it will not be added again.
| Parameters | |
|---|---|
| customAttribute |
The name of the custom attribute to which to add attributeValue. |
| attributeValue |
The value to add to the list of values for customAttribute. |
BlackBerry 10.0.0
void
Removes attributeValue from the list of values for custom attribute customAttribute.
| Parameters | |
|---|---|
| customAttribute |
The name of the custom attribute from which to remove attributeValue. |
| attributeValue |
The value to remove from the list of values for customAttribute. |
BlackBerry 10.0.0
void
Removes all values associated with custom attribute customAttribute.
| Parameters | |
|---|---|
| customAttribute |
The name of the custom attribute from which to remove all attribute values. |
BlackBerry 10.0.0
bool
Returns an indication of whether this instance is valid.
An InvokeTargetFilter instance is valid if at least one action has been added and at least one MIME type has been added.
Returns true if this instance is valid, false otherwise.
BlackBerry 10.0.0