Advertisement
Guest User

Connect IQ API 1.2.9 vs 2.1.0 alpha 2

a guest
Jun 15th, 2016
1,689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 61.13 KB | None | 0 0
  1.  
  2. +    //! The TIMER_STATE enum is used to indicate the state of the recording timer.
  3. +    //!
  4. +    //! The
  5. +    //! timer is off. There is not an active recording
  6. +    //! @since 2.1.0
  7. +    const TIMER_STATE_OFF = 0;
  8. +
  9. +    //! The timer is stopped. The recording is active, with the timer stopped.
  10. +    //! @since 2.1.0
  11. +    const TIMER_STATE_STOPPED = 1;
  12. +
  13. +    //! The timer is paused. The recording is active with the timer paused. This state
  14. +    //! occurs when the timer is active, but has been stopped with the Auto-Pause
  15. +    //! feature.
  16. +    //! @since 2.1.0
  17. +    const TIMER_STATE_PAUSED = 2;
  18. +
  19. +    //! The timer is on. The recording is active and the timer is running.
  20. +    //! @since 2.1.0
  21. +    const TIMER_STATE_ON = 3;
  22. +
  23.  
  24.  
  25. +      //! bearing is the direction from your current location or position to the
  26. +      //! destination of navigation. This is dependent on your current location.
  27. +      //! @since 1.2.10
  28. +      //! @return [Number]
  29. +      var bearing;
  30. +
  31. +      //! bearingFromStart is the direction of desired track from start of navigation to
  32. +      //! destination. This is only dependent on your location when the Course is set, and
  33. +      //! it is not dependent on where you may have moved to.
  34. +      //! @since 1.2.10
  35. +      //! @return [Number]
  36. +      var bearingFromStart;
  37. +
  38.  
  39.  
  40. +      //! Distance to the destination
  41. +      //! @since 1.2.10
  42. +      //! @return [Number]
  43. +      var distanceToDestination;
  44. +
  45. +      //! Distance to the next point
  46. +      //! @since 1.2.10
  47. +      //! @return [Number]
  48. +      var distanceToNextPoint;
  49. +
  50.  
  51. +      //! Elevation at the destination
  52. +      //! @since 1.2.10
  53. +      //! @return [Number]
  54. +      var elevationAtDestination;
  55. +
  56. +      //! Elevation at the next point
  57. +      //! @since 1.2.10
  58. +      //! @return [Number]
  59. +      var elevationAtNextPoint;
  60. +
  61.  
  62.  
  63. +      //! Index of the Front Bicycle Derailleur. Value from 1 to frontDerailleurMax.
  64. +      //! @since 1.2.10
  65. +      //! @return [Number]
  66. +      var frontDerailleurIndex;
  67. +
  68. +      //! Max index on the Front Bicycle Derailleur
  69. +      //! @since 1.2.10
  70. +      //! @return [Number]
  71. +      var frontDerailleurMax;
  72. +
  73. +      //! Gear size on the Front Bicycle Derailleur
  74. +      //! @since 1.2.10
  75. +      //! @return [Number]
  76. +      var frontDerailleurSize;
  77. +
  78.  
  79.  
  80. +      //! Name of the destination
  81. +      //! @since 1.2.10
  82. +      //! @return [Number]
  83. +      var nameOfDestination;
  84. +
  85. +      //! Name of the next point
  86. +      //! @since 1.2.10
  87. +      //! @return [Number]
  88. +      var nameOfNextPoint;
  89. +
  90. +      //! Distance to the nearest point on course
  91. +      //! @since 1.2.10
  92. +      //! @return [Number]
  93. +      var offCourseDistance;
  94. +
  95. +      //! Index of the Rear Bicycle Derailleur. Value from 1 to rearDerailleurMax.
  96. +      //! @since 1.2.10
  97. +      //! @return [Number]
  98. +      var rearDerailleurIndex;
  99. +
  100. +      //! Max index on the Rear Bicycle Derailleur
  101. +      //! @since 1.2.10
  102. +      //! @return [Number]
  103. +      var rearDerailleurMax;
  104. +
  105. +      //! Gear size on the Rear Bicycle Derailleur
  106. +      //! @since 1.2.10
  107. +      //! @return [Number]
  108. +      var rearDerailleurSize;
  109. +
  110.  
  111. +      //! The recording timer state
  112. +      //! @since 2.1.0
  113. +      //! @return [Number]
  114. +      var timerState;
  115. +
  116.  
  117.  
  118. +      //! track is the direction of travel or track. If you are not moving then heading is
  119. +      //! the direction the unit is pointing based on the compass sensor.
  120. +      //! @since 1.2.10
  121. +      //! @return [Number]
  122. +      var track;
  123. +
  124.  
  125.  
  126.    //! The ActivityMonitor module contains the interface for Activity Monitoring data.
  127.    //! @since 1.0.0
  128. +  //! @permission Steps
  129.    module ActivityMonitor {
  130.  
  131.  
  132. +    //! A class representing the active minutes recorded by the device
  133. +    //! @since 2.1.0
  134. +    class ActiveMinutes {
  135. +      //! The total number of moderate activity minutes recorded by the device
  136. +      //! @since 2.1.0
  137. +      //! @return [Number]
  138. +      var moderate;
  139. +
  140. +      //! The total number of active minutes recorded by the device equal to the total
  141. +      //! number of moderate minutes plus twice the total number of viborous minutes.
  142. +      //! @since 2.1.0
  143. +      //! @return [Number]
  144. +      var total;
  145. +
  146. +      //! The total number of vigorous activity minutes recorded by the device
  147. +      //! @since 2.1.0
  148. +      //! @return [Number]
  149. +      var vigorous;
  150. +
  151. +    }
  152. +
  153.  
  154.  
  155.  
  156.      class History {
  157. +      //! Number of active mintues Contains the moderate, vigorous, and total accumulated
  158. +      //! minutes for the day
  159. +      //! @since 2.1.0
  160. +      //! @return [ActiveMinutes]
  161. +      var activeMinutes;
  162. +
  163.  
  164. +      //! The number of floors climbed
  165. +      //! @since 2.1.0
  166. +      //! @return [Number]
  167. +      var floorsClimbed;
  168. +
  169. +      //! Floor climb goal for the day
  170. +      //! @since 2.1.0
  171. +      //! @return [Number]
  172. +      var floorsClimbedGoal;
  173. +
  174. +      //! The number of floors descended
  175. +      //! @since 2.1.0
  176. +      //! @return [Number]
  177. +      var floorsDescended;
  178. +
  179.  
  180.      class Info {
  181. +      //! Number of active mintues for the current day Contains the moderate, vigorous,
  182. +      //! and total accumulated minutes for the day
  183. +      //! @since 2.1.0
  184. +      //! @return [ActiveMinutes]
  185. +      var activeMinutesDay;
  186. +
  187. +      //! Number of active mintues for the current week Contains the moderate, vigorous,
  188. +      //! and total accumulated minutes for the week
  189. +      //! @since 2.1.0
  190. +      //! @return [ActiveMinutes]
  191. +      var activeMinutesWeek;
  192. +
  193. +      //! Value of active mintues goal for the current week
  194. +      //! @since 2.1.0
  195. +      //! @return [Number]
  196. +      var activeMinutesWeekGoal;
  197. +
  198.  
  199. +      //! The number of floors climbed
  200. +      //! @since 2.1.0
  201. +      //! @return [Number]
  202. +      var floorsClimbed;
  203. +
  204. +      //! The current floor climb goal
  205. +      //! @since 2.1.0
  206. +      //! @return [Number]
  207. +      var floorsClimbedGoal;
  208. +
  209. +      //! The number of floors descended
  210. +      //! @since 2.1.0
  211. +      //! @return [Number]
  212. +      var floorsDescended;
  213. +
  214. +      //! @deprecated Is the user in sleep mode?
  215.        //! Is the user in sleep mode?
  216.        //! @since 1.0.0
  217.        //! @return [Boolean]
  218.        var isSleepMode;
  219.  
  220. +      //! The number of meters climbed
  221. +      //! @since 2.1.0
  222. +      //! @return [Float]
  223. +      var metersClimbed;
  224. +
  225. +      //! The number of meters descended
  226. +      //! @since 2.1.0
  227. +      //! @return [Float]
  228. +      var metersDescended;
  229. +
  230.  
  231.  
  232. +      //! Used to create a new field. Field is updated in the FIT file by changing the the
  233. +      //! value of the data within the Field.
  234. +      //! @since 1.3.0
  235. +      //! @param [String] name The name of the Field as a string. The maximum length may vary between products. At least 64 bytes are availalble.
  236. +      //! @param [Number] fieldId The unique Field Identifier for the Field
  237. +      //! @param [type] type The type definiton for the field from the DATA_TYPE_ enumeration
  238. +      //! @param [Dictionary] options Optional parameters that can be specified for field creation @option [:count] The number of elements to add to the field if it is an array. @option [:mesgType] Optional. The message type that this field should be added to. Defaults to MESG_TYPE_RECORD if not provided. @option [:units] Optional. The display units as a String. This should use the current device language. The maximum length may vary between products. At least 16 bytes are availalble.
  239. +      //! @return [Field] the resulting field object
  240. +      function createField(name, fieldId, type, options) {}
  241. +
  242.        //! After recording is complete, the discard() method will complete the session by
  243.        //! discarding the recorded data.
  244.        //! @since 1.0.0
  245. @@ -595,9 +802,16 @@
  246.      //! Use createSession() to create a session object with options determined by the
  247.      //! caller. Only one session object is allowed to exist at a time. If there is an
  248.      //! existing object that has not been closed using the save() or discard() methods,
  249. -    //! this method will return that object instead of creating a new one.
  250. +    //! this method will return that object instead of creating a new one. On some
  251. +    //! products running the 1.x SDK, creating a session object requires a large memory
  252. +    //! allocation. To free this memory, the session must first be succesfully saved or
  253. +    //! or discarded, and then app references to the session object should be set to
  254. +    //! null.
  255.      //! @since 1.0.0
  256.      //! @param [Dictionary] options A Dictionary containing session creation options
  257. +    //! @option [Object] :sport The primary sport being recorded (SPORT_GENERIC by default)
  258. +    //! @option [Object] :subSport The sport subcategory being recorded (SUB_SPORT_GENERIC by default)
  259. +    //! @option [String] :name Required. This is the name that will be associated with the sport being recorded. The suggested maximum length of the name is 15 characters (some devices support longer names).
  260.      //! @return [Session] A new session object, or the existing session object if a session is active and has not been saved or discarded
  261.      function createSession(options) {}
  262.  
  263. @@ -750,6 +964,12 @@
  264.        //! @since 1.0.0
  265.        //! @param [enum] c Channel type specifier
  266.        //! @param n Network
  267. +      //! @option [Hash] [CHANNEL_TYPE_TX_NOT_RX] a customizable set of options
  268. +      //! @option [Hash] [CHANNEL_TYPE_RX_NOT_TX] a customizable set of options
  269. +      //! @option [Hash] [CHANNEL_TYPE_RX_ONLY] a customizable set of options
  270. +      //! @option [Hash] [NETWORK_PUBLIC] a customizable set of options
  271. +      //! @option [Hash] [NETWORK_PLUS] a customizable set of options
  272. +      //! @option [Hash] [NETWORK_PRIVATE] a customizable set of options
  273.        function initialize(c, n) {}
  274.  
  275.        //! See if background scanning is enabled for the channel assignment.
  276. @@ -850,6 +1070,16 @@
  277.        //! Constructor for the device config object
  278.        //! @since 1.2.0
  279.        //! @param [Dictionary] options initialization options
  280. +      //! @option [Hash] [:deviceNumber] a customizable set of options
  281. +      //! @option [Hash] [:deviceType] a customizable set of options
  282. +      //! @option [Hash] [:transmissionType] a customizable set of options
  283. +      //! @option [Hash] [:messagePeriod] a customizable set of options
  284. +      //! @option [Hash] [:radioFrequency] a customizable set of options
  285. +      //! @option [Hash] [:searchTimeoutLowPriority] a customizable set of options
  286. +      //! @option [Hash] [:searchTimeoutHighPriority] a customizable set of options
  287. +      //! @option [Hash] [:searchThreshold] a customizable set of options
  288. +      //! @option [Hash] [:networkKey64Bit] a customizable set of options
  289. +      //! @option [Hash] [:networkKey128Bit] a customizable set of options
  290.        function initialize(options) {}
  291.  
  292.      }
  293. @@ -962,6 +1192,16 @@
  294.    //! The Application module contains the base class for every Connect IQ app.
  295.    //! @since 1.0.0
  296.    module Application {
  297. +    //! The GOAL_TYPE enum defines the different goal types that can be triggered.
  298. +    //! @since 1.3.0
  299. +    const GOAL_TYPE_STEPS = 0;
  300. +
  301. +    //! @since 1.3.0
  302. +    const GOAL_TYPE_FLOORS_CLIMBED = 1;
  303. +
  304. +    //! @since 1.3.0
  305. +    const GOAL_TYPE_ACTIVE_MINUTES = 2;
  306. +
  307.      //! AppBase is the base class for an app. All apps shall inherit from this class. It
  308.      //! is used to manage the lifecycle of an app. For widgets and watch-apps, the
  309.      //! functions are called in the following order: onStart(), getInitialView() and
  310. @@ -978,6 +1218,18 @@
  311.        //! @param key The key to delete
  312.        function deleteProperty(key) {}
  313.  
  314. +      //! Retrives the WatchUi.View for a goal that has triggered within a watchface. If a
  315. +      //! goal is reached when a watchface is running, this function will be triggered.
  316. +      //! The type of goal that was met will be provided, and the AppBase should return a
  317. +      //! View that displays a goal reached message and/or animations for that goal. If a
  318. +      //! View is returned from this function, the main watchface view will be shutdown,
  319. +      //! and then new View will pushed. If this method is not overridden in the AppBase,
  320. +      //! or if it returns null, the native goal screens will be shown.
  321. +      //! @since 1.3.0
  322. +      //! @param [Number] goalType The goal type that has triggered from. From the GOAL_TYPE_??? enumeration.
  323. +      //! @return [Array] An array containing [ WatchUi.View ]
  324. +      function getGoalView(goalType) {}
  325. +
  326.        //! To retrieve the initial WatchUi.View and WatchUi.InputDelegate of the
  327.        //! application, call getInitialView(). Providing a WatchUi.InputDelegate is
  328.        //! optional for widgets and watch-apps. For watchfaces and datafields, an array
  329. @@ -1061,6 +1313,7 @@
  330.    //! The Tone module allows for making pre-defined sounds. Not all devices support
  331.    //! this API.
  332.    //! @since 1.0.0
  333. +  //! @apptype Data Field
  334.    //! @apptype Widget
  335.    //! @apptype App
  336.    module Attention {
  337.  
  338. +    //! How the oauth token will be returned in the final step.
  339. +    //! @since 1.3.0
  340. +    const OAUTH_RESULT_TYPE_URL = 0;
  341. +
  342. +    //! How the oauth request will be signed
  343. +    //! @since 1.0.0
  344. +    const OAUTH_SIGNING_METHOD_HMAC_SHA1 = 0;
  345. +
  346.  
  347.  
  348. +    //! The expected response from making a web request
  349. +    //! @since 1.3.0
  350. +    const HTTP_RESPONSE_CONTENT_TYPE_JSON = 0;
  351. +
  352. +    //! @since 1.3.0
  353. +    const HTTP_RESPONSE_CONTENT_TYPE_URL_ENCODED = 1;
  354. +
  355.  
  356. +    //! Message types that can be registered to receive.
  357. +    //!
  358. +    //! data is of type OAuthMessage
  359. +    //! @since 1.3.0
  360. +    const MESSAGE_ID_OAUTH = 0;
  361. +
  362. +    //! data is of type Message
  363. +    //! @since 1.3.0
  364. +    const MESSAGE_ID_PHONE_APP = 1;
  365. +
  366.  
  367. +    //! Base class for messages.
  368. +    //! @since 1.3.0
  369. +    class Message {
  370. +      //! The message data. The type depends on the message being delivered.
  371. +      //! @since 1.3.0
  372. +      var data;
  373. +
  374. +    }
  375. +
  376. +    //! An OAuthMessage received by the callback registered in registerForMessage().
  377. +    //! @since 1.3.0
  378. +    class OAuthMessage extends Message {
  379. +      //! HTTP response code (positive value) or a BLE error code (negative value)
  380. +      //! @since 1.3.0
  381. +      var responseCode;
  382. +
  383. +    }
  384. +
  385.  
  386.  
  387. +    //! Generate the value for the “Authorization” header in an OAuth 1.0a request. The
  388. +    //! returned value can be set as the “Authorization” header for makeWebRequest().
  389. +    //! @since 1.3.0
  390. +    //! @param [String] url The request URL
  391. +    //! @param [Dictionary] params The parameters of the request
  392. +    //! @param [Number] requestMethod An HTTP_REQUEST_METHOD_* value
  393. +    //! @param [Number] signatureMethod An OAUTH_SIGNING_METHOD_* value
  394. +    //! @param [String] token The token given by the OAuth service. Can be null.
  395. +    //! @param [String] tokenSecret The token secret given by the OAuth service. Used to sign the request.
  396. +    //! @param [String] consumerKey The key that identifies your application
  397. +    //! @param [String] consumerSecret The consumer secret that is used to sign the request.
  398. +    //! @return [String] The value for the “Authorization” header.
  399. +    function generateSignedOAuthHeader(url, params, requestMethod, signatureMethod, token, tokenSecret, consumerKey, consumerSecret) {}
  400. +
  401.  
  402.      //! @param [Dictionary] parameters Dictionary of keys and values, appended to the URL. Can be null.
  403.      //! @param [Dictionary] options Additional image options
  404.      //! @param [Method] responseCallback This is a callback in the format function responseCallback(responseCode, data); responseCode has the server response code, and data contains a WatchUi.BitmapResource if it was successful.
  405. +    //! @option [Array] :palette The color palette to restrict the image dithering to. Using a smaller palette can reduce the size of the image data to speed up transfers.
  406. +    //! @option [Number] :maxWidth The maximum width an image should be scaled to
  407. +    //! @option [Number] :maxHeight The maximum height an image should be scaled to
  408. +    //! @option [Number] :dithering The type of dithering to use when processing the image. Defaults to Floyd-Steinberg.
  409.      function makeImageRequest(url, parameters, options, responseCallback) {}
  410.  
  411. -    //! To use Garmin Connect Mobile as a proxy to the web, use makeJsonRequest(). The
  412. -    //! request is asynchronous; the responseCallback will be called when the request
  413. -    //! returns.
  414. +    //! @deprecated makeJsonRequest() class will be dropped in Connect IQ 3.1. Please use makeWebRequest().
  415. +    //! makeJsonRequest() class will be dropped in Connect IQ 3.1. Please use
  416. +    //! makeWebRequest().
  417. +    //!
  418. +    //! To use Garmin Connect Mobile as a proxy to the web, use
  419. +    //! makeJsonRequest(). The request is asynchronous; the responseCallback will be
  420. +    //! called when the request returns.
  421.      //! @since 1.0.0
  422.      //! @param [String] url The URL being requested
  423. -    //! @param [Dictionary] parameters Dictionary of keys and values, appended to the URL as a GET request or set as the body for a POST request. Can be null.
  424. +    //! @param [Dictionary] parameters Dictionary of keys and values, appended to the URL as a GET/DELETE request or set as the body for a POST/PUT request. These values must be URL encoded. Can be null.
  425.      //! @param [Dictionary] options Dictionary of options. Can be null.
  426.      //! @param [Method] responseCallback This is a callback in the format function responseCallback(responseCode, data); responseCode has the server response code, and data contains a Dictionary of content if the request was successful.
  427. +    //! @option [Number] :method The HTTP method of the request. Should be a HTTP_REQUEST_METHOD_* value.
  428. +    //! @option [Dictionary] :headers A Dictionary of HTTP headers to include in the request. The “Content-Type” header for the body of the request can be specified using a REQUEST_CONTENT_TYPE_* value. This is only valid for methods PUT and POST (you cannot set a body for a GET or DELETE request). If the content type is not specified, it will default to “application/x-www-form-urlencoded”.
  429.      function makeJsonRequest(url, parameters, options, responseCallback) {}
  430.  
  431. +    //! Request an OAuth sign-in on Garmin Connect Mobile. A notification will trigger
  432. +    //! on the phone, that when clicked, provides a webview that shows initialUrl. If
  433. +    //! the user grants permission to the app the function given to
  434. +    //! registerForOAuthMessages() will be called with a Dictionary of keys from the
  435. +    //! OAuth process.
  436. +    //! @since 1.3.0
  437. +    //! @param [String] requestUrl The URL to load in the web view to begin authentication.
  438. +    //! @param [Dictionary] requestParams A dictionary of non-URL encoded parameters for the initial url.
  439. +    //! @param [String] resultUrl The URL of the final page of authentication that contains the resultKeys.
  440. +    //! @param [Number] resultType What format the result will be in. Should be a OAUTH_RESULT_TYPE_XXX value.
  441. +    //! @param [Dictionary] resultKeys A dictionary of the keys Garmin Connect Mobile will need to pull out of the OAuth response and given to the registered callback in registerForOAuthMessages().
  442. +    function makeOAuthRequest(requestUrl, requestParams, resultUrl, resultType, resultKeys) {}
  443. +
  444. +    //! To use Garmin Connect Mobile as a proxy to the web, use makeWebRequest(). The
  445. +    //! request is asynchronous; the responseCallback will be called when the request
  446. +    //! returns.
  447. +    //! @since 1.3.0
  448. +    //! @param [String] url The URL being requested
  449. +    //! @param [Dictionary] parameters Dictionary of keys and values. These values should not be URL encoded. Can be null.
  450. +    //! @param [Dictionary] options Dictionary of options. Can be null.
  451. +    //! @param [Method] responseCallback This is a callback in the format function responseCallback(responseCode, data); responseCode has the server response code or a BLE_* error type, and data contains a Dictionary of content if the request was successful.
  452. +    //! @option [Number] :method The HTTP method of the request. Should be a HTTP_REQUEST_METHOD_* value.
  453. +    //! @option [Dictionary] :headers A Dictionary of HTTP headers to include in the request. The “Content-Type” header for the body of the request can be specified using a REQUEST_CONTENT_TYPE_* value. If the content type is not specified, it will default to “application/json” for POST and PUT requests. By default, GET and DELETE requests will have their parameters appended to the URL. Setting the method as GET or DELETE as well as a “Content-Type” header will result in the parameters being set in the body of the request and they will not be appended to the URL.
  454. +    //! @option [Number] :responseType The format of the response. Should be a HTTP_RESPONSE_CONTENT_TYPE_* value. If not given, the system will attempt to first parse the response as JSON, then as URL ENCODED.
  455. +    function makeWebRequest(url, parameters, options, responseCallback) {}
  456. +
  457. +    //! Request that GCM issue a phone notification that will open a web page.
  458. +    //! @since 1.3.0
  459. +    //! @param [String] url The URL to open.
  460. +    //! @param [Dictionary] params The request parameters. Parameters should not be URL encoded.
  461. +    //! @param [Dictionary] options Additional options for the request. (TBD)
  462. +    function openWebPage(url, params, options) {}
  463. +
  464. +    //! Register a callback for receiving OAuth messages. The callback will be called
  465. +    //! once for each received OAuth message. If there are messages waiting for the app
  466. +    //! when this function is called, the callback will immediately be called once for
  467. +    //! each waiting message.
  468. +    //! @since 1.3.0
  469. +    //! @param [Method] method The callback with the signature callback(data). data will be of type OAuthMessage
  470. +    function registerForOAuthMessages(method) {}
  471. +
  472.  
  473.  
  474. +  //! The FIT Contributor module will allow Apps and Data Fields to push data into FIT
  475. +  //! files that are being recorded
  476. +  //! @since 1.3.0
  477. +  //! @permission FitContributor
  478. +  //! @apptype Data Field
  479. +  //! @apptype App
  480. +  module FitContributor {
  481. +    //! MESG_TYPE enum maps to the FIT Mesg types that are written to the activity
  482. +    //! file.
  483. +    //!
  484. +    //! Mesg Type for Session Messages Written once per session at the end of
  485. +    //! recording Used for data that pertains to the entire session (eg. Avg Speed)
  486. +    //! @since 1.3.0
  487. +    const MESG_TYPE_SESSION = 18;
  488. +
  489. +    //! Mesg Type for Lap Messages Written once for every lap in the session Used for
  490. +    //! data that pertains to each lap (eg. Avg Lap Speed)
  491. +    //! @since 1.3.0
  492. +    const MESG_TYPE_LAP = 19;
  493. +
  494. +    //! Mesg Type for Record Messages Depending on device recording type written once a
  495. +    //! second or when new data is available (Smart Recording). Never written faster
  496. +    //! than once a second. Used for instantaneous values (eg. Current Speed)
  497. +    //! @since 1.3.0
  498. +    const MESG_TYPE_RECORD = 20;
  499. +
  500. +    //! @since 1.3.0
  501. +    const DATA_TYPE_SINT8 = 1;
  502. +
  503. +    //! @since 1.3.0
  504. +    const DATA_TYPE_UINT8 = 2;
  505. +
  506. +    //! @since 1.3.0
  507. +    const DATA_TYPE_SINT16 = 3;
  508. +
  509. +    //! @since 1.3.0
  510. +    const DATA_TYPE_UINT16 = 4;
  511. +
  512. +    //! @since 1.3.0
  513. +    const DATA_TYPE_SINT32 = 5;
  514. +
  515. +    //! @since 1.3.0
  516. +    const DATA_TYPE_UINT32 = 6;
  517. +
  518. +    //! @since 1.3.0
  519. +    const DATA_TYPE_STRING = 7;
  520. +
  521. +    //! @since 1.3.0
  522. +    const DATA_TYPE_FLOAT = 8;
  523. +
  524. +    //! @since 1.3.0
  525. +    const DATA_TYPE_DOUBLE = 9;
  526. +
  527. +    //! @since 1.3.0
  528. +    class Field {
  529. +      //! Set data sets the data to be written out for this field. This function must be
  530. +      //! called every time an update is to be recorded into the activity recording. If
  531. +      //! this method is called before the a message is dropped into the activity, the
  532. +      //! previous value specified will be lost. Do not for time sensitive data with sub
  533. +      //! second granularity.
  534. +      //! @since 1.3.0
  535. +      function setData() {}
  536. +
  537. +    }
  538. +
  539. +  }
  540. +
  541.    //! The Graphics module provides basic drawing functionality.
  542.    //! @since 1.0.0
  543.    module Graphics {
  544. -    //! Extra tiny font
  545. +    //! Extra tiny Connect IQ font
  546.      //! @since 1.0.0
  547.      const FONT_XTINY = 0;
  548.  
  549. -    //! Tiny font
  550. +    //! Tiny Connect IQ font
  551.      //! @since 1.0.0
  552.      const FONT_TINY = 1;
  553.  
  554. -    //! Small font
  555. +    //! Small Connect IQ font
  556.      //! @since 1.0.0
  557.      const FONT_SMALL = 2;
  558.  
  559. -    //! Medium font
  560. +    //! Medium Connect IQ font
  561.      //! @since 1.0.0
  562.      const FONT_MEDIUM = 3;
  563.  
  564. -    //! Large font
  565. +    //! Large Connect IQ font
  566.      //! @since 1.0.0
  567.      const FONT_LARGE = 4;
  568.  
  569. -    //! Normal size number only font
  570. +    //! Normal size number only Connect IQ font
  571.      //! @since 1.0.0
  572.      const FONT_NUMBER_MILD = 5;
  573.  
  574. -    //! Medium size number only font
  575. +    //! Medium size number only Connect IQ font
  576.      //! @since 1.0.0
  577.      const FONT_NUMBER_MEDIUM = 6;
  578.  
  579. -    //! Large size number only font
  580. +    //! Large size number only Connect IQ font
  581.      //! @since 1.0.0
  582.      const FONT_NUMBER_HOT = 7;
  583.  
  584. -    //! Huge size number only font
  585. +    //! Huge size number only Connect IQ font
  586.      //! @since 1.0.0
  587.      const FONT_NUMBER_THAI_HOT = 8;
  588.  
  589. +    //! Extra tiny system font
  590. +    //! @since 1.3.0
  591. +    const FONT_SYSTEM_XTINY = 9;
  592. +
  593. +    //! Tiny system font
  594. +    //! @since 1.3.0
  595. +    const FONT_SYSTEM_TINY = 10;
  596. +
  597. +    //! Small system font
  598. +    //! @since 1.3.0
  599. +    const FONT_SYSTEM_SMALL = 11;
  600. +
  601. +    //! Medium system font
  602. +    //! @since 1.3.0
  603. +    const FONT_SYSTEM_MEDIUM = 12;
  604. +
  605. +    //! Large system font
  606. +    //! @since 1.3.0
  607. +    const FONT_SYSTEM_LARGE = 13;
  608. +
  609. +    //! Normal size number only system font
  610. +    //! @since 1.3.0
  611. +    const FONT_SYSTEM_NUMBER_MILD = 14;
  612. +
  613. +    //! Medium size number only system font
  614. +    //! @since 1.3.0
  615. +    const FONT_SYSTEM_NUMBER_MEDIUM = 15;
  616. +
  617. +    //! Large size number only system font
  618. +    //! @since 1.3.0
  619. +    const FONT_SYSTEM_NUMBER_HOT = 16;
  620. +
  621. +    //! Huge size number only system font
  622. +    //! @since 1.3.0
  623. +    const FONT_SYSTEM_NUMBER_THAI_HOT = 17;
  624. +
  625.  
  626.      class Array {
  627. +      //! Use add() to add an object to the end of an array. The array size is increased
  628. +      //! by one and the parameter passed to add is inserted at the new index.
  629. +      //! @since 1.3.0
  630. +      //! @param [Object] object The object to be added to the end of the array
  631. +      //! @return [Array] self
  632. +      function add(object) {}
  633. +
  634. +      //! Use addAll() to add an array of objects to the end of an array. The array is
  635. +      //! expanded by the size of the provided array, and all of the elements are added to
  636. +      //! the end of the array
  637. +      //! @since 1.3.0
  638. +      //! @param [Array] array The array of objects to be added to the end of the array
  639. +      //! @return [Array] self
  640. +      function addAll(array) {}
  641. +
  642. +      //! Use indexOf to get the index of an object within the array.
  643. +      //! @since 1.3.0
  644. +      //! @param [Object] object The object to find the index of in the array
  645. +      //! @return [Number] the index of the provided object in the array. If the object is not found -1 is returned.
  646. +      function indexOf(object) {}
  647. +
  648. +      //! Use remove() to remove an object from an array. If the passed object is found,
  649. +      //! the array size is decreased by one and elements beyond it are shifted to the
  650. +      //! next lower index. If the array has multiple matches, the match at the lowest
  651. +      //! index will be removed
  652. +      //! @since 1.3.0
  653. +      //! @param [Object] object The object to be removed from the array
  654. +      //! @return [Boolean] false if no instances of the object are found, otherwise true
  655. +      function remove(object) {}
  656. +
  657. +      //! Use removeAll() to add an object from an array. For each instance of the passed
  658. +      //! object that is found, the array size is decreased by one and elements beyond it
  659. +      //! are shifted to the next lower index. If the array has multiple matches, the
  660. +      //! match at the lowest index will be removed
  661. +      //! @since 1.3.0
  662. +      //! @param [Object] object The object to remove all instances of from the array
  663. +      //! @return [Boolean] false if no instances of the object are found, otherwise true
  664. +      function removeAll(object) {}
  665. +
  666. +      //! reverse() will return a new array that contains the elements of the source array
  667. +      //! in reverse order.
  668. +      //! @since 1.3.0
  669. +      //! @return [Array] A new array with elements in reversed order
  670. +      function reverse() {}
  671. +
  672.  
  673. +      //! slice() returns a new array with a copy of the specifed elements
  674. +      //! @since 1.3.0
  675. +      //! @param [Number] startIndex A zero-based index to the start of the new array. If a negative index is provided, it will offset from the end of the array. (-2 will start at the second to last element.) If startIndex is null, the slice will begin at 0. An out of bounds index will be truncated to the array limits.
  676. +      //! @param [Number] endIndex A zero-based index to the end of the new array. Items are included up to, but not including endIndex. If a negative index is provided, it will offset from the end of the array. (-1 will end at the last element.) If endIndex is null, the the slice will end at the last element. An out of bounds index will be truncated to the array limits.
  677. +      //! @return [Array] A new array containing the elements from startIndex to endIndex
  678. +      function slice(startIndex, endIndex) {}
  679. +
  680.  
  681. +    //! Chars are unicode characters.
  682. +    //! @since 1.3.0
  683. +    class Char {
  684. +      //! Convert the Char to lowercase with toLower().
  685. +      //! @since 1.3.0
  686. +      //! @return [Char] A new lowercase Char
  687. +      function toLower() {}
  688. +
  689. +      //! Convert the Char to a Number with toNumber().
  690. +      //! @since 1.3.0
  691. +      //! @return [Number] The sequence of bits of a Char interpreted as a Number
  692. +      function toNumber() {}
  693. +
  694. +      //! Use toString to convert an Char to a String.
  695. +      //! @since 1.3.0
  696. +      //! @return [String] The String representation of the Char
  697. +      function toString() {}
  698. +
  699. +      //! Convert the Char to uppercase with toUpper().
  700. +      //! @since 1.3.0
  701. +      //! @return [Char] A new uppercase Char
  702. +      function toUpper() {}
  703. +
  704. +    }
  705. +
  706.  
  707. +      //! Test if this instance is equal to another instance of an Object with equals().
  708. +      //! @since 1.3.0
  709. +      //! @param that That item to test against
  710. +      //! @return [Boolean] true if the objects are equal, false otherwise
  711. +      function equals(that) {}
  712. +
  713.  
  714. +      //! Test if this instance is equal to another instance of an Object with equals().
  715. +      //! @since 1.3.0
  716. +      //! @param that That item to test against
  717. +      //! @return [Boolean] true if the objects are equal, false otherwise
  718. +      function equals(that) {}
  719. +
  720.  
  721.        //! Invoke the method with invoke().
  722.        //! @since 1.0.0
  723. +      //! @param args parameters
  724.        //! @return [Object] The return value from callback
  725. -      function invoke() {}
  726. +      function invoke(args) {}
  727.  
  728.      }
  729.  
  730.  
  731. +      //! Convert the Number to a Char with toChar().
  732. +      //! @since 1.3.0
  733. +      //! @return [Char] A Char object
  734. +      function toChar() {}
  735. +
  736.  
  737. +      //! Convert the String to an Array of Chars.
  738. +      //! @since 1.3.0
  739. +      //! @return [Array] A Char Array representation of the String, where each character in the String is an element in the Array
  740. +      function toCharArray() {}
  741. +
  742.  
  743. -      //! If a string is in numeric form, either “123” or “0x12AB”, convert it to a Number
  744. -      //! object with toNumber().
  745. +      //! If a string is in a base 10 numeric form, e.g., “123” or “08”, convert it to a
  746. +      //! Number object with toNumber().
  747.        //! @since 1.0.0
  748.        //! @return [Number] A Number object, or error
  749.        function toNumber() {}
  750.  
  751. +      //! Convert a string to a number using the specified base.
  752. +      //! @since 2.1.0
  753. +      //! @param base The base of the input string. If the value of base is zero, the syntax expected is similar to that of integer constants, which includes: An optional sign character (+ or -), An optional, prefix for octal or hexadecimal (“0” or “0x”), and a sequence of digits in the prefixed base, or decimal if none was specified. If the base value is between 2 and 36, the format expected for the number is valid digits and/or letters that represent integers of the specified radix (from '0' to 'z'/'Z' for radix 36). The sequence may be optionally prefixed with “0x” if base is 16.
  754. +      //! @return [Number] A Number object
  755. +      function toNumberWithBase(base) {}
  756. +
  757.  
  758. +      //! Convert the String to an Array of bytes.
  759. +      //! @since 1.3.0
  760. +      //! @return [Array] An Array representation of the String, where each byte in the string is an element in the Array
  761. +      function toUtf8Array() {}
  762. +
  763.  
  764.  
  765. +    //! Use atan2() to get the arc tangent of y/x in radians.
  766. +    //! @since 1.3.0
  767. +    //! @param [Float] y The proportion of the y coordinate
  768. +    //! @param [Float] x The proportion of the x coordinate
  769. +    //! @return [Float] The principal arc tangent of y/x, in the interval [-PI..PI] radians., or NaN if invalid
  770. +    function atan2(y, x) {}
  771. +
  772. +    //! Use ceil() to compute the ceiling of a value.
  773. +    //! @since 1.3.0
  774. +    //! @param [Float] x A floating point value
  775. +    //! @return [Float] The smallest integer greater than or equal to x
  776. +    function ceil(x) {}
  777. +
  778.  
  779. +    //! Use floor() to compute the floor of a value.
  780. +    //! @since 1.3.0
  781. +    //! @param [Float] x A floating point value
  782. +    //! @return [Float] The largest integer less or equal than x
  783. +    function floor(x) {}
  784. +
  785.  
  786. +    //! Use round() to round a value.
  787. +    //! @since 1.3.0
  788. +    //! @param [Float] x A floating point value
  789. +    //! @return [Float] The closest integer to x, with ties rounding up.
  790. +    function round(x) {}
  791. +
  792.  
  793. +    //! Use toDegrees() to convert an angle from radians to degrees.
  794. +    //! @since 1.3.0
  795. +    //! @param [Float] x The angle in radians
  796. +    //! @return [Float] The angle of x in degrees
  797. +    function toDegrees(x) {}
  798. +
  799. +    //! Use toRadians() to convert an angle from degrees to radians.
  800. +    //! @since 1.3.0
  801. +    //! @param [Float] x The angle in degrees
  802. +    //! @return [Float] The angle of x in radians
  803. +    function toRadians(x) {}
  804. +
  805.    }
  806.  
  807.    //! Persisted locations allows the saving of a location (waypoint) to a device's
  808. @@ -2280,6 +2892,7 @@
  809.      //! @since 1.0.2
  810.      //! @param [Location] location Location object to persist
  811.      //! @param [Dictionary] options Dictionary of options, or null to accept defaults
  812. +    //! @option [Hash] :name a customizable set of options
  813.      function persistLocation(location, options) {}
  814.  
  815.    }
  816. @@ -2399,6 +3012,9 @@
  817.        //! Constructor: create a coordinate based off an options hash table
  818.        //! @since 1.0.0
  819.        //! @param [Dictionary] options Hash table of options
  820. +      //! @option [Number] :latitude The latitude
  821. +      //! @option [Number] :longitude The longitude
  822. +      //! @option [Symbol] :format The format of lat/long (possible values are :degrees, :radians, or :semicircles)
  823.        function initialize(options) {}
  824.  
  825.        //! Use toDegrees() to retrieve the coordinate back as an Array of degree values.
  826. @@ -2548,6 +3164,132 @@
  827.  
  828.    }
  829.  
  830. +  //! The SensorHistory module contains the interface for SensorHistory
  831. +  //! @since 2.1.0
  832. +  module SensorHistory {
  833. +    //! The ORDER enum is used to select the data order of the iterator
  834. +    //!
  835. +    //! Request
  836. +    //! iterator with newest data first
  837. +    //! @since 2.1.0
  838. +    const ORDER_NEWEST_FIRST = 0;
  839. +
  840. +    //! Request iterator with oldest data first
  841. +    //! @since 2.1.0
  842. +    const ORDER_OLDEST_FIRST = 1;
  843. +
  844. +    //! A class containing sensor data for a given period of time.
  845. +    //! @since 2.1.0
  846. +    class SensorHistoryIterator {
  847. +      //! Get the maximium sensor sample contained in this iterator.
  848. +      //! @since 2.1.0
  849. +      //! @return [Number] the maximum sample
  850. +      function getMax() {}
  851. +
  852. +      //! Get the minimium sample contained in this iterator.
  853. +      //! @since 2.1.0
  854. +      //! @return [Number] the minimum sample
  855. +      function getMin() {}
  856. +
  857. +      //! Get the time of the newest sample in this iterator.
  858. +      //! @since 2.1.0
  859. +      //! @return [Moment] the time of the newest sample
  860. +      function getNewestSampleTime() {}
  861. +
  862. +      //! Get the time of the oldest sample in this iterator.
  863. +      //! @since 2.1.0
  864. +      //! @return [Moment] the time of the oldest sample
  865. +      function getOldestSampleTime() {}
  866. +
  867. +      //! Get the next entry in the iterator. This must be called to get the initial data
  868. +      //! from the iterator.
  869. +      //! @since 2.1.0
  870. +      //! @return [SensorHistorySample] returns the next SensorHistorySample, or null if there are no more samples
  871. +      function next() {}
  872. +
  873. +    }
  874. +
  875. +    //! A class containing sensor data at a given time.
  876. +    //! @since 2.1.0
  877. +    class SensorSample {
  878. +      //! Sensor sample. Make sure to check for invalid samples, which will be null.
  879. +      //! @since 2.1.0
  880. +      //! @return [Number]
  881. +      var data;
  882. +
  883. +      //! @since 2.1.0
  884. +      //! @return [Moment]
  885. +      var when;
  886. +
  887. +    }
  888. +
  889. +    //! Retrieve the elevation history for the given period, up to the last power cycle.
  890. +    //! This function always returns the most recent elevation samples. The time between
  891. +    //! each SensorHistorySample in the iterator may be device dependent.
  892. +    //! @since 2.1.0
  893. +    //! @param [Dictionary] options Dictionary of options. Can be null.
  894. +    //! @option [Number] /[Duration] :period If period is not provided, the entire available history is retrieved. If period is a Duration, then the history for the given Duration is retrieved. If period is a Number, then the last Number entries are retrieved.
  895. +    //! @option [Boolean] :order If order is not provided, the samples will be newest first. Use the ORDER enumeration to explicitly select “newest first” or “oldest first”
  896. +    //! @return [SensorHistory.SensorHistoryIterator] an iterator for the elevation history for the given period
  897. +    function getElevationHistory(options) {}
  898. +
  899. +    //! Retrieve the heart rate history for the given period, up to the last power
  900. +    //! cycle. This function always returns the most recent heart rate samples. The time
  901. +    //! between each SensorHistorySample in the iterator may be device dependent.
  902. +    //! @since 2.1.0
  903. +    //! @device fr235
  904. +    //! @device fenix 3 HR
  905. +    //! @param [Dictionary] options Dictionary of options. Can be null.
  906. +    //! @option [Number] /[Duration] :period If period is not provided, the entire available history is retrieved. If period is a Duration, then the history for the given Duration is retrieved. If period is a Number, then the last Number entries are retrieved.
  907. +    //! @option [Boolean] :order If order is not provided, the samples will be newest first. Use the ORDER enumeration to explicitly select “newest first” or “oldest first”
  908. +    //! @return [SensorHistory.SensorHistoryIterator] an iterator for the heart rate history for the given period
  909. +    function getHeartRateHistory(options) {}
  910. +
  911. +    //! Retrieve the pressure history for the given period, up to the last power cycle.
  912. +    //! This function always returns the most recent pressure samples. The time between
  913. +    //! each SensorHistorySample in the iterator may be device dependent.
  914. +    //! @since 2.1.0
  915. +    //! @param [Dictionary] options Dictionary of options. Can be null.
  916. +    //! @option [Number] /[Duration] :period If period is not provided, the entire available history is retrieved. If period is a Duration, then the history for the given Duration is retrieved. If period is a Number, then the last Number entries are retrieved.
  917. +    //! @option [Boolean] :order If order is not provided, the samples will be newest first. Use the ORDER enumeration to explicitly select “newest first” or “oldest first”
  918. +    //! @return [SensorHistory.SensorHistoryIterator] an iterator for the pressure history for the given period
  919. +    function getPressureHistory(options) {}
  920. +
  921. +    //! Retrieve the temperature history for the given period, up to the last power
  922. +    //! cycle. This function always returns the most recent temperature samples. The
  923. +    //! time between each SensorHistorySample in the iterator may be device dependent.
  924. +    //! @since 2.1.0
  925. +    //! @param [Dictionary] options Dictionary of options. Can be null.
  926. +    //! @option [Number] /[Duration] :period If period is not provided, the entire available history is retrieved. If period is a Duration, then the history for the given Duration is retrieved. If period is a Number, then the last Number entries are retrieved.
  927. +    //! @option [Boolean] :order If order is not provided, the samples will be newest first. Use the ORDER enumeration to explicitly select “newest first” or “oldest first”
  928. +    //! @return [SensorHistory.SensorHistoryIterator] an iterator for the temperature history for the given period
  929. +    function getTemperatureHistory(options) {}
  930. +
  931. +  }
  932. +
  933. +  //! The StringUtil module contains String utility functions
  934. +  //! @since 1.3.0
  935. +  module StringUtil {
  936. +    //! Given an Array of Chars, return the String equivalent
  937. +    //! @since 1.3.0
  938. +    //! @param [Array] charArray Array of Chars
  939. +    //! @return [String] String representation of the input Array
  940. +    function charArrayToString(charArray) {}
  941. +
  942. +    //! Encodes a string in base 64
  943. +    //! @since 1.3.0
  944. +    //! @param [String] string The string to encode
  945. +    //! @return [String] A base 64 encoded String
  946. +    function encodeBase64(string) {}
  947. +
  948. +    //! Given an Array of UTF-8 bytes, return the String equivalent
  949. +    //! @since 1.3.0
  950. +    //! @param [Array] utf8Array Array of UTF-8 bytes
  951. +    //! @return [String] String representation of the input Array
  952. +    function utf8ArrayToString(utf8Array) {}
  953. +
  954. +  }
  955. +
  956.    //! The System module provides basic system calls.
  957.    //! @since 1.0.0
  958.    module System {
  959. @@ -2631,6 +3373,11 @@
  960.        //! @return [Number]
  961.        var distanceUnits;
  962.  
  963. +      //! True if “Do Not Disturb” mode is enabled on the device
  964. +      //! @since 2.1.0
  965. +      //! @return [Boolean]
  966. +      var doNotDisturb;
  967. +
  968.        //! UNIT_METRIC if elevation is shown in meters, UNIT_STATUTE if it is shown in feet
  969.        //! @since 1.0.0
  970.        //! @return [Number]
  971. @@ -2798,18 +3545,62 @@
  972.    }
  973.  
  974.    module Test {
  975. -    class Test {
  976. -      //! Returns the value of attribute mPassed
  977. -      var mPassed;
  978. +    module toplevel {
  979. +      //! Returns a new instance of AssertException
  980. +      function initialize() {}
  981.  
  982. -      function getNumberOfTests() {}
  983. +    }
  984.  
  985. -      function passed() {}
  986. +    //! The Logger class provides output capabilities to tests
  987. +    class Logger {
  988. +      //! Write a debug string to the output stream. The String is prefixed with [DEBUG]
  989. +      //! and time stamp
  990. +      //! @param [String] str Output string
  991. +      function debug(str) {}
  992.  
  993. -      function runTest() {}
  994. +      //! Write an error string to the output stream. The String is prefixed with [ERROR]
  995. +      //! and time stam;
  996. +      //! @param [String] str Error string
  997. +      function error(str) {}
  998.  
  999. +      //! Write a warning string to the output stream. The String is prefixed with
  1000. +      //! [WARNING] and time stamp
  1001. +      //! @param [String] str Output string
  1002. +      function warning(str) {}
  1003. +
  1004.      }
  1005.  
  1006. +    //! Assert throws an exception if the test is false
  1007. +    //! @param [Boolean] test Expression to test for true.
  1008. +    function assert(test) {}
  1009. +
  1010. +    //! Throws an exception if value1 and value2 are not equal
  1011. +    //! @option [Object] Value to test for equality
  1012. +    //! @option [Object] Value to test for equality
  1013. +    function assertEqual() {}
  1014. +
  1015. +    //! Throws an exception if value1 and value2 are not equal
  1016. +    //! @option [Object] Value to test for equality
  1017. +    //! @option [Object] Value to test for equality
  1018. +    //! @option [String] the identifying message for the assert.
  1019. +    function assertEqualMessage() {}
  1020. +
  1021. +    //! Assert throws an exception if the test is false
  1022. +    //! @param [Boolean] test Expression to test for true.
  1023. +    //! @option [String] the identifying message for the assert.
  1024. +    function assertMessage(test) {}
  1025. +
  1026. +    //! Throws an exception if value1 and value2 are equal
  1027. +    //! @option [Object] Value to test for equality
  1028. +    //! @option [Object] Value to test for equality
  1029. +    function assertNotEqual() {}
  1030. +
  1031. +    //! Throws an exception if value1 and value2 are equal
  1032. +    //! @option [Object] Value to test for equality
  1033. +    //! @option [Object] Value to test for equality
  1034. +    //! @option [String] the identifying message for the assert.
  1035. +    function assertNotEqualMessage() {}
  1036. +
  1037.    }
  1038.  
  1039.    //! The Time module provides functionality for dealing with times and dates.
  1040. @@ -2896,14 +3687,19 @@
  1041.        //! Create a Duration object from a hash of options using duration().
  1042.        //! @since 1.0.0
  1043.        //! @param [Dictionary] options Hash table of options
  1044. +      //! @option [Number] :years The number of years
  1045. +      //! @option [Number] :days The number of days
  1046. +      //! @option [Number] :hours The number of hours
  1047. +      //! @option [Number] :minutes The number of minutes
  1048. +      //! @option [Number] :seconds The number of seconds
  1049.        //! @return [Duration] The Duration object created using the options
  1050.        function duration(options) {}
  1051.  
  1052. -      //! Use info() to retrieve a Gregorian.Info for a date.
  1053. +      //! Use info() to retrieve a Gregorian.Info for a date converted to local time.
  1054.        //! @since 1.0.0
  1055.        //! @param [Moment] date Moment object to get Info from
  1056.        //! @param [Number] format Time FORMAT_XXX constant to use
  1057. -      //! @return [Info] For FORMAT_SHORT, all values in Info are integers. For FORMAT_MEDIUM and FORMAT_LONG, the month/day fields have the strings for the date in question.
  1058. +      //! @return [Info] For FORMAT_SHORT, all values in Info are integers. For FORMAT_MEDIUM and FORMAT_LONG, the month/day fields have the strings for the date in question. The time returned has been converted to local time.
  1059.        function info(date, format) {}
  1060.  
  1061.        //! Create a Moment object from a hash table of options with moment(). The Moment is
  1062. @@ -2911,9 +3707,22 @@
  1063.        //! you pass in a :day value of 1 the returned Moment's day will be April 2.
  1064.        //! @since 1.0.0
  1065.        //! @param [Dictionary] options Hash table of options
  1066. +      //! @option [Number] :year The year
  1067. +      //! @option [Number] :month The month
  1068. +      //! @option [Number] :day The day
  1069. +      //! @option [Number] :hour The hour
  1070. +      //! @option [Number] :minute The minute
  1071. +      //! @option [Number] :second The second
  1072.        //! @return [Moment] The Moment object created using the options
  1073.        function moment(options) {}
  1074.  
  1075. +      //! Use utcInfo() to retrieve a Gregorian.Info for a date converted to UTC.
  1076. +      //! @since 2.0.0
  1077. +      //! @param [Moment] date Moment object to get Info from
  1078. +      //! @param [Number] format Time FORMAT_XXX constant to use
  1079. +      //! @return [Info] For FORMAT_SHORT, all values in Info are integers. For FORMAT_MEDIUM and FORMAT_LONG, the month/day fields have the strings for the date in question. The time returned has been converted to UTC.
  1080. +      function utcInfo(date, format) {}
  1081. +
  1082.      }
  1083.  
  1084.      //! The Duration object represents an immutable span of time. This is the return
  1085. @@ -3486,6 +4295,7 @@
  1086.        //! @since 1.0.0
  1087.        //! @see Drawable#initialize
  1088.        //! @param [Dictionary] dictionary A Dictionary containing the settings
  1089. +      //! @option [Symbol] :rezId The Rez identifier for the bitmap
  1090.        function initialize(dictionary) {}
  1091.  
  1092.        //! Draw the bitmap with draw().
  1093. @@ -3526,6 +4336,42 @@
  1094.  
  1095.      }
  1096.  
  1097. +    //! Button is the class representation of a Selectable that is mappable is to a
  1098. +    //! BehaviorDelegate method on selection.
  1099. +    //! @since 2.1.0
  1100. +    //! @see Selectable
  1101. +    class Button extends Selectable {
  1102. +      //! Background Drawable, Graphics.COLOR_* constant, or 24-bit integer of the form
  1103. +      //! 0xRRGGBB to be drawn before the current Selectable state is drawn.
  1104. +      //! @since 2.1.0
  1105. +      //! @return [Object]
  1106. +      var background;
  1107. +
  1108. +      //! Behavior method executed when button is selected. This method must be a member
  1109. +      //! of the active View's registered BehaviorDelegate, such as :onBack, but may also
  1110. +      //! be a method of an extended class. If the method returns false, or is not
  1111. +      //! specified (null), then a SelectableEvent will be issued.
  1112. +      //! @since 2.1.0
  1113. +      //! @return [Method]
  1114. +      var behavior;
  1115. +
  1116. +      //! Constructor Initialize the Button foreground, background, and behavior. The
  1117. +      //! Button must be registered via a setLayout() call in order to be usable. Accepts
  1118. +      //! the standard Selectable symbols and also includes its requirements.
  1119. +      //! @since 2.1.0
  1120. +      //! @param [Dictionary] options Parameters to specify in Button creation
  1121. +      //! @option [Method] :behavior Method object to call when selected, or null to use a SelectableEvent. Optional.
  1122. +      //! @option [Object] :background Drawable, Graphics.COLOR_* constant, or 24-bit integer of the form 0xRRGGBB. Optional.
  1123. +      function initialize(options) {}
  1124. +
  1125. +      //! Draw the object to the display context with draw(). Assume that the device
  1126. +      //! context has already been configured to the proper settings.
  1127. +      //! @since 2.1.0
  1128. +      //! @param [Graphics.Dc] dc The device context
  1129. +      function draw(dc) {}
  1130. +
  1131. +    }
  1132. +
  1133.      //! ClickEvent is an object sent to InputDelegate when the user presses the touch
  1134.      //! screen.
  1135.      //! @since 1.0.0
  1136. @@ -3605,6 +4451,17 @@
  1137.        //! @param [Activity.Info] info The updated Activity.Info object
  1138.        function compute(info) {}
  1139.  
  1140. +      //! Used to create a new field. Field is updated in the FIT file by changing the the
  1141. +      //! value of the data within the Field. This method is to allow data fields access
  1142. +      //! to FIT recording without giving them access to the session.
  1143. +      //! @since 1.3.0
  1144. +      //! @param [String] name The name of the Field as a string
  1145. +      //! @param [Number] fieldId The unique Field Identifier for the Field
  1146. +      //! @param [type] type The type definiton for the field from the DATA_TYPE_ enumeration
  1147. +      //! @param [Dictionary] options Optional parameters that can be specified for field creation @option [:count] The number of elements to add to the field if it is an array. @option [:mesgType] Optional. The message type that this field should be added to. Defaults to MESG_TYPE_RECORD if not provided. @option [:units] Optional. The display units as a String. This should use the current device language.
  1148. +      //! @return [Field] the resulting field object
  1149. +      function createField(name, fieldId, type, options) {}
  1150. +
  1151.        //! Returns the current background color for data fields, which is either
  1152.        //! Graphics.COLOR_WHITE or Graphics.COLOR_BLACK
  1153.        //! @since 1.2.0
  1154. @@ -3617,6 +4474,38 @@
  1155.        //! @return [Number] mask of OBSCURE_X values giving the sides of the display that that are obscured by a round screen. Valid during onUpdate.
  1156.        function getObscurityFlags() {}
  1157.  
  1158. +      //! The function onTimerLap will be called when a lap is added to the current
  1159. +      //! activity
  1160. +      //! @since 1.3.0
  1161. +      function onTimerLap() {}
  1162. +
  1163. +      //! The function onTimerPause will be called when the activity timer goes from the
  1164. +      //! running state to the paused state. The paused state will occur when the
  1165. +      //! auto-pause feature pauses the timer. If the activity timer is paused when the
  1166. +      //! app is loaded, this event will run immediately after startup
  1167. +      //! @since 1.3.0
  1168. +      function onTimerPause() {}
  1169. +
  1170. +      //! The function onTimerReset will be called when the current activity is ended
  1171. +      //! @since 1.3.0
  1172. +      function onTimerReset() {}
  1173. +
  1174. +      //! The function onTimerResume will be called when the activity timer goes from the
  1175. +      //! paused state to the running state.
  1176. +      //! @since 1.3.0
  1177. +      function onTimerResume() {}
  1178. +
  1179. +      //! The function onTimerStart will be called when the activity timer goes from the
  1180. +      //! stopped state to the started state. If the activity timer is running when the
  1181. +      //! app is loaded, this event will run immediately after startup.
  1182. +      //! @since 1.3.0
  1183. +      function onTimerStart() {}
  1184. +
  1185. +      //! The function onTimerStop will be called when the activity timer goes from the
  1186. +      //! running state to the stopped state.
  1187. +      //! @since 1.3.0
  1188. +      function onTimerStop() {}
  1189. +
  1190.      }
  1191.  
  1192.      //! A Drawable is the base class of a drawable object. A Drawable can be constructed
  1193. @@ -3651,6 +4540,11 @@
  1194.        //! Constructor
  1195.        //! @since 1.0.0
  1196.        //! @param [Dictionary] dictionary A Dictionary containing the settings
  1197. +      //! @option [String] :identifier The identifier for the Drawable
  1198. +      //! @option [Number] :locX The absolute screen x-coordinate for the Drawable
  1199. +      //! @option [Number] :locY The absolute screen y-coordinate for the Drawable
  1200. +      //! @option [Number] :width The clip width of the Drawable
  1201. +      //! @option [Number] :height The clip height of the Drawable
  1202.        function initialize(dictionary) {}
  1203.  
  1204.        //! Draw the object to the display context with draw(). Assume that the device
  1205. @@ -3720,6 +4614,15 @@
  1206.        //! @return [Boolean] true if handled, false otherwise
  1207.        function onRelease(evt) {}
  1208.  
  1209. +      //! When the state of a Selectable changes, onSelectable() is called. The instance
  1210. +      //! of the associated Selectable is passed so that its current state may be
  1211. +      //! determined.
  1212. +      //! @since 2.1.0
  1213. +      //! @param [Selectable] instance The Selectable that generated the event
  1214. +      //! @param [Symbol] previousState The previous Selectable state (stateDefault, stateHighlighted, etc)
  1215. +      //! @return [Boolean] true if handled, false otherwise
  1216. +      function onSelectable(instance, previousState) {}
  1217. +
  1218.        //! When a swipe event occurs, onSwipe() is called. This is sent when the user
  1219.        //! swipes the screen.
  1220.        //! @since 1.0.0
  1221. @@ -3736,6 +4639,16 @@
  1222.  
  1223.      }
  1224.  
  1225. +    //! InvalidSelectableStateException is thrown if an instance of Selectable is
  1226. +    //! assigned a state that it doesn't contain.
  1227. +    //! @since 2.1.0
  1228. +    module toplevel {
  1229. +      //! Constructor
  1230. +      //! @since 2.1.0
  1231. +      function initialize() {}
  1232. +
  1233. +    }
  1234. +
  1235.      //! KeyEvent is an object sent to InputDelegate when a hard key is pressed on the
  1236.      //! device.
  1237.      //! @since 1.0.0
  1238. @@ -3852,6 +4765,12 @@
  1239.        //! Set the options for the Picker.
  1240.        //! @since 1.2.0
  1241.        //! @param [Dictionary] options the options for the Picker
  1242. +      //! @option [Drawable] :title the title for the Picker. Required.
  1243. +      //! @option [Array] :pattern an Array of [Object] for the Picker to display. If the Array entry is a PickerFactory then it is presented to the user to make a choice. If it is a Drawable then it is display only. Required.
  1244. +      //! @option [Array] :defaults an Array of [Number] indicating the starting index for each entry in :pattern. Optional.
  1245. +      //! @option [Drawable] :nextArrow a custom next icon for the Picker. Optional.
  1246. +      //! @option [Drawable] :previousArrow a custom previous icon for the Picker. Optional.
  1247. +      //! @option [Drawable] :confirm a custom confirm icon for the Picker. Optional.
  1248.        function setOptions(options) {}
  1249.  
  1250.      }
  1251. @@ -3920,6 +4839,88 @@
  1252.  
  1253.      }
  1254.  
  1255. +    //! Selectable is the class representation of an on-screen selectable object with
  1256. +    //! defined states depending on selection mode
  1257. +    //! @since 2.1.0
  1258. +    //! @see Drawable
  1259. +    class Selectable extends Drawable {
  1260. +      //! Default state Drawable, Graphics.COLOR_* constant, or 24-bit integer of the form
  1261. +      //! 0xRRGGBB
  1262. +      //! @since 2.1.0
  1263. +      //! @return [Object]
  1264. +      var stateDefault;
  1265. +
  1266. +      //! Disabled state Drawable, Graphics.COLOR_* constant, or 24-bit integer of the
  1267. +      //! form 0xRRGGBB
  1268. +      //! @since 2.1.0
  1269. +      //! @return [Object]
  1270. +      var stateDisabled;
  1271. +
  1272. +      //! Highlighted state Drawable, Graphics.COLOR_* constant, or 24-bit integer of the
  1273. +      //! form 0xRRGGBB
  1274. +      //! @since 2.1.0
  1275. +      //! @return [Object]
  1276. +      var stateHighlighted;
  1277. +
  1278. +      //! Selected state Drawable, Graphics.COLOR_* constant, or 24-bit integer of the
  1279. +      //! form 0xRRGGBB
  1280. +      //! @since 2.1.0
  1281. +      //! @return [Object]
  1282. +      var stateSelected;
  1283. +
  1284. +      //! Constructor
  1285. +      //! @since 2.1.0
  1286. +      //! @param [Dictionary] options Parameters to specify in Selectable creation
  1287. +      //! @option [Number] :locX @see Drawable#initialize. Required.
  1288. +      //! @option [Number] :locY @see Drawable#initialize. Required.
  1289. +      //! @option [Number] :width @see Drawable#initialize. Required.
  1290. +      //! @option [Number] :height @see Drawable#initialize. Required.
  1291. +      //! @option [Object] :stateDefault Drawable to display in default state. Optional.
  1292. +      //! @option [Object] :stateHighlighted Drawable to display in disable state. Optional.
  1293. +      //! @option [Object] :stateSelected Drawable to display in highlight state. Optional.
  1294. +      //! @option [Object] :stateDisabled Drawable to display in selected state. Optional.
  1295. +      function initialize(options) {}
  1296. +
  1297. +      //! Draw the object to the display context with draw(). Assume that the device
  1298. +      //! context has already been configured to the proper settings.
  1299. +      //! @since 2.1.0
  1300. +      //! @param [Graphics.Dc] dc The device context
  1301. +      function draw(dc) {}
  1302. +
  1303. +      //! Get the current state.
  1304. +      //! @since 2.1.0
  1305. +      //! @return [Symbol] The current state (:stateDefault, :stateHighlighted, etc).
  1306. +      function getState() {}
  1307. +
  1308. +      //! Set the current state.
  1309. +      //! @since 2.1.0
  1310. +      //! @param [Symbol] state The desired state (:stateDefault, :stateHighlighted, etc) to make current.
  1311. +      function setState(state) {}
  1312. +
  1313. +    }
  1314. +
  1315. +    //! SelectableEvent is an object sent to InputDelegate when the user manipulates a
  1316. +    //! Selectable using hard-keys or the touchscreen.
  1317. +    //! @since 2.1.0
  1318. +    class SelectableEvent {
  1319. +      //! Constructor
  1320. +      //! @since 2.1.0
  1321. +      //! @param [Selectable] instance The Selectable that generated the event
  1322. +      //! @param [Symbol] previousState The previous Selectable state (stateDefault, stateHighlighted, etc)
  1323. +      function initialize(instance, previousState) {}
  1324. +
  1325. +      //! Get the instance of the manipulated Selectable.
  1326. +      //! @since 2.1.0
  1327. +      //! @return  The Reference to the Selectable manipulated
  1328. +      function getInstance() {}
  1329. +
  1330. +      //! Get the previous state of the Selectable that generated the event.
  1331. +      //! @since 2.1.0
  1332. +      //! @return [Symbol] The previous Selectable state (stateDefault, stateHighlighted, etc)
  1333. +      function getPreviousState() {}
  1334. +
  1335. +    }
  1336. +
  1337.      //! The SimpleDataField class is used for creating simple data fields. In a
  1338.      //! SimpleDataField, the developer is only required to implement a compute method.
  1339.      //! The compute method is passed an Activity.Info object, which contains all current
  1340. @@ -3969,6 +4970,11 @@
  1341.        //! @since 1.0.0
  1342.        //! @see Drawable#initializes
  1343.        //! @param [Dictionary] dictionary A Dictionary containing the settings
  1344. +      //! @option [Object] :text The text string or the Rez ID of a string resource
  1345. +      //! @option [Object] :color The text color of type Graphics.COLOR_*
  1346. +      //! @option [Object] :backgroundColor The background color of type Graphics.COLOR_*
  1347. +      //! @option [Object] :font The font to use of type Graphics.FONT_*
  1348. +      //! @option [Object] :justification The text justification of type Graphics.TEXT_JUSTIFY_*
  1349.        function initialize(dictionary) {}
  1350.  
  1351.        //! Draw the Text resource with draw().
  1352. @@ -3976,6 +4982,11 @@
  1353.        //! @param [Graphics.Dc] dc The draw context
  1354.        function draw(dc) {}
  1355.  
  1356. +      //! Use setBackgroundColor() to set the text's background color.
  1357. +      //! @since 1.3.0
  1358. +      //! @param color The background color of type Graphics.COLOR_*
  1359. +      function setBackgroundColor(color) {}
  1360. +
  1361.        //! Use setColor() to set the text color.
  1362.        //! @since 1.0.0
  1363.        //! @param color The text color of type Graphics.COLOR_*
  1364. @@ -4042,6 +5053,10 @@
  1365.      //! onShow(), and onUpdate() aren't called for SimpleDataField objects.
  1366.      //! @since 1.0.0
  1367.      class View {
  1368. +      //! Constructor
  1369. +      //! @since 2.1.0
  1370. +      function initialize() {}
  1371. +
  1372.        //! Find a Drawable by its ID.
  1373.        //! @since 1.0.0
  1374.        //! @param [String] id The ID of the Drawable to find
  1375. @@ -4078,11 +5093,18 @@
  1376.        //! @return [Boolean] true if handled, false otherwise
  1377.        function onUpdate(dc) {}
  1378.  
  1379. +      //! Set the state of the keys to Selectable interaction mode. In this mode the keys
  1380. +      //! are used to cycle through the on screen Selectable objects. The first registered
  1381. +      //! Selectable in the current layout will be highlighted.
  1382. +      //! @since 2.1.0
  1383. +      //! @param [Boolean] enabled If the mode should be enabled
  1384. +      function setKeyToSelectableInteraction(enabled) {}
  1385. +
  1386.        //! Use setLayout() to set the layout for the View. If the extending class does not
  1387.        //! override onUpdate(), then all Drawables contained in layout will automatically
  1388.        //! be drawn by the View.
  1389.        //! @since 1.0.0
  1390. -      //! @param [Layout] layout An array of Drawables
  1391. +      //! @param [Array] layout An array of Drawables
  1392.        function setLayout(layout) {}
  1393.  
  1394.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement