Mojo.Controller.AppController

Class Detail

The application controller is responsible for creating the application assistant and providing the interfaces for creating and managing stages. The following describes the class - the controller will get instantiated for you. You can get the instance of the controller with Mojo.Controller.getAppController().The controller object is typically accessed using this.controller.

Method Summary


Method Detail

Mojo.Controller.AppController.closeAllStages()

Function to close all stages.


Mojo.Controller.AppController.closeStage(stageName)

Function to close a stage.

Parameters


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


Mojo.Controller.AppController.getActiveStageController(stageType)

Function to return the first currently focused stage.

Parameters


{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


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


{Object} Mojo.Controller.AppController.launch(appId, params, onSuccess, onFailure)

Launch another application, with optional parameters.

Parameters

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

Returns

The Mojo.Service.Request object used to make the launch request.


Mojo.Controller.AppController.playSoundNotification(soundClass, soundFile, duration)

Immediately play a notification sound. Note that soundClass should be set to "notifications", "alerts" or "media". If you need the device to vibrate, set soundClass to "vibrate".

Parameters


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


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


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