Mojo.Controller.AppController

Class Detail

The application controller is responsible for creating the application assistant and providing the interfaces for creating and managing stages.

Method Summary
Method Name and Description
Mojo.Controller.AppController.closeAllStages()
Mojo.Controller.AppController.closeStage(stageName)
Mojo.Controller.AppController.createStageWithCallback(stageArguments, onCreate, optionalStageType)
Mojo.Controller.AppController.getActiveStageController(stageType)
Mojo.Controller.AppController.getScreenOrientation()
Mojo.Controller.AppController.getStageController(stageName)
Mojo.Controller.AppController.getStageProxy(stageName)
Mojo.Controller.AppController.launch(appId, params, onSuccess, onFailure)
Mojo.Controller.AppController.open(params, onSUccess, onFailure)
Mojo.Controller.AppController.playSoundNotification(soundClass, soundFile, duration)
Mojo.Controller.AppController.removeAllBanners()
Mojo.Controller.AppController.removeBanner(category)
Mojo.Controller.AppController.sendToNotificationChain(notificationData)
Mojo.Controller.AppController.showBanner(bannerParams, launchArguments, category)
Method Detail
Mojo.Controller.AppController.closeAllStages()

Function to close all stages.

Mojo.Controller.AppController.closeStage(stageName)

Function to close a stage.

Parameters:
{String} stageName
The name of the stage.
Mojo.Controller.AppController.createStageWithCallback(stageArguments, onCreate, optionalStageType)

Method to create a new stage and be called back when the stage is loaded. You can bind as much data to your callback function as needed, eliminating the need to pass parameters in the URI. The callback function can use the passed-in stage controller to push the first scene.

Parameters:
{String|Object} stageArguments
If a string, the name of the new stage. If a stage exists with this name, its contents will be replaced. If an object, it must have a name property containing the stage name and may have an assistantName property to specify the stage assistant and a height property to specify the height of a popup alert.
{Function} onCreate
A function that is called once the new stage is fully loaded. It is passed the new stage controller as its first parameter.
{String} optionalStageType
The type of stage to create. See Mojo.Controller.StageType in controller.js for legal values.
Mojo.Controller.AppController.getActiveStageController(stageType)

Function to return the first currently focused stage.

Parameters:
{String} stageType
optional parameter to limit the focused stage returned to the specified type. See Mojo.Controller.StageType for details on stageType.
{string} Mojo.Controller.AppController.getScreenOrientation()

Returns the current orientation of the physical screen.

Returns:
{string} one of 'up', 'down', 'left', or 'right'.
Mojo.Controller.AppController.getStageController(stageName)

Function to get the stage controller for a stage. Returns undefined if the stage does not exist, or is not yet fully constructed.

Parameters:
{String} stageName
The name of the stage.
Mojo.Controller.AppController.getStageProxy(stageName)

Function to get a controller or proxy object for a stage. Returns the stage controller if available, but if the stage is still in the process of being created a proxy object will be returned instead. This proxy implements delegateToSceneAssistant(), and will delegate the calls as expected when the stage is available.

Parameters:
{String} stageName
The name of the stage.
{Object} Mojo.Controller.AppController.launch(appId, params, onSuccess, onFailure)

Launch another application, with optional parameters.

Parameters:
{String} appId
Application ID of application to launch.
{Object} params
Launch parameters to send to the launched application.
{Function} onSuccess
Function that is called if the launch is successful. Default is to do nothing.
{Function} onFailure
Function that is called if the launch fails. Default is to do nothing.
Returns:
The Mojo.Service.Request object used to make the launch request.
{Object} Mojo.Controller.AppController.open(params, onSUccess, onFailure)

Launch an application appropriate for "opening" the data indicated in the launch parameters.

Parameters:
{Object} params
Launch parameters to send to the opening application
{Function} onSUccess
Function that is called if the open is successful. Default is to do nothing.
{Function} onFailure
Function that is called if the open fails. Default is to do nothing.
Returns:
The Mojo.Service.Request object used to make the launch request.
Mojo.Controller.AppController.playSoundNotification(soundClass, soundFile, duration)

Immediately play a notification sound

Parameters:
{String} soundClass
class of the sound
{String} soundFile
partial or full path to the sound file
{String} duration
of sound in ms
Mojo.Controller.AppController.removeAllBanners()

Remove all pending banner messages from the banner area. Will not remove messages that are already displayed.

Mojo.Controller.AppController.removeBanner(category)

Remove a banner from the banner area. The category parameter defaults to 'banner'. Will not remove messages that are already displayed.

Parameters:
{String} category
Value defined by the application and usually same one used in showBanner. It is used if you have more than one kind of banner message.
Mojo.Controller.AppController.sendToNotificationChain(notificationData)

Hand the passed-in notification data to everyone in the commander stack of the focused window (scene assistant, stage assistant, app assistant, usually), calling considerForNotification, if present, on each. Each assistant before the app assistant should return the notification data with any properties that aren't needed for building a notification removed. The app assistant can then use the remaining data (in its own considerForNotification function) to call showBanner or to create or update a dashboard stage.

Parameters:
notificationData
Mojo.Controller.AppController.showBanner(bannerParams, launchArguments, category)

Show the message text from the bannerParams in the banner area. The launchArguments will be used to launch or relaunch the application if the banner is touched. The category parameter defaults to 'banner'. New banners of each category will replace existing banners of the same category.

Parameters:
{String|object} bannerParams
bannerParams
Can be either a string, in which case it is simply message text, or an object with the following properties:
messageText text to display
soundClass string containing the sound class to use
soundFile partial or full path to a sound file to play
icon partial or full path to an icon to show
soundDuration duration of sound in milliseconds
{String} launchArguments
Arguments sent to the application when it is launched or relaunched if the banner is touched.
{String} category
Value defined by the application. It is used if you have more than one kind of banner message. Without categories, any banner shown would replace an existing banner that had not yet been shown.

Documentation generated by JsDoc Toolkit 2.1.1 on Thu Oct 29 2009 15:28:12 GMT-0700 (PDT)