2009/dap/system-info Overview.html,1.94,1.95

Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv12434

Modified Files:
	Overview.html 
Log Message:
no set function -- version of this specification is read-only


Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- Overview.html	24 Mar 2010 11:28:31 -0000	1.94
+++ Overview.html	24 Mar 2010 14:22:57 -0000	1.95
@@ -311,36 +311,6 @@
             <dd>An object containing the various options for fetching the properties requested</dd>
           </dl>
           </dd>
-          <dt>PendingOp set()</dt>
-          <dd>
-            The <a>set</a> function modifies the current value of of a
-            system property. When called, the function immediately
-            returns and asynchronously attempts to set the requested
-            state of the value identified by the <a>propertyId</a>
-            attribute. If it is successful the success callback is
-            invoked and is passed an object containing the requested
-            information. The type of that object is indicated in the
-            property definitions below. If an error occurs, or if the
-            system does not allow the value to be modified, then the
-            <a>errorCallback</a> function is invoked and is passed an
-            <a>Error</a> object indicating the cause of error.
-            
-            <p>Not all property attributes can be modified. Each
-            property interface definitions indicates, through the
-            <code>readonly</code> keyword whether an attribute is
-            allowed to be modified.</p>
-
-            <dl class="parameters">
-              <dt>DOMString propertyId</dt>
-              <dd>The URI or name of the property to retrieve.</dd>
-              <dt>optional Object value</dt>
-              <dd>An object containing the values to modify, as well as the <a>id</a> to designate which instance to modify</dd>
-              <dt>SuccessCB successCallback</dt>
-              <dd>function called when the property have been successfully modified</dd>
-              <dt>optional ErrorCB? errorCallback</dt>
-              <dd>function called when an error occurred while modifying the property</dd>
-            </dl>
-          </dd>
           <dt>boolean has()</dt>
           <dd>
             This function is used to determine if the user agent
@@ -355,28 +325,6 @@
           </dd>
         </dl>
 
-        <div class="issue">Is set() necessary? Should we let any property be modified by this API? Candidates include:
-  <pre>CPU.load
-Network.activeConnection
-Network.maxDownloadBandwidth
-Network.maxUploadBandwidth
-Connection.apn
-Connection.operatorName
-Connection.mnc
-StorageUnit.isReadWrite
-Display.orientation
-Display.brightness	
-Display.contrast	
-Display.blanked	
-Display.dotsPerInchW	
-Display.dotsPerInchH
-Speaker.volumeLevel
-InputDevices.activePointingDevices
-InputDevices.activeKeyboards	
-InputDevices.activeCameras	
-InputDevices.activeMicrophones</pre> If it is found that none of these attributes should be modifiable, then the set() function is not needed.</div>
-
-
         <p>All functions except <a>has</a> return a <a>PendingOp</a> object, defined in [[!CORE-DEVICE]], which has a <a>cancel</a> function allowing the asynchronous operation to be interrupted.</p>
 
         <section>
@@ -784,17 +732,14 @@
         <p>The properties defined below expose the values of external sensors, reflecting the device's environment such as temperature, ambient brightness or ambient sound.</p>
         <section>
           <h4>ECMAScript Example</h4>
-          <pre class="sh_javascript example">// Automatically adjust the screen brightness if the ambient brightness is above a certain level
+          <pre class="sh_javascript example">// Automatically adjust the UI colors if the ambient light gets too bright
 
 navigator.system.watch("AmbientLight",success, {highThreshold: 0.9, thresholdTarget:"normalizedValue"});
 
-function success() {
-  navigator.system.get("OutputDevices", 
-                       function(devices) {
-                         for(var i=0; i&lt;devices.displays.length; i++)
-                           navigator.system.set("Display",{id: devices.displays[i].id, brightness: 0.9});
-                       });
-}</pre>
+function success() { 
+  setColorScheme('bright');
+}
+</pre>
         </section>
 
         <section>
@@ -1078,12 +1023,11 @@
 
           <section>
             <h4>ECMAScript Example</h4>
-            <pre class="sh_javascript example">// Set the brightness of all the displays to their maximum value
+            <pre class="sh_javascript example">// Count the screens
 
 navigator.system.get("OutputDevices", 
                      function(devices) {
-                       for(var i=0; i&lt;devices.displays.length; i++)
-                         navigator.system.set("Display",{id: devices.displays[i].id, brightness: 1});
+                       alert('this device has '+devices.displayDevices.length+' displays);
                      });</pre>
           </section>
 

Received on Wednesday, 24 March 2010 14:23:00 UTC