Browse files

Merging conflicts between delta and master

  • Loading branch information...
2 parents cf659e4 + ddcb862 commit 4615167bae38653a00c52ece6521d7e0d387095c Jeffrey Heifetz committed May 20, 2011
View
3 README.md
@@ -6,9 +6,6 @@ This project is Open Sourced under the Apache 2.0 license
[Read more](https://github.com/blackberry/WebWorks/wiki) about the BlackBerry WebWorks open source project
-# STILL A WORK IN PROGRESS
-We are still working on the initial setup of this repository
-
## Setting up your Environment
1. Download the [jsdoc-toolkit](http://code.google.com/p/jsdoc-toolkit/downloads/list)
View
31 api/blackberry.js
@@ -16,23 +16,22 @@
/**
-* @BB50+
* @toc {System} Network
* @namespace The blackberry object is the root of all BlackBerry specific JavaScript functionality. blackberry.network is available by default in the regular browser.
-* @example
-* <script type="text/javascript">
-* alert("You are on the " + blackberry.network + " Network");
-* </script>
*/
-blackberry = { };
-
-/**
-* Returns the wireless network on which the BlackBerry device is communicating.
-* @type String
-* @static
-* @readOnly
-* @BB50+
-*/
-blackberry.network = { };
-
+blackberry = {
+
+ /**
+ * @field
+ * @description Returns the wireless network on which the BlackBerry device is communicating.
+ * @type String
+ * @readOnly
+ * @BB50+
+ * @example
+ * <script type="text/javascript">
+ * alert("You are on the " + blackberry.network + " Network");
+ * </script>
+ */
+ network : undefined
+};
View
8 api/blackberry_audio_Player.js
@@ -60,13 +60,11 @@
* var playerInstance = new blackberry.audio.Player("file:///store/home/user/music/filename.mp3");
*
* // Setting new time for media
-* var newMediaTime = 10000;
-* playerInstance.mediaTime = newMediaTime;
+* playerInstance.mediaTime = 10000;
* alert("New media time: " + playerInstance.mediaTime);
*
* // Setting new volume for media
-* var newVolumeLevel = 85;
-* playerInstance.volumeLevel = newVolumeLevel;
+* playerInstance.volumeLevel = 85;
* alert("New volume level: " + playerInstance.volumeLevel);
* </script>
@@ -164,7 +162,7 @@ blackberry.audio.Player = function(locator,type,async) {
mediaTime : 0,
/**
- * Get/Set the player's volume level.
+ * Get/Set the player's volume level. Valid values are between 0 and 100.
* @type Number
* @BB50+
*/
View
36 api/blackberry_focus.js
@@ -16,6 +16,7 @@
/**
+* @namespace The focus object provides functions and properties for retrieving and setting focus to focusable areas of the HTML<br/><br/>
* <div><h3>Guidelines</h3><p>
* If the BlackBerry device doesn't have a trackball or trackpad, the focus-based navigation mode will not be enabled even if the widget configuration document specifies that focus-based navigation is used.
* If the widget is configured for focus-based navigation and it runs on a BlackBerry device that uses a trackpad or trackball, focus-based navigation will be enabled.
@@ -24,48 +25,48 @@
* In summary, running a widget with focus-based navigation mode markup on a BlackBerry device without a trackball is the same as running the widget without specifying any focus-based navigation and the entire navigation related HTML mark-up, JavaScript and CSS extensions are ignored.
* </p></div>
* <div><p>
-* Currently, focus based navigation will not function in a "child" document that is contained by a <frameset> <frame>
-* or <iframe> or any other HTML element that contains a document element. Focus based navigation only works in the "root" document.
+* Currently, focus based navigation will not function in a &quot;child&quot; document that is contained by a &lt;frameset&gt; &lt;frame&gt;
+* or &lt;iframe&gt; or any other HTML element that contains a document element. Focus based navigation only works in the &quot;root&quot; document.
* </p></div>
* <div><h3>Configuration</h3><p>
* Navigation mode can be enabled for BlackBerry devices with trackball by adding a <rim:navigation> element in config.xml document that looks like the following:
-* <rim:navigation mode="focus" />
+* &lt;rim:navigation mode=&quot;focus&quot; /&gt;
* </p></div>
* <div><h3>HTML Mark-up Details</h3><p>
-* By default, all <textarea>, <a>, <input>, <select> and <button> elements are focusable.
-* If you wish to have other HTML elements to become focusable, which will make them a part of the navigation map, you can add the attribute x-blackberry-focusable with the value of "true" to these elements, e.g.
+* By default, all &lt;textarea&gt;, &lt;a&gt;, &lt;input&gt;, &lt;select&gt; and &lt;button&gt; elements are focusable.
+* If you wish to have other HTML elements to become focusable, which will make them a part of the navigation map, you can add the attribute x-blackberry-focusable with the value of &quot;true&quot; to these elements, e.g.
* </p></div>
* <div><p>
-* <td id="Td1" x-blackberry-focusable="true" > 1 </td>
+* &lt;td id=&quot;Td1&quot; x-blackberry-focusable=&quot;true&quot; &gt; 1 &lt;/td&gt;
* </p></div>
* <div><p>
-* In addition, if you want to remove some of the default focusable elements from the navigation map, which prevent them from gaining focus, add the attribute x-blackberry-focusable with the value of "false" to these elements. For example:
+* In addition, if you want to remove some of the default focusable elements from the navigation map, which prevent them from gaining focus, add the attribute x-blackberry-focusable with the value of &quot;false&quot; to these elements. For example:
* </p></div>
* <div><p>
-* <input value="Fixed" x-blackberry-focusable="false" />
+* &lt;input value=&quot;Fixed&quot; x-blackberry-focusable=&quot;false&quot; /&gt;
* </p></div>
* <div><p>
-* By default, the "highest" focusable element will be initially focused after the document is completely loaded.
-* You can set a specific focusable element to be initially focused after the document is loaded by adding the "x-blackberry-initialFocus" attribute to it. For example:
+* By default, the &quot;highest&quot; focusable element will be initially focused after the document is completely loaded.
+* You can set a specific focusable element to be initially focused after the document is loaded by adding the &quot;x-blackberry-initialFocus&quot; attribute to it. For example:
* </p></div>
* <div><p>
-* <a class="list" x-blackberry-initialFocus="true" >First Link</a>
+* &lt;a class=&quot;list&quot; x-blackberry-initialFocus=&quot;true&quot; &gt;First Link&lt;/a&gt;
* </p></div>
* <div><h3>Events and Overrides</h3><p>
* By default, all focusable HTML elements compose the navigation map and the focus will move from one focusable element to another focusable element according to the direction of the scroll wheel and the 2-D dimension of the focusable elements.
* This default navigation behavior can be overridden and customized, by using the x-blackberry-onUp, x-blackberry-onDown, x-blackberry-onLeft, and x-blackberry-onRight event attributes.
* For example, here is a snippet of HTML:
* </p></div>
* <div><p>
-* <input id="input1" value="OverrideNavigationBehavior" x-blackberry-onUp="SomeJsFunction()" />
+* &lt;input id=&quot;input1&quot; value=&quot;OverrideNavigationBehavior&quot; x-blackberry-onUp=&amp;quot;SomeJsFunction()&quot; /&gt;
* </p></div>
* <div><p>
* If the input1 element is currently focused, and the user scrolls up using the trackpad or trackball, SomeJsFunction() will be executed instead of the default focus moving behavior.
* The content of the x-blackberry-onUp value will be executed as JavaScript and the default focus movement will not occur.
* </p></div>
* <div><p>
* In the above case, if SomeJsFunction() doesn't programmatically move the focus to another element, the current focused element will not change. If you want
-* to trap scrolling and do not want any navigation action to occur, or JavaScript to execute, you can override one of the navigation attributes with an empty value like the following: x-blackberry-onUp="".
+* to trap scrolling and do not want any navigation action to occur, or JavaScript to execute, you can override one of the navigation attributes with an empty value like the following: x-blackberry-onUp=&quot;&quot;.
* </p></div>
* <div><p>
* When an element gains focus, it will receive a mouseover event. An element can gain focus when the user moves the trackpad or trackball under the default navigation behavior or if blackberry.focus.setFocus() is called programmatically to set the focus to an element.
@@ -82,16 +83,15 @@
* By default, when an element is focused, a light-blue round rectangle appears around the dimension of the element. When an element gains focus, the CSS hover will be triggered, allowing you to customize
* the focused element. You can also turn off the default focus highlight by using the following meta tag:
* </p></div>
-* <div><p>
-* <meta name="x-blackberry-defaultHoverEffect" content="false" />
+* <div><p>
+* &lt;meta name=&quot;x-blackberry-defaultHoverEffect&quot; content=&quot;false&quot; /&gt;
* </p></div>
* <div><h3>Limitations</h3><p>
-* Currently focus navigation doesn't support the <select> element with the "multiple" attribute. Therefore the <select>
-* element with the "multiple" attribute is not focusable and cannot be added to navigation map. The workaround is to either add some navigation JavaScript outside the <select> element or simply using other HTML elements to mimic the multiple selection function.
+* Currently focus navigation doesn't support the &lt;select&gt; element with the "multiple" attribute. Therefore the &lt;select&lt;
+* element with the "multiple" attribute is not focusable and cannot be added to navigation map. The workaround is to either add some navigation JavaScript outside the &lt;select&gt; element or simply using other HTML elements to mimic the multiple selection function.
* </p></div>
* @toc {User Interface} Focus
* @BB50+
-* @namespace The focus object provides functions and properties for retrieving and setting focus to focusable areas of the HTML
* @example
* &lt;html&gt;
* &lt;head&gt;
View
18 api/blackberry_invoke_CalendarArguments.js
@@ -18,13 +18,13 @@
* <div><p>
* The CalendarArguments object must be created as an instance using the new keyword.
* </p></div>
-* @toc {Invoke} CalendarArguments
-* @BB50+
+* @toc {Invoke} CalendarArguments
* @class The CalendarArguments object is an instance object, and is used as a parameter to the invoke() method when invoking the Calendar application.
* @featureID blackberry.invoke
* @featureID blackberry.invoke.CalendarArguments
* @featureID blackberry.pim.Appointment
* @constructor Constructor for a new CalendarArguments object.
+* @param {blackberry.pim.Appointment} appointment The appointment to be passed into the Calendar application.
* @example
* &lt;script type=&quot;text&sol;javascript&quot;&gt;
* var appt = new blackberry.pim.Appointment();
@@ -33,12 +33,22 @@
* var args = new blackberry.invoke.CalendarArguments(appt);
* args.view = 0;
*
-* blackberry.invoke.invoke(blackberry.invoke.APP_CALENDAR, args); &sol;&sol; Calendar
-* &lt;&sol;script&gt;
+* blackberry.invoke.invoke(blackberry.invoke.APP_CALENDAR, args);
+* &lt;script&gt;
*/
blackberry.invoke.CalendarArguments = function() { };
/**
+ * @function
+ * @constructedBy blackberry.invoke.CalendarArguments
+ * @description Create a new CalendarArguments object.
+ * @param {Date} date The date to be passed into the Calendar application.
+ * @BB50+
+ *
+ */
+blackberry.invoke.CalendarArguments.duplicateConstrucotr = function() { };
+
+/**
* New&sol;Compose View
* @type Number
* @constant
View
32 api/blackberry_invoke_MapsArguments.js
@@ -25,12 +25,42 @@
* @featureID blackberry.invoke.MapsArguments
* @featureID blackberry.pim.Address
* @constructor Constructor for a new MapsArguments object.
+* @param {Number} latitude The latitude for the BlackBerry Maps Application to startup with.
+* @param {Number} longitude The longitude for the BlackBerry Maps Application to startup with.
* @example
* &lt;script type=&quot;text&sol;javascript&quot;&gt;
* var args = new blackberry.invoke.MapsArguments(43.26, -80.30);
* blackberry.invoke.invoke(blackberry.invoke.APP_MAPS, args);
* &lt;&sol;script&gt;
*/
-blackberry.invoke.MapsArguments = function() { };
+blackberry.invoke.MapsArguments = {
+
+ /**
+ * @function
+ * @constructedBy blackberry.invoke.MapsArguments
+ * @BB50+
+ * @description Creates a new MapsArguments object.
+ * @param {blackberry.pim.Address} address The address for the BlackBerry Maps Application to startup with.
+ */
+ addrConstructor : undefined,
+
+ /**
+ * @function
+ * @constructedBy blackberry.invoke.MapsArguments
+ * @BB50+
+ * @description Creates a new MapsArguments object.
+ * @param {String} locationDocument The location for the BlackBerry Maps Application to startup with.
+ */
+ strConstructor : undefined,
+
+ /**
+ * @function
+ * @constructedBy blackberry.invoke.MapsArguments
+ * @BB50
+ * @description Creates a new MapsArguments object.
+ * @param {Document} locationDocument The location for the BlackBerry Maps Application to startup with.
+ */
+ docConstructor : undefined
+};
View
16 api/blackberry_io_dir.js
@@ -37,25 +37,25 @@
blackberry.io.dir = { };
/**
-* List all the files and sub-directories that reside in a given directory.
+* List all the files that reside in a given directory.
* @param {String} path Path location of the directory.
-* @returns {String[]}
+* @returns {String[]} A string array containing all the files in the given directory.
* @BB50+
*/
blackberry.io.dir.listFiles = function(path) { };
/**
* List all the directories that reside in a given directory.
* @param {String} path path location of the directory.
-* @returns {String[]}
+* @returns {String[]} A string array containing all the subdirectories in a given directory.
* @BB50+
*/
blackberry.io.dir.listDirectories = function(path) { };
/**
* Determine whether a given directory exists or not.
* @param {String} path path location of the directory.
-* @returns {Boolean}
+* @returns {Boolean} True if the given directory exists; false otherwise.
* @BB50+
*/
blackberry.io.dir.exists = function(path) { };
@@ -79,9 +79,9 @@ blackberry.io.dir.rename = function(path,newDirectoryName) { };
blackberry.io.dir.deleteDirectory = function(path,recursive) { };
/**
-* Returns the path location of the directory that the give file or directory resides in.
+* Returns the path location of the directory that the given file or directory resides in.
* @param {String} path Path of the directory or file.
-* @returns {String}
+* @returns {String} The path location of the directory that the given file or directory resides in.
* @BB50+
*/
blackberry.io.dir.getParentDirectory = function(path) { };
@@ -96,15 +96,15 @@ blackberry.io.dir.createNewDir = function(path) { };
/**
* Get a list of root directories.
-* @returns {String[]}
+* @returns {String[]} A string array containing all root directories.
* @BB50+
*/
blackberry.io.dir.getRootDirs = function() { };
/**
* Get the amount of free space available in the specified root.
* @param {String} rootPath Root path location to determine free space for.
-* @returns {Number}
+* @returns {Number} The amound of free space availalble in the specified root.
* @BB50+
*/
blackberry.io.dir.getFreeSpaceForRoot = function(rootPath) { };
View
18 api/blackberry_io_file.js
@@ -103,25 +103,13 @@ blackberry.io.file.saveFile = function(path,data) { };
/**
* Reads in a file from the local file system.
* @param {String} path local storage file path to the file to be opened into a Blob
-* @param {OnFileOpened} callback Javascript function to call on completion of loading the file from the file system.
+* @callback {function} onFileOpened Javascript function to call on completion of loading the file from the file system.
+* @callback {String} onFileOpened.fullPath Full path of the file that was just opened
+* @callback {Blob} onFileOpened.blobData Blob that contains the file&apos;s contents
* @param {Boolean} [async] an optional parameter specifying if the call to read should be asynchronous or synchronous. If this parameter is not supplied the default of true- you async true? - will be used.
* @returns {void}
* @BB50+
*/
blackberry.io.file.readFile = function(path,callback,async) { };
-/**
-* <div><p>
-* This is the interface that must be available on the callback function to receive file data.
-* </p></div>
-* @toc {IO} File OnFileOpened
-* @BB50+
-* @class Interface to implement on the callback function when all the file data has been retrieved.
-* @constructor
-* @param {String} fullPath Full path of the file that was just opened
-* @param {Blob} blobData Blob that contains the file&apos;s contents
-*/
-blackberry.io.file.OnFileOpened = function(fullPath,blobData) { };
-
-
View
2 api/blackberry_pim_Appointment.js
@@ -44,7 +44,7 @@
* newAppt.end = end;
*
* &sol;&sol; Create Attendee
-* var attendees = new Array();
+* var attendees = [];
* var onlyAttendee = new blackberry.pim.Attendee();
* onlyAttendee.address = &quot;john@foo.com&quot;;
* onlyAttendee.type = blackberry.pim.Attendee.INVITED;
View
2 api/blackberry_pim_Attendee.js
@@ -40,7 +40,7 @@
* newAppt.end = end;
*
* &sol;&sol; Create Attendee
-* var attendees = new Array();
+* var attendees = [];
* var onlyAttendee = new blackberry.pim.Attendee();
* onlyAttendee.address = &quot;john@foo.com&quot;;
* onlyAttendee.type = blackberry.pim.Attendee.INVITED;
View
8 api/blackberry_ui_dialog.js
@@ -35,7 +35,7 @@ blackberry.ui.dialog ={
* &lt;script type="text/javascript"&gt;
*
* function globalDialog() {
- * var ss = new Array("Saab", "Volvo", "BMW", "Subaru");
+ * var ss = ["Saab", "Volvo", "BMW", "Subaru"];
* var ret = blackberry.ui.dialog.customAsk("Select your favorite car", ss, 2, true);
*
* document.getElementById('carSelect').innerHTML = ss[ret]
@@ -68,7 +68,7 @@ blackberry.ui.dialog ={
*
* function customDialog() {
* try {
- * var buttons = new Array("Yes", "No", "Sometimes", "NA");
+ * var buttons = ["Yes", "No", "Sometimes", "NA"];
* var ops = {title : "Choose the answer that describes you best", size : blackberry.ui.dialog.SIZE_TALL, position : blackberry.ui.dialog.LOC_CENTER};
* blackberry.ui.dialog.customAskAsync("Do you routinely work out?", buttons, dialogCallBack, ops);
* } catch(e) {
@@ -97,7 +97,7 @@ blackberry.ui.dialog ={
* }
*
* function globalDialog() {
- * var ss = new Array("Saab", "Volvo", "BMW");
+ * var ss = ["Saab", "Volvo", "BMW"];
* var ret = blackberry.ui.dialog.customAsk("Select your favorite car", ss, 2, true);
* blackberry.ui.dialog.standardAsk(blackberry.ui.dialog.D_OK, "You selected " + ss[ret], 0, true);
* }
@@ -303,4 +303,4 @@ blackberry.ui.dialog ={
* @PB10
*/
SIZE_TALL : null
-};
+};
View
4 api/blackberry_utils.js
@@ -81,6 +81,7 @@ blackberry.utils = {
* @description Obtain the value of a parameter by key.
* @param {String} key The key of the parameter to be retrieved.
* @returns {String} An undefined object is returned if the key does not exist in the URL query.
+ * @BB50+
* @PB10
*/
getURLParameter:function(key){},
@@ -89,20 +90,23 @@ blackberry.utils = {
* @description Obtain the value of a parameter by index. The values are stored in the order they appear in the URL string.
* @param {Number} index The index of the parameter to be retrieved.
* @returns {String} An undefined object is returned if the index is invalid.
+ * @BB50+
* @PB10
*/
getURLParameterByIndex:function(index){},
/**
* @readOnly
* @type String
+ * @BB50+
* @PB10
* @description Host address in the URL string.
*/
host:null,
/**
* @readOnly
* @type String
+ * @BB50+
* @PB10
* @description Port number in the URL string.
*/
View
46 api/html5_app_cache.js
@@ -16,20 +16,42 @@
/**
* @class The applicationCache object is your programmatic access to the browser's app cache.
- * @constructedBy {window.applicationCache} {Returns the ApplicationCache object that applies to the active document of that Window.}
- * var appCache = window.applicationCache
- * @constructedBy {worker.applicationCache} {Returns the ApplicationCache object that applies to the current shared {@link WebWorkers#applicationCache}.}
- * &lt;script type="text/javascript"&gt;
- * var worker = new Worker('doWork.js');
- * &lt;/script&gt;
- *
- *doWork.js (the worker):
- *
- * var appCache = self.applicationCache()
+ * @notice {Warning (BlackBerry 6.0 Notice):}
+ * Support for Application Cache on BlackBerry Smartphones starts with 6.0.0.418
* @toc {Cache} HTML5 ApplicationCache
*/
ApplicationCache ={
+
+ /**
+ * @constructedBy window.applicationCache
+ * @field
+ * @description Returns the ApplicationCache object that applies to the active document of that Window.
+ * @example
+ * &lt;script type="text/javascript"&gt;
+ * var appCache = window.applicationCache;
+ * &lt;/script&gt;
+ * @BB60+
+ * @PB10
+ */
+ windowConstructor : undefined,
+
+ /**
+ * @constructedBy worker.applicationCache
+ * @field
+ * @description Returns the ApplicationCache object that applies to the current shared {@link Worker#applicationCache}.
+ * @example
+ * &lt;script type="text/javascript"&gt;
+ * var worker = new Worker('doWork.js');
+ * &lt;/script&gt;
+ *
+ *doWork.js (the worker):
+ *
+ * var appCache = self.applicationCache()
+ * @BB60+
+ * @PB10
+ */
+ workerConstructor : undefined,
/**
* @constant
@@ -99,7 +121,7 @@ ApplicationCache ={
*/
OBSOLETE: 5
};
-
+
/**
* @description
*The current state of the application cache that the ApplicationCache object's cache host is associated with, if any.
@@ -292,4 +314,4 @@ ApplicationCache.prototype.cached = undefined;
* appCache.addEventListener('obsolete', handleCacheEvent, false);
*/
ApplicationCache.prototype.obsolete = undefined;
-
+
View
946 api/html5_canvas_context2d.js
@@ -0,0 +1,946 @@
+/*
+* Copyright 2010-2011 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/*
+* Taken from: http://dev.w3.org/html5/2dcontext/
+*/
+
+/**
+* @namespace
+* The 2D context represents a flat Cartesian surface whose origin
+* (0,0) is at the top left corner, with the coordinate space
+* having x values increasing when going right, and y values
+* increasing when going down.
+* @toc {User Interface} HTML5 2D Canvas Context
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D = { };
+
+
+/**
+* @field
+* @constructedBy canvas.getContext(&#039;2d&#039;)
+* @description to create an CanvasRenderingContext2D object you must fetch the context of a {@link Canvas} using the '2d' identifier
+* @example
+* &lt;html&gt;
+* &lt;head&gt;
+* &lt;title&gt;Example&lt;/title&gt;
+* &lt;script type=&quot;text/javascript&quot;&gt;
+* function foo()
+* {
+* var canvas = document.getElementById(&quot;myCanvas&quot;)
+* var context = canvas.getContext(&#039;2d&#039;);
+*
+* // Draw a pink triangle
+* context.beginPath();
+* context.lineWidth=&quot;3&quot;;
+* context.strokeStyle=&quot;magenta&quot;;
+* context.fillStyle=&quot;pink&quot;;
+* context.moveTo(150,0);
+* context.lineTo(300,200);
+* context.lineTo(0,200);
+* context.closePath();
+* context.fill();
+* context.stroke();
+* }
+* &lt;/script&gt;
+* &lt;/head&gt;
+* &lt;body onload=&quot;foo();&quot;&gt;
+* &lt;canvas id=&quot;myCanvas&quot; width=&quot;300&quot; height=&quot;300&quot;&gt;&lt;/canvas&gt;
+* &lt;/body&gt;
+* &lt;/html&gt;
+* @PB10
+* @BB60+
+*/
+CanvasRenderingContext2D.documentConstructor = undefined;
+
+
+/**
+* Return the canvas interface element that the context paints on.
+* @type canvas
+* @readOnly
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.canvas = { };
+
+/**
+* Push a copy of the current drawing state onto the drawing state stack.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.save = function() { };
+
+/**
+* Pop the top entry in the drawing state stack, and reset the drawing
+* state it describes.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.restore = function() { };
+
+
+/**
+* Add the scaling transformation described by the arguments to the
+* transformation matrix. The x argument represents the scale factor
+* in the horizontal direction and the y argument represents the scale factor in the vertical direction. The factors are multiples.
+* @param {Number} x the amount to scale horizontally
+* @param {Number} y the amount to scale vertically
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.scale = function(x, y) { };
+
+
+/**
+* Add the rotation transformation described by the argument to the
+* transformation matrix. The angle argument represents a clockwise
+* rotation angle expressed in radians.
+* @param {Number} angle clockwise rotation angle expressed in radians
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.rotate = function(angle) { };
+
+/**
+* Add the translation transformation described by the arguments to
+* the transformation matrix. The x argument represents the translation
+* distance in the horizontal direction and the y argument represents
+* the translation distance in the vertical direction. The arguments
+* are in coordinate space units.
+* @param {Number} x x-coord of the translation
+* @param {Number} y y-coord of the translation
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.translate = function(x, y) { };
+
+/**
+* Method must replace the current transformation matrix with the
+* result of multiplying the current transformation matrix with
+* the matrix described by:
+* <table>
+* <tr><td>m11</td><td>m21</td><td>dx</td></tr>
+* <tr><td>m12</td><td>m22</td><td>dy</td></tr>
+* <tr><td>0</td><td>0</td><td>1</td></tr>
+* </table>
+* @param {Number} m11 Is the (1,1) parameter of of the transformation matrix
+* @param {Number} m12 Is the (1,2) parameter of of the transformation matrix
+* @param {Number} m21 Is the (2,1) parameter of of the transformation matrix
+* @param {Number} m22 Is the (2,2) parameter of of the transformation matrix
+* @param {Number} dx Is the x-scalar of the transformation matrix
+* @param {Number} dy Is the y-scalar of the transformation matrix
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.transform = function(m11, m12, m21, m22, dx, dy) { };
+
+/**
+* Reset the current transform to the identity matrix (it should not
+* change the image). To transform the image, invoke the transform(m11,
+* m12, m21, m22, dx, dy) method with the appropriate arguments.
+* @param {Number} m11 Is the (1,1) parameter of of the transformation matrix
+* @param {Number} m12 Is the (1,2) parameter of of the transformation matrix
+* @param {Number} m21 Is the (2,1) parameter of of the transformation matrix
+* @param {Number} m22 Is the (2,2) parameter of of the transformation matrix
+* @param {Number} dx Is the x-scalar of the transformation matrix
+* @param {Number} dy Is the y-scalar of the transformation matrix
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.setTransform = function(m11, m12, m21, m22, dx, dy) { };
+
+/**
+* The current alpha value applied to rendering operations.
+* Can be set, to change the alpha value. Values outside of the range
+* from 0.0 to 1.0 are ignored.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.globalAlpha = 1.0;
+
+/**
+* The current composition operation, from the list below.
+* Can be set, to change the composition operation. Unknown values
+* are ignored.
+*
+* <ul>
+* <li>&quot;copy&quot;:<br/>
+* A (B is ignored). Display the source image instead of the
+* destination image.</li>
+* <li>&quot;destination-atop&quot;:<br/>
+* B atop A. Display the destination image wherever both images
+* are opaque. Display the source image wherever the source image
+* is opaque but the destination image is transparent. Display
+* transparency elsewhere.</li>
+* <li>&quot;destination-in&quot;:<br/>
+* B in A. Display the destination image wherever both the
+* destination image and source image are opaque. Display
+* transparency elsewhere.</li>
+* <li>&quot;destination-out&quot;:<br/>
+* B out A. Display the destination image wherever the destination
+* image is opaque and the source image is transparent. Display
+* transparency elsewhere.</li>
+* <li>&quot;destination-over&quot;:<br/>
+* B over A. Display the destination image wherever the destination
+* image is opaque. Display the source image elsewhere.</li>
+* <li>&quot;lighter&quot;:<br/>
+* A plus B. Display the sum of the source image and destination
+* image, with color values approaching 1 as a limit.</li>
+* <li>&quot;source-atop&quot;:<br/>
+* A atop B. Display the source image wherever both images are opaque.
+* Display the destination image wherever the destination image is
+* opaque but the source image is transparent. Display transparency
+* elsewhere.</li>
+* <li>&quot;source-in&quot;:<br/>
+* A in B. Display the source image wherever both the source image
+* and destination image are opaque. Display transparency elsewhere.</li>
+* <li>&quot;source-out&quot;:<br/>
+* A out B. Display the source image wherever the source image is
+* opaque and the destination image is transparent. Display
+* transparency elsewhere.</li>
+* <li>&quot;source-over&quot; (default):<br/>
+* A over B. Display the source image wherever the source image is
+* opaque. Display the destination image elsewhere.</li>
+* <li>&quot;vendorName-operationName&quot;:<br/>
+* Vendor-specific extensions to the list of composition operators
+* should use this syntax.</li>
+* <li>&quot;xor&quot;:<br/>
+* A xor B. Exclusive OR of the source image and destination image.</li>
+* </ul><br/><br/>
+* These values are all case-sensitive and must be used exactly as
+* shown. User agents must not recognize values that are not a
+* case-sensitive match for one of the values given above.<br/><br/>
+*
+* The operators in the previous list must be treated as described
+* by the Porter-Duff operator given at the start of their
+* description (e.g. A over B).<br/><br/>
+*
+* On setting, if the user agent does not recognize the
+* specified value, the value must be ignored, leaving
+* the value of globalCompositeOperation unaffected.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.globalCompositeOperation = "source-over";
+
+/**
+*The current style used for the stroke of the shapes. <br/>
+* Can be set, to change the stroke style. <br/>
+* The style can be either a string containing a CSS color, or a
+* {@link CanvasGradient} or {@link CanvasPattern} object.
+* @type Object
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.strokeStyle = "black";
+
+/**
+* The current style used for filling shapes. <br/>
+* Can be set, to change the fill style.<br/>
+* The style can be either a string containing a CSS color, or a
+* {@link CanvasGradient} or {@link CanvasPattern} object.
+* Invalid values are ignored.
+* @type Object
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.fillStyle = "black"
+
+/**
+* Returns a CanvasGradient object that
+* represents a linear gradient that paints
+* along the line given by the coordinates
+* represented by the arguments.<br/><br/>
+*
+* If x0 = x1 and y0 = y1, then the linear gradient will paint nothing.
+* @param {Number} x0 x-coord of the start point
+* @param {Number} y0 y-coord of the start point
+* @param {Number} x1 x-coord of the end point
+* @param {Number} y1 y-coord of the end point
+* @return {CanvasGradient} The created {@link CanvasGradient}
+* @throws {NOT_SUPPORTED_ERR} If any of the arguments are not finite numbers.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.createLinearGradient = function(x0, y0, x1, y1) { };
+
+/**
+* Returns a CanvasGradient object that represents a radial
+* gradient that paints along the cone given by the circles
+* represented by the arguments.
+* @param {Number} x0 x-coord of the start circle
+* @param {Number} y0 y-coord of the start circle
+* @param {Number} r0 radius of the start circle
+* @param {Number} x1 x-coord of the end circle
+* @param {Number} y1 y-oord of the end circle
+* @param {Number} r1 radius of the end circle
+* @return {CanvasGradient} The created {@link CanvasGradient}
+* @throws {NOT_SUPPORTED_ERR} If any of the arguments are not finite numbers.
+* @throws {INDEX_SIZE_ERR} If either of the radii are negative.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.createRadialGradient = function (x0, y0, r0, x1, y1, r1) { };
+
+/**
+* Returns a {@link CanvasPattern} object that uses the given image and
+* repeats in the direction(s) given by the repetition
+* argument.<br/><br/>
+*
+* The allowed values for repetition are "repeat" (both directions),
+* "repeat-x" (horizontal only), "repeat-y" (vertical only), and
+* "no-repeat" (neither). If the repetition argument is empty or
+* null, the value repeat is used. <br/><br/>
+*
+* If the first argument is not an img, canvas interface
+* element, or video element, throws a
+* TYPE_MISMATCH_ERR exception.<br/><br/>
+*
+* If the image is not fully decoded yet or has no image data,
+* throws an INVALID_STATE_ERR exception. <br/><br/>
+*
+* If the second argument is not one of the allowed values
+* a SYNTAX_ERR exception.<br/><br/>
+* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image
+* @param {String} repetition
+* @return {CanvasPattern} The created {@link CanvasPattern}
+* @throws {TYPE_MISMATCH_ERR} If the first argument isn't an img, canvas, or video element.
+* @throws {INVALID_STATE_ERR} If the image has no image data.
+* @throws {SYNTAX_ERR} If the second argument isn't one of the allowed values.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.createPattern = function(image, repetition) { };
+
+/**
+* The current line width.<br/>
+* Can be set, to change the line width.<br/>
+* Values that are not finite values greater than zero are ignored.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.lineWidth = 1; // (default 1)
+
+
+/**
+* The current line cap style. <br/>
+* Can be set, to change the line cap style.<br/>
+* The possible line cap styles are "butt", "round", and "square". <br/>
+* Other values are ignored.<br/>
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.lineCap = "butt"; // "butt", "round", "square" (default "butt")
+
+/**
+* Returns the current line join style.<br/>
+* Can be set, to change the line join style.<br/>
+* The possible line join styles are "miter", "round", and "bevel". <br/>
+* Other values are ignored.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.lineJoin = "miter"; // "miter", "round", "bevel" (default "miter")
+
+/**
+* The current miter limit ratio.<br/>
+* Can be set, to change the miter limit ratio.<br/>
+* Values that are not finite values greater than zero are ignored.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.miterLimit = 10; // (default 10)
+
+/**
+* The current shadow offset.<br/>
+* Can be set, to change the shadow offset. Values that are not
+* finite numbers are ignored.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.shadowOffsetX = 0; // (default 0)
+
+/**
+* The current shadow offset.<br/>
+* Can be set, to change the shadow offset. Values that are not
+* finite numbers are ignored.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.shadowOffsetY = 0; // (default 0)
+
+/**
+* The current level of blur applied to shadows.<br/>
+* Can be set, to change the blur level. Values that are not finite
+* numbers greater than or equal to zero are ignored.<br/><br/>
+* The units do not map to coordinate space units and are
+* not affected by the current transformation matrix.
+* @type Number
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.shadowBlur = 0; // (default 0)
+
+/**
+* Returns the current shadow color.<br/>
+* Can be set, to change the shadow color. Values that cannot be
+* parsed as CSS colors are ignored.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.shadowColor = "transparent black"; // (default transparent black)
+
+/**
+* Clears all pixels on the canvas in the given rectangle
+* to transparent black.
+* @param {Number} x x-coord of the rectangle
+* @param {Number} y y-coord of the rectangle
+* @param {Number} w width of the rectangle
+* @param {Number} h height of the rectangle
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.clearRect = function(x, y, w, h) { };
+
+/**
+* Paints the given rectangle onto the canvas, using
+* the current fill style.
+* @param {Number} x x-coord of the rectangle
+* @param {Number} y y-coord of the rectangle
+* @param {Number} w width of the rectangle
+* @param {Number} h height of the rectangle
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.fillRect = function(x, y, w, h) { };
+
+/**
+* Paints the box that outlines the given rectangle onto the
+* canvas, using the current stroke style.
+* @param {Number} x x-coord of the rectangle
+* @param {Number} y y-coord of the rectangle
+* @param {Number} w width of the rectangle
+* @param {Number} h height of the rectangle
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.strokeRect = function(x, y, w, h) { };
+
+
+/**
+* Resets the current path.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.beginPath = function() { };
+
+/**
+* Marks the current subpath as closed, and starts a new subpath with
+* a point the same as the start and end of the newly closed subpath.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.closePath = function() { };
+
+/**
+* Creates a new subpath with the given point as its first
+* (and only) point.
+* @param {Number} x x-coord of the point to move to
+* @param {Number} y y-coord of the point to move to
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.moveTo = function(x, y) { };
+
+/**
+* Adds the given point to the current subpath, connected to
+* the previous point by a straight line.
+* @param {Number} x x-coord of the end point to draw a line to
+* @param {Number} y y-coord of the end point to draw a line to
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.lineTo = function(x, y) { };
+
+/**
+* Adds the given point to the current path, connected to
+* the previous one by a quadratic Bézier curve with the
+* given control point.
+* @param {Number} cpx x-coord of the intermediate control point describing the curve
+* @param {Number} cpy y-coord of the intermediate control point describing the curve
+* @param {Number} x x-coord of the end point
+* @param {Number} y y-coord of the end point
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.quadraticCurveTo = function(cpx, cpy, x, y) { };
+
+/**
+* Adds the given point to the current path, connected to the
+* previous one by a cubic Bézier curve with the given control points.
+* @param {Number} cp1x x-coord of the first intermediate control point describing the curve
+* @param {Number} cp1y y-coord of the first intermediate control point describing the curve
+* @param {Number} cp2x x-coord of the second intermediate control point describing the curve
+* @param {Number} cp2y y-coord of the second intermediate control point describing the curve
+* @param {Number} x x-coord of the end point
+* @param {Number} y y-coord of the end point
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) { };
+
+/**
+* Adds a point to the current path, connected to the previous one by
+* a straight line, then adds a second point to the current path,
+* connected to the previous one by an arc whose properties are
+* described by the arguments.<br/><br/>
+*
+* If the given radius is negative, throws an INDEX_SIZE_ERR exception .
+* @param {Number} x1 x-coord of the start point
+* @param {Number} y1 y-coord of the start point
+* @param {Number} x2 x-coord of the end point
+* @param {Number} y2 y-coord of the end point
+* @param {Number} radius radius of the arc
+* @throws {INDEX_SIZE_ERR} If the given radius is negative.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) { };
+
+/**
+* Adds a new closed subpath to the path, representing the
+* given rectangle.
+* @param {Number} x x-coord of the rectangle
+* @param {Number} y y-coord of the rectangle
+* @param {Number} w width of the rectangle
+* @param {Number} h height of the rectangle
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.rect = function(x, y, w, h) { };
+
+/**
+* Adds points to the subpath such that the arc described by the
+* circumference of the circle described by the arguments—starting
+* at the given start angle, ending at the given end angle, and going
+* in the given direction—is added to the path, connected to the
+* previous point by a straight line. <br/><br/>
+*
+* If the given radius is negative, throws an INDEX_SIZE_ERR exception.
+* @param {Number} x x-coord of the start point
+* @param {Number} y y-coord of the start point
+* @param {Number} radius radius of the arc
+* @param {Number} startAngle start angle in radians
+* @param {Number} endAngle end angle in radians
+* @param {Boolean} anticlockwise if true draw the arc anti-clockwise
+* @throws {INDEX_SIZE_ERR} If the given radius is negative.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.arc = function(x, y, radius, startAngle, endAngle, anticlockwise) { };
+
+/**
+* Fills the subpaths with the current fill style.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.fill = function() { };
+
+/**
+* Creates the strokes of the subpaths with the current
+* stroke style.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.stroke = function() { };
+
+/**
+* Further constrains the clipping region to the given path.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.clip = function() { };
+
+/**
+* Returns true if the given point is in the current path.
+* @param {Number} x x-coord of the point to check
+* @param {Number} y y-coord of the point to check
+* @returns {Boolean} true if point x,y is in the path, otherwise false
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.isPointInPath = function(x, y) { };
+
+
+/**
+* If the given element is focused or a descendant of the element with
+* focus, draws a focus ring around the current path, following the
+* platform conventions for focus rings.
+* @param {Element} element check if the given element is focused
+* @param {Boolean} [canDrawCustom] If true, then the focus ring is only drawn if the user has configured his system to draw focus rings in a particular manner. (For example, high contrast focus rings.)
+* @returns {Boolean} When the method returns true, the author is expected to manually draw a focus ring
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.drawFocusRing = function(element, canDrawCustom) { };
+
+
+/**
+* Returns the blink rate of the system in milliseconds if supported.
+* Otherwise, returns -1 if it is unsupported by the system.
+* @returns {Number} blinkrate in milliseconds. -1 if unsupported.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.caretBlinkRate = function() { };
+
+
+/**
+* Returns true if the given element is focused or a document
+* descendant of an element with focus. Otherwise, returns false.
+* @param {Element} element
+* @param {Number} x x-coord of the selection position
+* @param {Number} y y-coord of the selection position
+* @param {Number} w width of the selection position
+* @param {Number} h height of the selection position
+* @returns {Boolean} true if the given element is focused or a document descendant of an element with focus. Otherwise, returns false
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.setCaretSelectionRect = function(element, x, y, w, h){};
+
+
+/**
+* The current font settings.<br/>
+* Can be set, to change the font. The syntax is the same as
+* for the CSS 'font' property; values that cannot be parsed
+* as CSS font values are ignored.<br/>
+* Relative keywords and lengths are computed relative to the
+* font of the canvas interface element.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.font = "10px sans-serif"; // (default 10px sans-serif)
+
+/**
+* The current text alignment settings.<br/>
+* Can be set, to change the alignment. The possible values are
+* "start", "end", "left", "right", and "center". The default
+* is "start". <br/>
+* Other values are ignored.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.textAlign = "start"; // "start", "end", "left", "right", "center" (default: "start")
+
+/**
+* The current baseline alignment settings.<br/>
+* Can be set, to change the baseline alignment. The possible
+* values are "top", "hanging", "middle", "alphabetic", "ideographic",
+* and "bottom". The default is "alphabetic". Other values are
+* ignored.
+* @type String
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.textBaseline = "alphabetic"; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
+
+/**
+* Renders fill for the given text at the given position. If a
+* maximum width is provided, the text is scaled to fit that
+* width if necessary.
+* @param {String} text the text to fill
+* @param {Number} x the x-coord of where the text is placed
+* @param {Number} y the y-coord of where the text is placed
+* @param {Number} [maxWidth] The maximum width the text should take up
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.fillText = function(text, x, y, maxWidth) { };
+
+/**
+* Renders strokes for the given text at the given position.
+* If a maximum width is provided, the text is scaled to fit
+* that width if necessary.
+* @param {String} text
+* @param {Number} x the x-coord of where the text is placed
+* @param {Number} y the y-coord of where the text is placed
+* @param {Number} [maxWidth] The maximum width the text should take up
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.strokeText = function(text, x, y, maxWidth) { };
+
+/**
+* Returns a {@link TextMetrics} object with the metrics of the
+* given text in the current font.
+* @param {String} text the text string to measure
+* @returns {TextMetrics} the width of the text if rendered
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.measureText = function(text) { };
+
+
+/**
+* Draw the given image onto the canvas.<br/><br/>
+* {@image images/drawImage.png}
+* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image the source image
+* @param {Number} dx x-coord of the destination position
+* @param {Number} dy y-coord of the destination position
+* @param {Number} [dw] width of the destination position
+* @param {Number} [dh] height of the destination position
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.drawImage = function(image, dx, dy, dw, dh) { };
+
+/**
+* Draw the given image onto the canvas.<br/><br/>
+* The source rectangle is the rectangle whose corners are the four
+* points (sx, sy), (sx+sw, sy), (sx+sw, sy+sh),
+* (sx, sy+sh).<br/><br/>
+*
+* The destination rectangle is the rectangle whose corners are
+* the four points (dx, dy), (dx+dw, dy),
+* (dx+dw, dy+dh), (dx, dy+dh).<br/><br/>
+*
+* If not specified, the dw and dh arguments must default to
+* the values of sw and sh, interpreted such that one CSS pixel
+* in the image is treated as one unit in the canvas
+* coordinate space. If the sx, sy, sw, and sh arguments are
+* omitted, they must default to 0, 0, the image's intrinsic
+* width in image pixels, and the image's intrinsic height
+* in image pixels, respectively.<br/><br/>
+* {@image images/drawImage.png}
+* @name CanvasRenderingContext2D.prototype.drawImage^2
+* @function
+* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image the source image
+* @param {Number} sx x-coord of the source position
+* @param {Number} sy y-coord of the source position
+* @param {Number} sw width of the source position
+* @param {Number} sh height of the source position
+* @param {Number} dx x-coord of the destination position
+* @param {Number} dy y-coord of the destination position
+* @param {Number} dw width of the destination position
+* @param {Number} dh height of the destination position
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.drawImage = function(image, sx, sy, sw, sh, dx, dy, dw, dh) { };
+
+
+/**
+* @name CanvasRenderingContext2D.prototype.createImageData^2
+* @function
+* @description Returns an {@link ImageData} object with the given dimensions in CSS pixels
+* (which might map to a different number of actual device pixels
+* exposed by the object itself). All the pixels in the returned
+* object are transparent black.
+* @param {Number} sw width of the image data object to create
+* @param {Number} sh height of the image data object to create
+* @returns {ImageData} The {@link ImageData} for the current context
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.createImageData = function(sw, sh) { };
+
+/**
+* @description Returns an {@link ImageData} object with the same dimensions as the
+* argument. All the pixels in the returned object are
+* transparent black.
+* @param {ImageData} imagedata The {@link ImageData} to copy
+* @returns {ImageData} The {@link ImageData} for the current context
+* @throws {NOT_SUPPORTED_ERR} If the argument is null
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.createImageData = function(imagedata) { };
+
+/**
+* @description Returns an {@link ImageData} object containing the image data
+* for the given rectangle of the canvas.
+* @param {Number} sx x-coord of the source position
+* @param {Number} sy y-coord of the source position
+* @param {Number} sw width of the source position
+* @param {Number} sh height of the source position
+* @returns {ImageData} The {@link ImageData}
+* @throws {INDEX_SIZE_ERR} If the either of the width or height arguments are zero.
+* @throws {NOT_SUPPORTED_ERR} If the argument is null
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.getImageData = function(sx, sy, sw, sh) { };
+
+
+/**
+* Paints the data from the given ImageData object onto the
+* canvas. If a dirty rectangle is provided, only the pixels
+* from that rectangle are painted.<br/><br/>
+*
+* The globalAlpha and globalCompositeOperation attributes,
+* as well as the shadow attributes, are ignored for the
+* purposes of this method call; pixels in the canvas are
+* replaced wholesale, with no composition, alpha
+* blending, no shadows, etc.
+* @param {ImageData} imagedata The {@link ImageData} to copy
+* @param {Number} dx x-coord of the destination position
+* @param {Number} dy y-coord of the destination position
+* @param {Number} [dirtyX] x-coord of the source position
+* @param {Number} [dirtyY] y-coord of the source position
+* @param {Number} [dirtyWith] width of the source position
+* @param {Number} [dirtyHeight] height of the source position
+* @throws {TYPE_MISMATCH_ERR} If the first argument is null
+* @throws {NOT_SUPPORTED_ERR} If any of the other arguments are not finite.
+* @BB60+
+* @PB10
+*/
+CanvasRenderingContext2D.prototype.putImageData = function(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) { };
+
+
+/**
+* @namespace
+* An object representing a canvas gradient pattern
+* @BB60+
+* @PB10
+*/
+CanvasGradient = function() { };
+
+/**
+* Adds a color stop with the given color to the gradient at the
+* given offset. 0.0 is the offset at one end of the gradient,
+* 1.0 is the offset at the other end.
+* @param {Number} offset the offset of the new stop
+* @param {String} color the color of the new stop
+* @throws {INDEX_SIZE_ERR} If the offset is less than 0, greater than 1, infinite, or NaN
+* @throws {SYNTAX_ERR} If the color cannot be parsed
+* @BB60+
+* @PB10
+*/
+CanvasGradient.prototype.addColorStop = function(offset, color) { };
+
+/**
+* @namespace
+* An object representing a canvas pattern
+* @BB60+
+* @PB10
+*/
+CanvasPattern = function() { };
+
+/**
+* @namespace
+* The measureText() method takes one argument, text. When the
+* method is invoked it returns a {@link TextMetrics} object with
+* width property set to the width the text given the set font and
+* element properties.
+* @BB60+
+* @PB10http://dev.w3.org/html5/2dcontext/#dom-context-2d-createlineargradient
+*/
+TextMetrics = function() { };
+
+/**
+* text width
+* @type Number
+* @readOnly
+* @BB60+
+* @PB10
+*/
+TextMetrics.prototype.width = { };
+
+/**
+* @namespace
+* An object representing image data on a canvas
+* @BB60+
+* @PB10
+*/
+ImageData = function() { };
+
+/**
+* The image data
+* @type CanvasPixelArray
+* @readOnly
+* @BB60+
+* @PB10
+*/
+ImageData.prototype.data = undefined;
+
+/**
+* The number of physical device pixels per row in the image data.
+* @type Number
+* @readOnly
+* @BB60+
+* @PB10
+*/
+ImageData.prototype.height = undefined;
+
+/**
+* The number of rows in the image data.
+* @type Number
+* @readOnly
+* @BB60+
+* @PB10
+*/
+ImageData.prototype.width = undefined;
+
+/**
+* @namespace
+* The CanvasPixelArray object provides ordered, indexed access to
+* the color components of each pixel of the image data. The data
+* must be represented in left-to-right order, row by row top
+* to bottom, starting with the top left, with each pixel's
+* red, green, blue, and alpha components being given in that
+* order for each pixel. Each component of each device pixel
+* represented in this array must be in the range 0..255,
+* representing the 8 bit value for that component. The
+* components must be assigned consecutive indices starting with
+* 0 for the top left pixel's red component.
+* @BB60+
+* @PB10
+*/
+CanvasPixelArray = function() {};
+
+/**
+* @squareAccessor
+* @function
+* @param {Number} index the index'th component in the array to set or retrieve
+* @returns {Number} the value of the index'th component in the array
+* @readOnly
+* @BB60+
+* @PB10
+*/
+CanvasPixelArray.prototype.item = function() { };
+
+/**
+* The length of the pixel array
+* @type Number
+* @readOnly
+* @BB60+
+* @PB10
+*/
+CanvasPixelArray.prototype.length = { };
View
144 api/html5_database.js
@@ -15,43 +15,62 @@
*/
/**
- * @PB10
- * @BB50+
* @toc {Data Storage} HTML5 Database
* @namespace This object provides functions to manipulate client-side databases using SQL.
- * <p/>
- * <b>Important Note:</b> The HTML5 Database object is marked as supported for OS 5.0. This support is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
- * @constructedBy {Window.openDatabase(String name, String version, String displayName, Number estimatedSize, function creationCallback)} {You can use Window.openDatabase method to get an instance of database. This method has five parameters: <i>name</i> is a database name; <i>version</i> is a database version; <i>displayName</i> is a display name; <i>estimatedSize</i> is an estimated size -in bytes- of the data that will be stored in the database; and <i>creationCallback</i> is optional callback function and is invoked if the database has not yet been created. Expected callback function signature: function DatabaseCallback(Database database).}
- * // This is an example of how to get an instance of Database.
- * Database db=Window.openDatabase('documents', '1.0', 'Offline document storage', 5*1024*1024, null);
- *
- *
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Database support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-Database ={
+Database = {
+
+ /**
+ * @function
+ * @constructedBy Window.openDatabase
+ * @description Creates a new databse object.
+ * If the database already exists, the existing database will be returned and the creation callback will not be invoked.
+ * @param {String} name The name of the database to be created
+ * @param {String} version The version of the database to be created
+ * @param {String} displayName The display name of the database to be created
+ * @param {Number} estimatedSize The estimated size in bytes of the database
+ * @callback {function} creationCallback The callback will be invoked when the database is first created.
+ * @callback {Database} creationCallback.database The newly created database
+ * @returns {Database} The database object that has been opened.
+ * @example
+ * Database db=Window.openDatabase('documents', '1.0', 'Offline document storage', 5*1024*1024, null);
+ * @PB10
+ * @BB50+
+ */
+ openDatabase : undefined
+};
+
+
/**
* @description The current version of the database.
* @readOnly
* @type String
* @PB10
* @BB50+
*/
- version : "",
+ Database.prototype.version = "";
/**
* @description When called, this method immediately returns and then asynchronously runs the transaction steps with the <i>transaction callback</i> being the first argument, the <i>error callback</i> being the second argument, if any, the <i>success callback</i> being the third argument, if any, and with no <i>preflight operation</i> or <i>postflight operation</i>. The mode is read/write.
- * @callback {function} callback Function to be called when executing SQL statements. Expected signature: function SQLTransactionCallback(SQLTransaction transaction).
- * @callback {function} [errorCallback] Function to be called when SQL error occurs. Expected signature: function SQLTransactionErrorCallback(SQLError error).
- * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully. Expected signature: function SQLVoidCallback().
+ * @callback {function} callback Function to be called when executing SQL statements.
+ * @callback {SQLTransaction} callback.transaction The transaction to be executed.
+ * @callback {function} [errorCallback] Function to be called when an SQL error occurs.
+ * @callback {SQLError} errorCallback.error The {@link SQLError} object describing the SQL error that occurred.
+ * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully.
* @PB10
* @BB50+
*/
- transaction : function(callback, errorCallback, successCallback){},
+ Database.prototype.transaction = function(callback, errorCallback, successCallback){};
/**
* @description When called, this method immediately returns and then asynchronously runs the transaction steps with the <i>transaction callback</i> being the first argument, the <i>error callback</i> being the second argument, if any, the <i>success callback</i> being the third argument, if any, and with no <i>preflight operation</i> or <i>postflight operation</i>. The mode is read-only.
- * @callback {function} callback Function to be called when executing SQL statements. Expected signature: function SQLTransactionCallback(SQLTransaction transaction).
- * @callback {function} [errorCallback] Function to be called when SQL error occurs. Expected signature: function SQLTransactionErrorCallback(SQLError error).
- * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully. Expected signature: function SQLVoidCallback().
+ * @callback {function} callback Function to be called when executing SQL statements.
+ * @callback {SQLTransaction} callback.transaction The transaction to be executed.
+ * @callback {function} [errorCallback] Function to be called when an SQL error occurs.
+ * @callback {SQLError} errorCallback.error The {@link SQLError} object describing the SQL error that occurred.
+ * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully.
* @PB10
* @BB50+
* @example
@@ -72,39 +91,43 @@ Database ={
*}
*
*/
- readTransaction : function(callback, errorCallback, successCallback){},
+ Database.prototype.readTransaction = function(callback, errorCallback, successCallback){};
/**
* @description This method allows scripts to atomically verify the version number and change it at the same time as doing a schema update. When the method is invoked, it immediately returns, and then asynchronously runs the transaction steps with the <i>transaction callback</i> being the third argument, the <i>error callback</i> being the fourth argument, the <i>success callback</i> being the fifth argument. If any of the optional arguments are omitted, then they are treated as if they were null.
* @param {String} oldVersion database's current version.
* @param {String} newVersion database's new version.
- * @callback {function} [callback] Function to be called when executing SQL statements. Expected signature: function SQLTransactionCallback(SQLTransaction transaction).
- * @callback {function} [errorCallback] Function to be called when SQL error occurs. Expected signature: function SQLTransactionErrorCallback(SQLError error).
- * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully. Expected signature: function SQLVoidCallback().
+ * @callback {function} callback Function to be called when executing SQL statements.
+ * @callback {SQLTransaction} callback.transaction The transaction to be executed.
+ * @callback {function} [errorCallback] Function to be called when an SQL error occurs.
+ * @callback {SQLError} errorCallback.error The {@link SQLError} object describing the SQL error that occurred.
+ * @callback {function} [successCallback] Function to be called when SQL statement is executed successfully.
* @PB10
* @BB50+
* @example
* db.<b>changeVersion</b>('', '1.0', function (t) {...});
*
*/
- changeVersion : function(oldVersion, newVersion, callback, errorCallback, successCallback){}
-};
+ Database.prototype.changeVersion = function(oldVersion, newVersion, callback, errorCallback, successCallback){};
+
/**
* @toc {Data Storage} HTML5 SQLTransaction
- * @namespace
- * <br/><br/>
- * <b>Important Note:</b> The HTML5 SQLTransaction object is marked as supported for OS 5.0. This support is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
- * @PB10
- * @BB50+
+ * @namespace The SQLTransaction object is the object used to actually run SQL commands on your database.
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Database support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-SQLTransaction = {
+SQLTransaction = {};
/**
* @description This method executes the provided SQL statement.
- * @param {String} sqlStatement the SQL statement
- * @param {Array} [arguments] the optional arguments used to preprocess a SQL statement by binding each ? placeholder with the value of the argument in the arguments array with the same position.
- * @param {function} [callback] Function to be called when statement's result set is ready. Expected signature: function SQLStatementCallback (SQLTransaction transaction, SQLResultSet resultSet).
- * @param {function} [errorCallback] Function to be called when SQL error occurs. Expected signature: function SQLStatementErrorCallback (SQLTransaction transaction, SQLError error).
+ * @param {String} sqlStatement The SQL statement to be executed on the database.
+ * @param {Object[]} [arguments] The optional arguments used to preprocess a SQL statement by binding each ? placeholder with the value of the argument in the arguments array with the same position.
+ * @callback {function} [callback] Function to be called when statement's result set is ready.
+ * @callback {SQLTransaction} callback.transaction The {@link SQLTransaction} object that executed this transaction.
+ * @callback {SQLResultSet} callback.resultSet The{@link SQLResultSet} object that contains the results of the SQL statement.
+ * @callback {function} [errorCallback] Function to be called when an SQL error occurs.
+ * @callback {SQLTransaction} errorCallback.transaction The {@link SQLTransaction} object that executed this transaction.
+ * @callback {SQLError} errorCallback.error The {@link SQLError} object describing the SQL error that occurred.
* @PB10
* @BB50+
* @example
@@ -125,26 +148,24 @@ SQLTransaction = {
*}
*
*/
- executeSql : function(sqlStatement, arguments, callback, errorCallback) {}
-};
+ SQLTransaction.prototype.executeSql = function(sqlStatement, arguments, callback, errorCallback) {};
+
/**
* @toc {Data Storage} HTML5 SQLResultSet
- * @namespace
- * <br/><br/>
- * <b>Important Note:</b> The HTML5 SQLResultSet object is marked as supported for OS 5.0. This support is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
- * @PB10
- * @BB50+
+ * @namespace The SQLResultSet object is generated as a result of executing an SQL Transaction. See {@link SQLTransaction#executeSql}.
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Database support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-SQLResultSet = {
+SQLResultSet = {};
/**
* @description If the SQL statement inserted a row, this attribute returns the row ID of the row that the SQLResultSet object's SQL statement inserted into the database. If the SQL statement inserted multiple rows, this attribute returns the the ID of the last row.
* @readOnly
* @type Number
* @PB10
* @BB50+
*/
- insertId : 0,
+ SQLResultSet.prototype.insertId = 0;
/**
* @description This attribute returns the number of rows that were changed by the SQL statement. If the statement did not affected any rows, 0 is returned.
@@ -153,7 +174,7 @@ SQLResultSet = {
* @PB10
* @BB50+
*/
- rowsAffected : 0,
+ SQLResultSet.prototype.rowsAffected = 0;
/**
* @description This attribute represents the rows returned in the order returned by the database.If no rows were returned, then the object will be empty (its <i>length</i> will be zero).
@@ -162,27 +183,25 @@ SQLResultSet = {
* @PB10
* @BB50+
*/
- rows : null
+ SQLResultSet.prototype.rows = null;
-};
+
/**
* @toc {Data Storage} HTML5 SQLResultSetRowList
- * @namespace
- * <br/><br/>
- * <b>Important Note:</b> The HTML5 SQLResultSetRowList object is marked as supported for OS 5.0. This support is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
- * @PB10
- * @BB50+
+ * @namespace The SQLResultSet object is generated as part of an {@link SQLResultSet} by executing an SQL Transaction. See {@link SQLTransaction#executeSql}.
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Database support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-SQLResultSetRowList = {
+SQLResultSetRowList = {};
/**
* @description The number of rows returned by the database.
* @readOnly
* @type Number
* @PB10
* @BB50+
*/
- length : 0,
+ SQLResultSetRowList.prototype.length = 0;
/**
* @description Return the row with the given index.
@@ -191,16 +210,14 @@ SQLResultSetRowList = {
* @PB10
* @BB50+
*/
- item : function(index) {}
-};
+ SQLResultSetRowList.prototype.item = function(index) {};
+
/**
* @toc {Data Storage} HTML5 SQLError
* @namespace Errors in the asynchronous database API are reported using callbacks that have a <b>SQLError</b> object as one of their arguments.
- * <br/><br/>
- * <b>Important Note:</b> The HTML5 SQLError object is marked as supported for OS 5.0. This support is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
- * @PB10
- * @BB50+
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Database support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
SQLError = {
/**
@@ -281,7 +298,8 @@ SQLError = {
* @BB50+
* @default 7
*/
- TIMEOUT_ERR : 7,
+ TIMEOUT_ERR : 7
+};
/**
* @description The most appropriate error code.
@@ -290,7 +308,7 @@ SQLError = {
* @PB10
* @BB50+
*/
- code : 0,
+ SQLError.prototype.code = 0;
/**
* @description An error message describing the error encountered. The message should be localized to the user's language.
@@ -299,5 +317,5 @@ SQLError = {
* @PB10
* @BB50+
*/
- message : ""
-};
+ SQLError.prototype.message = "";
+
View
1 api/html5_deviceMotion.js
@@ -87,7 +87,6 @@ RotationRate={
*/
/**
- * @description <br/> {@image /images/a-rotation.jpg}</br> Returns the rotation angle around the device frame's Z-axis in degrees.
* @default 90
* @type Number
* @description <br/> {@image /images/a-rotation.jpg}</br> Returns the rotation angle around the device frame's Z-axis in degrees.
View
424 api/html5_geolocation.js
@@ -15,40 +15,43 @@
*/
/**
- * @namespace The Geolocation object is used by scripts to programmatically determine the location information associated with the hosting device. The location information is acquired by applying a user-agent specific algorithm, creating a Position object, and populating that object with appropriate data accordingly.
- * @toc {GPS} HTML5 Geolocation
+ * @class The Geolocation object is used by scripts to programmatically determine the location information associated with the hosting device. The location information is acquired by applying a user-agent specific algorithm, creating a Position object, and populating that object with appropriate data accordingly.
+ * @toc {GPS} HTML5 Geolocation
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Geolocation support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
* @learns {Sample - Using HTML5 Geolocation} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-HTML5-Geolocation-in-your-Web-or-BlackBerry-WebWorks/ta-p/630406 Sample that demonstrates how to use the HTML5 Geolocation API [BlackBerry Developer Resource Center].
* @learns {How To - Enable GPS on PlayBook} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-BlackBerry-WebWorks-for-Tablet/ta-p/1035855 How to enable GPS capability when using the BlackBerry WebWorks SDK for Tablet OS [BlackBerry Developer Resource Center].
*/
-Geolocation = {
-
- /**
- * @description Attempt to obtain the current location of the device.
- * @callback {function} positionCallback This method is called if the attempt is successful i.e. the handleEvent operation must be called on the {@link Position} object
- * @callback {Position} positionCallback.position Object that contains the position that was just received
- * @callback {function} [positionErrorCallback] This optional method is called if the attempt fails, the errorCallback must be invoked with a new {@link PositionError} object, reflecting the reason for the failure.
+navigator.geolocation = {
+
+ /**
+ * @description Attempt to obtain the current location of the device.
+ * @callback {function} positionCallback This method is called if the attempt is successful i.e. the handleEvent operation must be called on the {@link Position} object
+ * @callback {Position} positionCallback.position Object that contains the position that was just received
+ * @callback {function} [positionErrorCallback] This optional method is called if the attempt fails, the errorCallback must be invoked with a new {@link PositionError} object, reflecting the reason for the failure.
* @callback {PositionError} [positionErrorCallback.error] Error call if there is an error.
- * @param {PositionOptions} [options] return {@link PositionOptions} of a current position.
- * @PB10
- * @example
+ * @param {PositionOptions} [options] return {@link PositionOptions} of a current position.
+ * @BB50+
+ * @PB10
+ * @example
* <b>To get current position</b>
*
* var startPos;
* navigator.geolocation.getCurrentPosition(function(position) {
* startPos = position;
* latitude = startPos.coords.latitude;
* longitude = startPos.coords.longitude;
- * });
- *
+ * });
+ *
* <b>Handle Errors</b>
- *
+ *
* var startPos;
* navigator.geolocation.getCurrentPosition(
* function(position) {
* startPos = position;
* latitude = startPos.coords.latitude;
* longitude = startPos.coords.longitude;
- * },
+ * },
* function(error) {
* switch(error.code) {
* case PositionError.PERMISSION_DENIED :
@@ -58,220 +61,233 @@ Geolocation = {
* alert("Error. POSITION_UNAVAILABLE");
* break;
* case PositionError.TIMEOUT:
- * alert("Error. TIMEOUT");
+ * alert("Error. TIMEOUT");
* break;
* default:
* alert("unknow error code");
* }
* }
- * );
- */
- getCurrentPosition : function(PositionCallback, PositionErrorCallback, positionOptions) {};
-
-
- /**
- * @description Like {@link getCurrentPosition} continue to monitor the position of the device and invoke the appropriate callback every time this position changes. It continues until the clearWatch method is called with the corresponding identifier.
- * @callback {function} positionCallback This method is called if the attempt is successful i.e. the handleEvent operation must be called on the {@link Position} object
- * @callback {Position} positionCallback.position Object that contains the position that was just received
- * @callback {function} [positionErrorCallback] This optional method is called if the attempt fails, the errorCallback must be invoked with a new {@link PositionError} object, reflecting the reason for the failure.
+ * );
+ */
+ getCurrentPosition : function(PositionCallback, PositionErrorCallback, positionOptions) {},
+
+
+ /**
+ * @description Like {@link getCurrentPosition} continue to monitor the position of the device and invoke the appropriate callback every time this position changes. It continues until the clearWatch method is called with the corresponding identifier.
+ * @callback {function} positionCallback This method is called if the attempt is successful i.e. the handleEvent operation must be called on the {@link Position} object
+ * @callback {Position} positionCallback.position Object that contains the position that was just received
+ * @callback {function} [positionErrorCallback] This optional method is called if the attempt fails, the errorCallback must be invoked with a new {@link PositionError} object, reflecting the reason for the failure.
* @callback {PositionError} [positionErrorCallback.error] Error call if there is an error.
- * @param {PositionOptions} [options] Return {@link PositionOptions} of a watch position.
- * @returns {Long} Return a watchId so that it can be use in function {@link Geolocation.clearWatch}.
- * @PB10
- */
- watchPosition : function(PositionCallback, PositionErrorCallback, positionOptions) {};
-
-
- /**
- * @description Like {@link getCurrentPosition} continue to monitor the position of the device and invoke the appropriate callback every time this position changes. It continues until the clearWatch method is called with the corresponding identifier.
- * @param {long} watchId A unique identifier return from {@link Geolocation.watchPosition}.
- * @PB10
- */
- clearWatch : function(watchId) {};
-
-
- }
+ * @param {PositionOptions} [options] Return {@link PositionOptions} of a watch position.
+ * @returns {Long} Return a watchId so that it can be use in function {@link navigator.geolocation.clearWatch}.
+ * @BB50+
+ * @PB10
+ */
+ watchPosition : function(PositionCallback, PositionErrorCallback, positionOptions) {},
+
+
+ /**
+ * @description Like {@link getCurrentPosition} continue to monitor the position of the device and invoke the appropriate callback every time this position changes. It continues until the clearWatch method is called with the corresponding identifier.
+ * @param {long} watchId A unique identifier return from {@link navigator.geolocation.watchPosition}.
+ * @PB10
+ * @BB50+
+ */
+ clearWatch : function(watchId) {}
+};
- /**
+/**
* @namespace The Position is the container for the geolocation information.
* @toc {GPS} HTML5 Position
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Geolocation support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
+ * @learns {Sample - Using HTML5 Geolocation} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-HTML5-Geolocation-in-your-Web-or-BlackBerry-WebWorks/ta-p/630406 Sample that demonstrates how to use the HTML5 Geolocation API [BlackBerry Developer Resource Center].
+ * @learns {How To - Enable GPS on PlayBook} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-BlackBerry-WebWorks-for-Tablet/ta-p/1035855 How to enable GPS capability when using the BlackBerry WebWorks SDK for Tablet OS [BlackBerry Developer Resource Center].
*/
-Position = {
-
- /**
- * @description The coords attribute contains a set of geographic coordinates together with their associated accuracy, as well as a set of other optional attributes such as altitude and speed.
- * @BB50+
- * @PB10
- * @type Coordinates
- */
- prototype.coords : "",
-
- /**
- * @description The timestamp attribute represents the time when the Position object was acquired and is represented as a Date.
- * @BB50+
- * @PB10
- * @type Date
- */
- prototype.timestamp : "",
-
- }
+Position = {};
+
+ /**
+ * @description The coords attribute contains a set of geographic coordinates together with their associated accuracy, as well as a set of other optional attributes such as altitude and speed.
+ * @BB50+
+ * @PB10
+ * @type Coordinates
+ */
+ Position.prototype.coords = undefined;
+
+ /**
+ * @description The timestamp attribute represents the time when the Position object was acquired and is represented as a Date.
+ * @BB50+
+ * @PB10
+ * @type Date
+ */
+ Position.prototype.timestamp = undefined;
/**
* @namespace The PositionError is reflecting the reason for the failure.
- * @toc {GPS} HTML5 PositionError
+ * @toc {GPS} HTML5 PositionError
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Geolocation support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
+ * @learns {Sample - Using HTML5 Geolocation} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-HTML5-Geolocation-in-your-Web-or-BlackBerry-WebWorks/ta-p/630406 Sample that demonstrates how to use the HTML5 Geolocation API [BlackBerry Developer Resource Center].
+ * @learns {How To - Enable GPS on PlayBook} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-BlackBerry-WebWorks-for-Tablet/ta-p/1035855 How to enable GPS capability when using the BlackBerry WebWorks SDK for Tablet OS [BlackBerry Developer Resource Center].
*/
-PositionError = {
-
- /**
- * @description Error code. One of the PERMISSION_DENIED, POSITION_UNAVAILABLE or TIMEOUT
- * @BB50+
- * @PB10
- * @readonly
- * @type Short
- */
- prototype.code : "",
-
- /**
- * @description Error message describing the details of the error encountered.
- * @BB50+
- * @PB10
- * @readonly
- * @type String
- */
- prototype.message : "",
-
- /**
- * @description The location acquisition process failed because the document does not have permission to use the Geolocation API.
+PositionError = {
+
+ /**
+ * @description The location acquisition process failed because the document does not have permission to use the Geolocation API.
* @constant
* @default 1
- * @BB50+
- * @PB10
- * @type Number
- */
- PERMISSION_DENIED : 1,
-
- /**
- * @description The position of the device could not be determined.
+ * @BB50+
+ * @PB10
+ * @type Number
+ */
+ PERMISSION_DENIED : 1,
+
+ /**
+ * @description The position of the device could not be determined.
* @constant
* @default 2
- * @BB50+
- * @PB10
- * @type Number
- */
- POSITION_UNAVAILABLE : 2,
-
- /**
- * @description The length of time specified by the {@link PositionOptions.timeout} property has elapsed.
+ * @BB50+
+ * @PB10
+ * @type Number
+ */
+ POSITION_UNAVAILABLE : 2,
+
+ /**
+ * @description The length of time specified by the {@link PositionOptions.timeout} property has elapsed.
* @constant
* @default 3
- * @BB50+
- * @PB10
- * @type Number
- */
- TIMEOUT : 3,
-
- }
+ * @BB50+
+ * @PB10
+ * @type Number
+ */
+ TIMEOUT : 3
+
+};
+
+ /**
+ * @description Error code. One of the {@link PositionError.PERMISSION_DENIED}, {@link PositionError.POSITION_UNAVAILABLE} or {@link PositionError.TIMEOUT}
+ * @BB50+
+ * @PB10
+ * @readonly
+ * @type Number
+ */
+ PositionError.prototype.code = "";
+ /**
+ * @description Error message describing the details of the error encountered.
+ * @BB50+
+ * @PB10
+ * @readonly
+ * @type String
+ */
+ PositionError.prototype.message = "";
+
/**
- * @namespace The PositionOptions represented a native objects with optional properties named enableHighAccuracy, timeout and maximumAge to use in {@link Geolocation.getCurrentPosition} or {@link Geolocation.watchPosition}.
- * @toc {GPS} HTML5 PositionOptions
+ * @namespace The PositionOptions represented a native objects with optional properties named enableHighAccuracy, timeout and maximumAge to use in {@link navigator.geolocation.getCurrentPosition} or {@link navigator.geolocation.watchPosition}.
+ * @toc {GPS} HTML5 PositionOptions
+ * @learns {Sample - Using HTML5 Geolocation} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-HTML5-Geolocation-in-your-Web-or-BlackBerry-WebWorks/ta-p/630406 Sample that demonstrates how to use the HTML5 Geolocation API [BlackBerry Developer Resource Center].
+ * @learns {How To - Enable GPS on PlayBook} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-BlackBerry-WebWorks-for-Tablet/ta-p/1035855 How to enable GPS capability when using the BlackBerry WebWorks SDK for Tablet OS [BlackBerry Developer Resource Center].
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Geolocation support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-PositionOptions = {
+PositionOptions = {};
+
+ /**
+ * @description The enableHighAccuracy attribute provides a hint that the application would like to receive the best possible results. This may result in slower response times or increased power consumption. The user might also deny this capability, or the device might not be able to provide more accurate results than if the flag wasn't specified. The intended purpose of this attribute is to allow applications to inform the implementation that they do not require high accuracy geolocation fixes and, therefore, the implementation can avoid using geolocation providers that consume a significant amount of power (e.g. GPS). This is especially useful for applications running on battery-powered devices, such as mobile phones.
+ * @BB50+
+ * @PB10
+ * @type Boolean
+ */
+ PositionOptions.prototype.enableHighAccuracy = "";
+
+ /**
+ * @description The timeout attribute denotes the maximum length of time (expressed in milliseconds) that is allowed to pass from the call to getCurrentPosition() or watchPosition().
+ * @BB50+
+ * @PB10
+ * @type Number
+ */
+ PositionOptions.prototype.timeout = "";
+
+ /**
+ * @description The maximumAge attribute indicates that the application is willing to accept a cached position whose age is no greater than the specified time in milliseconds.
+ * @BB50+
+ * @PB10
+ * @readonly
+ * @type Number
+ */
+ PositionOptions.prototype.maximumAge = "";
+
- /**
- * @description The enableHighAccuracy attribute provides a hint that the application would like to receive the best possible results. This may result in slower response times or increased power consumption. The user might also deny this capability, or the device might not be able to provide more accurate results than if the flag wasn't specified. The intended purpose of this attribute is to allow applications to inform the implementation that they do not require high accuracy geolocation fixes and, therefore, the implementation can avoid using geolocation providers that consume a significant amount of power (e.g. GPS). This is especially useful for applications running on battery-powered devices, such as mobile phones.
- * @BB50+
- * @PB10
- * @type Boolean
- */
- prototype.enableHighAccuracy : "",
-
- /**
- * @description The timeout attribute denotes the maximum length of time (expressed in milliseconds) that is allowed to pass from the call to getCurrentPosition() or watchPosition().
- * @BB50+
- * @PB10
- * @type Number
- */
- prototype.timeout : "",
-
- /**
- * @description The maximumAge attribute indicates that the application is willing to accept a cached position whose age is no greater than the specified time in milliseconds.
- * @BB50+
- * @PB10
- * @readonly
- * @type Number
- */
- prototype.maximumAge : ""
-
- }
/**
- * @namespace The geographic coordinate reference system used by the attributes in this interface is the World Geodetic System (2d) [WGS84]. No other reference system is supported.
+ * @namespace The geographic coordinate reference system used by the attributes in this interface is the World Geodetic System (2d) [WGS84]. No other reference system is supported.
* @toc {GPS} HTML5 Coordinates
+ * @learns {Sample - Using HTML5 Geolocation} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-HTML5-Geolocation-in-your-Web-or-BlackBerry-WebWorks/ta-p/630406 Sample that demonstrates how to use the HTML5 Geolocation API [BlackBerry Developer Resource Center].
+ * @learns {How To - Enable GPS on PlayBook} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-To-Enable-GPS-capability-in-BlackBerry-WebWorks-for-Tablet/ta-p/1035855 How to enable GPS capability when using the BlackBerry WebWorks SDK for Tablet OS [BlackBerry Developer Resource Center].
+ * @notice {Warning (BlackBerry 5.0 Notice):}
+ * Geolocation support on BlackBerry OS 5.0 is accomplished by using the <a href="http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Supporting-Gears-using-HTML5-in-BlackBerry-WebWorks-applications/ta-p/557280" target="_blank">HTML5 JavaScript toolkit</a> for BlackBerry OS 5.0.
*/
-Coordinates = {
-
- /**
- * @description The latitude attributes is geographic coordinates specified in decimal degrees.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.latitude : "",
-
- /**
- * @description The longitude attributes is geographic coordinates specified in decimal degrees.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.longitude : "",
-
- /**
- * @description The altitude attribute denotes the height of the position, specified in meters above the [WGS84] ellipsoid.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.altitude : "",
-
- /**
- * @description The accuracy attribute denotes the accuracy level of the latitude and longitude coordinates.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.accuracy : "",
-
- /**
- * @description The altitudeAccuracy attribute is in meters.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.altitudeAccuracy : "",
-
- /**
- * @description The heading attribute denotes the direction of travel of the hosting device in degrees, where 0&deg; &le; heading &le; 360&deg;, counting clockwise relative to the true north.
- * @BB50+
- * @PB10
- * @readOnly
- * @type double
- */
- prototype.heading : "",
+Coordinates = {};
+
+ /**
+ * @description The latitude attributes is geographic coordinates specified in decimal degrees.
+ * @BB50+
+ * @PB10
+ * @readOnly
+ * @type Number
+ */