qnx.invoke.InvokeManager

InvokeManager

Properties | Methods | Events


Packageqnx.invoke
Classpublic class InvokeManager
InheritanceInvokeManager Inheritance flash.events.EventDispatcher

The InvokeManager is used to launch other application and viewers, as well as determine how your application was launched.

When your application or viewer is invoked, a InvokeEvent.INVOKE event will be dispatched. In your applications event handler for this event, you can check the startupMode property to determine how you were launched. If the application was invoked as a viewer, the startupViewerRequest will contain the data the application was invoked with. If the application was invoked as an application, the startupRequest will contain the data the application was invoked with. It is essential that you add the listener for the InvokeEvent.INVOKE event at the very beginning of the application. Failing to do so may result in not receiving the event.

To invoke other applications use the invoke() method. To invoke viewers inside of your application, use the invokeViewer() method. See each method for more details on how to invoke applications and viewers.



Class information:
BlackBerry 10 Version:   10.0.0



Public Properties

 PropertyDefined By
  DEBUG : Boolean = false
[static] When set to true, messages sent and recieved from the invoke framework are sent to the console.
InvokeManager
  invokeManager : InvokeManager
[static] [read-only] Gets the single instance of the InvokeManager.
InvokeManager
  startupMode : int
[read-only] The mode in which your application was started up in.
InvokeManager
  startupRequest : InvokeRequest
[read-only] The InvokeRequest instance the application was invoked with.
InvokeManager
  startupViewerRequest : InvokeViewerRequest
[read-only] The InvokeViewerRequest instance the viewer was invoked with.
InvokeManager

Public Methods

 MethodDefined By
  
InvokeManager(enforcer:SingletonEnforcer)
The constructor for this class should not be called directly.
InvokeManager
  
closeCard():void
Closes child cards from the parent application.
InvokeManager
  
getInvokeTargetFilters(invokeTarget:String):void
Retrieves the invoke target filters associated with the specified target.
InvokeManager
  
invoke(request:InvokeRequest):void
The invoke() method is used to invoke other applications.
InvokeManager
  
The invokeViewer() method is used to invoke viewers inside of your application.
InvokeManager
  
queryInvokeTargets(mimeType:String, uri:String, action:String = null, targetOptions:int = 0, perimeter:String = null):void
Query the platform for a list of available invokable targets.
InvokeManager
  
Called by Viewers to request to be closed.
InvokeManager
  
setInvokeTargetFilters(target:String, filters:Vector.<InvokeTargetFilter>):void
Sets the filters associated with the specified target.
InvokeManager
  
viewerSendMessage(message:String, data:Object):void
Called by Viewers to send data to applications.
InvokeManager

Events

 Event Summary Defined By
  Dispatched when a card is closed.InvokeManager
  Dispatched when a card begins a peek.InvokeManager
  Dispatched when a card peek ends.InvokeManager
  Dispatched when an error occurs after calls to invoke() and invokeViewer().InvokeManager
  Dispatched when the application is invoked.InvokeManager
  Dispatched after a successful call to the queryInvokeTargets method.InvokeManager
  Dispatched when the an application has been successfully invoked after a calling the invoke() method.InvokeManager
  Dispatched after a successful call to the getInvokeTargetFilters method.InvokeManager
  Dispatched after a successful call to the setInvokeTargetFilters method.InvokeManager
  Dispatched when the an application has been successfully invoked after a calling the invokeViewer() method.InvokeManager
  Dispatched to a viewer when a application sends it a message.InvokeManager

Property Detail

DEBUG


public static var DEBUG:Boolean = false

When set to true, messages sent and recieved from the invoke framework are sent to the console.

invokeManager


invokeManager:InvokeManager  [read-only]

Gets the single instance of the InvokeManager.


Implementation

public static function get invokeManager():InvokeManager

startupMode


startupMode:int  [read-only]

The mode in which your application was started up in.

Valid values for this property can be found in the InvokeStartMode class.

This value is set once the InvokeEvent.INVOKE event is dispatched. Any attempt to read this property before the event, will result in it returning the default value, 0.

The default value is 0.


Implementation

public function get startupMode():int

See also

InvokeStartupMode

startupRequest


startupRequest:InvokeRequest  [read-only]

The InvokeRequest instance the application was invoked with.

This is set if another application or service on the device invoked your application using the invoke() method. The startMode property will be set to InvokeStartupMode.INVOKE if this property is not null.

This value is set once the InvokeEvent.INVOKE event is dispatched. Any attempt to read this property before the event, will result in it returning the default value, null.


Implementation

public function get startupRequest():InvokeRequest

startupViewerRequest


startupViewerRequest:InvokeViewerRequest  [read-only]

The InvokeViewerRequest instance the viewer was invoked with.

This is set if another application or service on the device invoked your viewer using the invokeViewer() method. The startMode property will be set to InvokeStartupMode.VIEWER if this property is not null.

This value is set once the InvokeEvent.INVOKE event is dispatched. Any attempt to read this property before the event, will result in it returning the default value, null.


Implementation

public function get startupViewerRequest():InvokeViewerRequest

Constructor Detail

InvokeManager()


public function InvokeManager(enforcer:SingletonEnforcer)

The constructor for this class should not be called directly. Use InvokeManager.invokeManager to get a reference to the Invoke Manager.

Parameters

enforcer:SingletonEnforcer

See also

invokeManager

Method Detail

closeCard()


public function closeCard():void

Closes child cards from the parent application.

getInvokeTargetFilters()


public function getInvokeTargetFilters(invokeTarget:String):void

Retrieves the invoke target filters associated with the specified target.

Specified target must be hosted by the calling process.



BlackBerry 10 Version: 10.2

Parameters

invokeTarget:String — The target for which filters to retrieve.

invoke()


public function invoke(request:InvokeRequest):void

The invoke() method is used to invoke other applications.

When the target has been successfully invoked a InvokeEvent.INVOKE_TARGET event will be dispatched. If there was an error in invoking the target, a ErrorEvent.ERROR event will be dispatched.

Parameters

request:InvokeRequest — An InvokeRequest object used to invoke the application.

invokeViewer()


public function invokeViewer(request:InvokeViewerRequest):Viewer

The invokeViewer() method is used to invoke viewers inside of your application.

When invoking a viewer in your application, a ViewerEvent.VIEWER_CREATED event will be dispatched by the return Viewer instance. By default the viewer will be created at the specified width and height in the request parameter, and positioned at 0,0 in your application. If you wish to position or resize the viewer after it has been created, you can set these properties on the returned Viewer instance after the ViewerEvent.VIEWER_CREATED event has been dispatched.

When the target has been successfully invoked a InvokeEvent.INVOKE_TARGET event will be dispatched. If there was an error in invoking the target, a ErrorEvent.ERROR event will be dispatched.

Parameters

request:InvokeViewerRequest — An InvokeRequest object used to invoke the application.

Returns

Viewer — A reference to the created Viewer

queryInvokeTargets()


public function queryInvokeTargets(mimeType:String, uri:String, action:String = null, targetOptions:int = 0, perimeter:String = null):void

Query the platform for a list of available invokable targets.

Parameters

mimeType:String — The mime type the target should support. This must be provided if uri is not provided.
uri:String — The uri to determine supported targets. This must be provided if mimeType is not provided.
action:String (default = null) — The action to use to determine targets. Valid values can be found in InvokeAction. If null all actions are used.
targetOptions:int (default = 0) — Specifies the type of targets to return. Valid values can be found in InvokeTargetOptions.
perimeter:String (default = null) — The perimeter to query. This is used only when dealing with the enterprise perimeter. For almost all applications this should be left null.

requestViewerClose()


public function requestViewerClose():void

Called by Viewers to request to be closed. This method should not be called by applications, only viewers. When a viewer requests to be closed, the Viewer instance in the application will dispatch a ViewerEvent.VIEWER_CLOSE_REQUEST event. It is up to the application to call the Viewer.dispose() method in order to close the viewer. This gives the application time to animate the viewer out before it is closed.


Throws

Error — Error thrown if the startupViewerRequest is null, which means it was called by an application.

setInvokeTargetFilters()


public function setInvokeTargetFilters(target:String, filters:Vector.<InvokeTargetFilter>):void

Sets the filters associated with the specified target.



BlackBerry 10 Version: 10.2

Parameters

target:String — The target to set the filters on.
filters:Vector.<InvokeTargetFilter> — An list of InvokeTargetFilter.

viewerSendMessage()


public function viewerSendMessage(message:String, data:Object):void

Called by Viewers to send data to applications. This method should not be called by applications, only viewers. Allows viewers to communicate with applications. In the application, the Viewer instance will dispatch a ViewerEvent.VIEWER_MESSAGE event. The event will contain both the message and the data properties specified here.

Parameters

message:String — The message to be sent.
data:Object — The data sent to the application.


Throws

Error — Error thrown if the startupViewerRequest is null, which means it was called by an application.

Event Detail

cardClosed


Event Object Type: qnx.events.CardCloseEvent
CardCloseEvent.type property = qnx.events.CardCloseEvent.CARD_CLOSED

Dispatched when a card is closed.

Event type dispatched whent the card is closed.

The CardCloseEvent.CARD_CLOSED constant defines the value of the type property of the event object for an cardClosed event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
dataThe data sent from the card when it was closed.
mimeTypeThe mime-type of the data returned with the event.
reasonThe reason the card was closed.
typeCardCloseEvent.CARD_CLOSED

cardPeekBegin


Event Object Type: qnx.events.CardPeekEvent
CardPeekEvent.type property = qnx.events.CardPeekEvent.PEEK_BEGIN

Dispatched when a card begins a peek.

Dispatched when the card begins a peek gesture.

The CardPeekEvent.PEEK_BEGIN constant defines the value of the type property of the event object for an cardPeekBegin event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
peekTypeThe type of peek that has begun.
typeCardPeekEvent.PEEK_BEGIN

cardPeekEnd


Event Object Type: qnx.events.CardPeekEvent
CardPeekEvent.type property = qnx.events.CardPeekEvent.PEEK_END

Dispatched when a card peek ends.

Dispatched when the card ends a peek gesture.

The CardPeekEvent.PEEK_END constant defines the value of the type property of the event object for an cardPeekEnd event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
peekTypeThe type of peek that has ended.
typeCardPeekEvent.PEEK_END

error


Event Object Type: flash.events.ErrorEvent
ErrorEvent.type property = flash.events.ErrorEvent.ERROR

Dispatched when an error occurs after calls to invoke() and invokeViewer().

invoke


Event Object Type: qnx.events.InvokeEvent
InvokeEvent.type property = qnx.events.InvokeEvent.INVOKE

Dispatched when the application is invoked. This event will occur when the application is launched from the homescreen, by another application or as a viewer.

Dispatched when the application or viewer is successfully invoked.

The InvokeEvent.INVOKE constant defines the value of the type property of the event object for an invoke event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
targetKeyThis property will be null during this event.
targetTypeThis property will be null during this event.
typeInvokeEvent.INVOKE

invokeQueryTargetEventSuccess


Event Object Type: qnx.events.InvokeQueryTargetEvent
InvokeQueryTargetEvent.type property = qnx.events.InvokeQueryTargetEvent.SUCCESS

Dispatched after a successful call to the queryInvokeTargets method.

Dispatched when targets have been successfully returned.

This event is dispatched after a call to InvokeManager.invokeViewer().

The InvokeQueryTargetEvent.SUCCESS constant defines the value of the type property of the event object for an invokeQueryTargetEventSuccess event.

The properties of the event object have the following values:

PropertyValue
actionsA list of actions returned from a query.
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
typeInvokeQueryTargetEvent.SUCCESS

invokeTarget


Event Object Type: qnx.events.InvokeEvent
InvokeEvent.type property = qnx.events.InvokeEvent.INVOKE_TARGET

Dispatched when the an application has been successfully invoked after a calling the invoke() method.

Dispatched when an application successfully invokes another application.

This event is dispatched after a call to InvokeManager.invoke().

The InvokeEvent.INVOKE_TARGET constant defines the value of the type property of the event object for an invokeTarget event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
targetKeyThe target key for an unbound invocation.
targetTypeThe target type for an unbound invocation.
typeInvokeEvent.INVOKE_TARGET

See also

invoke()

invokeTargetGetFiltersEventSuccess


Event Object Type: qnx.events.InvokeTargetFiltersEvent
InvokeTargetFiltersEvent.type property = qnx.events.InvokeTargetFiltersEvent.GET_SUCCESS

Dispatched after a successful call to the getInvokeTargetFilters method.

Dispatched when a specified target's filter has been successfully returned. This request can only be made by a process hosting the specified target.

This event is dispatched after a call to InvokeManager.getInvokeTargetFilters().

The InvokeTargetFiltersEvent.GET_SUCCESS constant defines the value of the type property of the event object for an getInvokeTargetFilters event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
filtersThe filters that have been returned and the target that they are applied to for confirmation purposed.
invokeTargetThe the target associated with the filters.
typeInvokeTargetFiltersEvent.GET_SUCCESS

invokeTargetSetFiltersEventSuccess


Event Object Type: qnx.events.InvokeTargetFiltersEvent
InvokeTargetFiltersEvent.type property = qnx.events.InvokeTargetFiltersEvent.SET_SUCCESS

Dispatched after a successful call to the setInvokeTargetFilters method.

Dispatched when a specified target's filter has been successfully set. This request can only be made by a process hosting the specified target.

This event is dispatched after a call to InvokeManager.setInvokeTargetFilters().

The InvokeTargetFiltersEvent.SET_SUCCESS constant defines the value of the type property of the event object for an setInvokeTargetFilters event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
filtersIs null for this event.
invokeTargetIs null for this event.
typeInvokeTargetFiltersEvent.SET_SUCCESS

invokeViewer


Event Object Type: qnx.events.InvokeEvent
InvokeEvent.type property = qnx.events.InvokeEvent.INVOKE_VIEWER

Dispatched when the an application has been successfully invoked after a calling the invokeViewer() method.

Dispatched when an application successfully invokes viewer.

This event is dispatched after a call to InvokeManager.invokeViewer().

The InvokeEvent.INVOKE_VIEWER constant defines the value of the type property of the event object for an invokeViewer event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
targetKeyThe target key for an unbound invocation.
targetTypeThe target type for an unbound invocation.
typeInvokeEvent.INVOKE_VIEWER

See also

invokeViewer()

viewerMessage


Event Object Type: qnx.events.ViewerEvent
ViewerEvent.type property = qnx.events.ViewerEvent.VIEWER_MESSAGE

Dispatched to a viewer when a application sends it a message.

Dispatched when a viewer sends a message to the application.

The ViewerEvent.VIEWER_MESSAGE constant defines the value of the type property of the event object for an viewerMessage event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
dataThe data associated with the message.
messageThe message sent by the viewer to the application.
typeViewerEvent.VIEWER_MESSAGE




comments powered by Disqus