Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
rtm2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wu committed Mar 9, 2011
1 parent ac8419f commit 3ce2a18
Show file tree
Hide file tree
Showing 313 changed files with 38,822 additions and 6,929 deletions.
59 changes: 59 additions & 0 deletions api-docs/blackberry/app/event/library.xml
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<library isWhitelist="true">
<features>
<feature id="blackberry.app.event" version="1.0.0">The Application Event object allows you to access events triggered by the application.</feature>
</features>

<object name="blackberry.app.event" shortName="Application Event" introduced="1.0.0" comment="The Application Event object allows you to access events triggered by the application.">
<details>
The Application Event Object is static; all of its functions and properties are used directly from the object.
</details>
<example><![CDATA[<script type="text/javascript">
function trapForApplicationExit() {
blackberry.app.event.onExit(handleExit);
}
function handleExit() {
var answer = confirm("Leave this application?");
if (answer) {
blackberry.app.exit();
}
}
</script>]]></example>

<subclasses>
<object name="OnAppEvent" shortName="OnAppEvent Interface" interface="true" comment="Interface for application event callbacks.">
<details>
This is the interface that must be available on the application event callback function provided.
</details>
</object>
</subclasses>

<functions>
<func name="onExit" static="true" returns="void" comment="Assigns a listener for when the application is about to exit.">
<param name="callback" type="OnAppEvent" comment="Function to be called when the application is about to exit. "/>
<details>
Only one function can be assigned to this event. To unregister the callback, simply call the onExit method and pass in null for the callback parameter.
This event will be fired when the application is about to exit. When you trap for the onExit event you must control the exit of the application
in your JavaScript. If you choose to allow the application to exit, you must call blackberry.app.exit() to terminate the application.
</details>
</func>
<func name="onForeground" static="true" returns="void" comment="Assigns a listener for when the application comes to the foreground.">
<param name="callback" type="OnAppEvent" comment="Function to be called when the application comes to the foreground. "/>
<details>
Only one function can be assigned to this event. To unregister the callback simply call the onForeground method and pass in null for the callback parameter.
This event is fired whenever the application comes to the foreground, for example, when the user re-opens the application from the application list.
</details>
</func>
<func name="onBackground" static="true" returns="void" comment="Assigns a listener for when the application goes to the background.">
<param name="callback" type="OnAppEvent" comment="Function to be called when the application goes to the background. "/>
<details>
Only one function can be assigned to this event. To unregister the callback, simply call the onBackground method and pass in null for the callback parameter.
This event is fired whenever the application goes to the background, but has not ended. For example, if the user uses the END_CALL key to close the application,
the application is still running, but in the background.
</details>
</func>
</functions>

</object>
</library>
76 changes: 76 additions & 0 deletions api-docs/blackberry/app/library.xml
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<library isWhitelist="true">
<extension id="blackberry.app">
<entryClass>blackberry.app.AppExtension</entryClass>
</extension>

<platforms>
<platform value="JAVA">
<target version="default" config="JAVA_XHR" />
<target version="5.0" config="JAVA_XHR_BlackBerry" />
</platform>
</platforms>

<configurations>
<configuration name="JAVA_XHR" version="1.0" comment="For XHR architecture for Java implementation">
<src type="text/java" path="blackberry" comment="API implementation in JavaScript" />
</configuration>
<configuration name="JAVA_XHR_BlackBerry" version="1.0" comment="For XHR architecture for Java implementation for OS 5.0">
<src type="text/java" path="blackberry" comment="API implementation in JavaScript" />
</configuration>
</configurations>

<features>
<feature id="blackberry.app" version="1.0.0">The Application object provides functions and properties for the currently running application.</feature>
<feature id="blackberry.app.event" version="1.0.0">The Application Event object allows you to access events triggered by the application.</feature>
</features>

<object name="blackberry.app" shortName="Application" introduced="1.0.0" comment="The Application object provides functions and properties for the currently running application.">
<example><![CDATA[<script type="text/javascript">
function newData(isNewData) {
if (isNewData && !blackberry.app.isForeground) {
blackberry.app.setHomeScreenName("New data");
}
else {
alert("New data has arrived");
}
}
</script>]]></example>

<functions>
<func name="exit" static="true" returns="void" comment="This function will cause the application to exit."/>
<func name="setHomeScreenName" static="true" returns="void" comment="This method will set the text for the icon that appears in the Home Screen of the device.">
<param name="text" type="String" comment="Text to appear on the home screen icon."/>
<details>
Returns true if successful, false otherwise. Changes made using this API are NOT persisted across resets.
</details>
</func>
<func name="setHomeScreenIcon" static="true" returns="void" comment="This method will set the icon that appears in the Home Screen of the device.">
<param name="uri" type="String" comment="Location of the image to use for the icon. The path to the image resource must be fully qualified. An example of a fully qualified path is local:///resourceFolder/icons/icon.png. The path to the resource must also be included in the whitelist. For example, accessing an image on the file system requires 'file:///' to be whitelisted"/>
<param name="hover" type="Boolean" optional="true" comment="optional parameter. If set to true then the hover icon for the application is changed. By default this is false, so the icon that is changed is the default main icon for the application."/>
<details>
Returns true if successful, false otherwise. The hover icon can only be set when the application icon has been set first. Changes made using this API are NOT persisted across device resets.
</details>
</func>
<func name="requestForeground" static="true" returns="void" comment="This function will move the application to the foreground application.">
</func>
<func name="requestBackground" static="true" returns="void" comment="This function will move the application to the background.">
</func>
</functions>

<properties>
<property name="id" static="true" type="String" readonly="true" comment="A property representing the ID of the widget that is specified in the config.xml file."/>
<property name="name" static="true" type="String" readonly="true" comment="A property representing the name of the widget that is specified in the config.xml file."/>
<property name="description" static="true" type="String" readonly="true" comment="A property representing the description of the widget that is specified in the config.xml file."/>
<property name="author" static="true" type="String" readonly="true" comment="A property representing the ID of the author's name that is specified in the config.xml file."/>
<property name="authorEmail" static="true" type="String" readonly="true" comment="A property representing the author's email of the widget that is specified in the config.xml file."/>
<property name="authorURL" static="true" type="String" readonly="true" comment="A property representing the author's URL of the widget that is specified in the config.xml file."/>
<property name="version" static="true" type="String" readonly="true" comment="A property representing the version of the widget that is specified in the config.xml file."/>
<property name="license" static="true" type="String" readonly="true" comment="A property representing the license of the widget that is specified in the config.xml file."/>
<property name="copyright" static="true" type="String" readonly="true" comment="A property representing the copyright information of the widget that is specified in the config.xml file."/>
<property name="isForeground" static="true" type="Boolean" readonly="true" comment="A property that will return true if the widget is in the foreground."/>
<property name="licenseURL" static="true" type="String" readonly="true" comment="A property representing the license URL of the widget that is specified in the config.xml file."/>
</properties>

</object>
</library>

0 comments on commit 3ce2a18

Please sign in to comment.