org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-D66AB112-1BC4-4A88-AFCF-1CDBB94366B7.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 26 May 2010 17:01:34 -0700
changeset 341 480716493610
parent 229 716254ccbcc0
permissions -rw-r--r--
Set content type for png files


<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="mobileconcept"/><meta name="DC.Title" content="lighton()"/><meta name="DC.Relation" scheme="URI" content="GUID-7A68BE34-5C07-4008-A886-A20D92669E05"/><meta name="DC.Relation" scheme="URI" content="GUID-7C69DDA4-16F1-4A8F-BDB2-4CB0015B4E81"/><meta name="DC.Relation" scheme="URI" content="GUID-65AAF569-D347-462B-B59A-9D7CA184AB9C"/><meta name="DC.Relation" scheme="URI" content="GUID-1A678A11-0BDD-4F64-9F40-013F6CDB81D7"/><meta name="DC.Relation" scheme="URI" content="GUID-318BD3F5-D351-4BC2-8F4F-6E096A56CD54"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-D66AB112-1BC4-4A88-AFCF-1CDBB94366B7"/><title>lighton() </title><script type="text/javascript">
      function initPage() {}
    </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-D66AB112-1BC4-4A88-AFCF-1CDBB94366B7">lighton()</h1><div>
<p><strong>Syntax:</strong></p>
<pre class="codeblock" id="GUID-0AD4C87B-F380-4A82-808B-06D88667618D">[void] sysinfo.lighton(Int lighttarget, Int duration, Int intensity, Bool fadein)</pre>
<p><strong>Description:</strong></p>
<p>The <code>lighton</code> method switches the specified target light on for a specified duration with the brightness defined by a specified light intensity.</p>
<p><strong>Argument:</strong></p>
<ul>
<li><p><code>lighttarget</code>:</p>

<p>Defines which target light should be turned on. Use one of the supported target light properties to specify a target light.</p>

</li>
<li><p><code>duration</code>:</p>

<p>Defines the period during which the target light is switched on. The period is measured in milliseconds.</p>
<p>After the duration expires, the light state of the target will be changed to whatever state was caused by the last infinite time duration call. If there has not been a previous infinite time duration call in a session, the default state determined by the inactivity timer (system backlight timeout) is used.</p>
<p>If <code>duration</code> is <a href="GUID-A4CEF923-1DE8-46E0-8D42-79AA621A06A2.html#GUID-A4CEF923-1DE8-46E0-8D42-79AA621A06A2"><code>lightinfiniteduration</code></a>, the target light can be turned off only when some other light control method is called.</p>
<p>Duration can also have the maximum value of <a href="GUID-9B63C06E-3FCE-4201-B6C5-4F728894DA40.html#GUID-9B63C06E-3FCE-4201-B6C5-4F728894DA40"><code>lightmaxduration</code></a></p>

</li>
<li><p><code>intensity</code>:</p>

<p>Defines the intensity (brightness) of the light. If <code>intensity</code> is <a href="GUID-F51B8923-8A46-49A0-B307-E84194904454.html#GUID-F51B8923-8A46-49A0-B307-E84194904454"><code>lightdefaultintensity</code></a>, the device default intensity will be used. </p>
<p>Use the <a href="GUID-EF4E58FF-E9EA-429C-9D3D-5F0911B534CA.html#GUID-EF4E58FF-E9EA-429C-9D3D-5F0911B534CA"><code>lightminintensity</code></a> and the <a href="GUID-9695EFDE-3134-4AA7-9422-613DEDEAE314.html#GUID-9695EFDE-3134-4AA7-9422-613DEDEAE314"><code>lightmaxintensity</code></a> to detect the range of supported light intensity, and use any value between the range to avoid providing an invalid intensity value.</p>

</li>
</ul>
<div class="note"><p><strong class="note_title">Note: </strong>All devices might not support a user-defined intensity, in which case the device will behave in its default manner.</p>
</div>
<ul>
<li><p><code>fadein</code>:</p>

<p>If <code>true</code>, target lights will not turn on instantly but fade-in smoothly instead. if <code>false</code>, target lights will be turned on without the fading effect.</p>

</li>
</ul>
<div class="note"><p><strong class="note_title">Note: </strong>All devices might not support fade-in, in which case the device will behave in its default manner.</p>
</div>
<p><strong>Return value:</strong></p>
<p>This method does not return a value.</p>
<p><strong>Remarks:</strong></p>
<p>Switching and keeping the mobile device lights on consumes energy. Therefore, it is recommended that you carefully consider the need for using the lights.</p>
<p><strong>Example code:</strong></p>
<pre class="codeblock" id="GUID-EE0644EE-9976-4D84-873E-7DB70FB4A0DF">function callLightOn()
{
   // get the Embed element reference
   var sysinfo = document.embeds[0];
   /*********************
   call lighton() method, which turns on the light 
   of all displays and keyboard with the maximum duration 
   and using the default light intensity with the fade-in 
   effect
   *********************/
   var target =  sysinfo.lighttargetsystem;
   var duration = sysinfo.lightmaxduration;
   var intensity = sysinfo.lightdefaultintensity;
   sysinfo.lighton(target, duration, intensity, true);
}</pre>
</div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html>