Skip to content

Commit 7cbf238

Browse files
committed
Added documentation for orientation API for blackberry.app
1 parent 9cc7323 commit 7cbf238

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

api/blackberry_app.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ blackberry.app ={
5555
*/
5656
exit: function(){},
5757

58+
/**
59+
* @description This function will lock the application's screen to the given orientation.
60+
* @param {String} orientation The orientation to lock the device to. If the device is currently not in this orientation, the application will rotate then lock.
61+
* @param {Boolean} [receiveRotateEvents] Optional parameter to allow rotation events to still occur while the screen is locked.
62+
* @BB10X
63+
* @RIPPLE
64+
*/
65+
lockOrientation: function(orienation, receiveRotateEvents){},
66+
67+
/**
68+
* @description This function will unlock the screen rotating if it was previously locked.
69+
* @BB10X
70+
* @RIPPLE
71+
*/
72+
unlockOrientation: function(){},
73+
5874
/**
5975
* @description This function will move the application to the background.
6076
* @BB50+
@@ -213,6 +229,16 @@ A banner indicator can have an optional numeric value that usually serves as a c
213229
*/
214230
name : "",
215231

232+
/**
233+
* @description The current orientation of the BlackBerry device.
234+
* @BB10X
235+
* @RIPPLE
236+
* @readonly
237+
* @type String
238+
*/
239+
orientation : "",
240+
241+
216242
/**
217243
* @description The version of the BlackBerry WebWorks Application that is specified in the config.xml file.
218244
* @BB50+
@@ -414,5 +440,21 @@ A banner indicator can have an optional numeric value that usually serves as a c
414440
*/
415441
keyboardPosition : function(yPosition){}
416442

443+
/**
444+
* @description The <b>orientationchange</b> event is triggered when the user changes the orientation of the device.
445+
* @callback {function} yourCallbackFunction The callback function that will be invoked on the orientationchange event
446+
* @example
447+
* &lt;script type="text/javascript"&gt;
448+
*
449+
* function onOrientationChange(orientation) {
450+
* alert("New orientation is: " + orientation);
451+
* }
452+
*
453+
* blackberry.event.addEventListener("orientationchange", onOrientationChange);
454+
*
455+
* &lt;/script&gt;
456+
*/
457+
orientationchange : function(orientation){}
458+
417459
/**#@-*/
418460
};

0 commit comments

Comments
 (0)