epoc32/include/hwrmlight.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 /*
     1 /*
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8 *
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  This file contains the header of the 
    14 * Description:
    15 *                CHWRMLight class.
       
    16 *
    15 *
    17 */
    16 */
       
    17 
       
    18 
    18 
    19 
    19 
    20 
    20 #ifndef HWRMLIGHT_H
    21 #ifndef HWRMLIGHT_H
    21 #define HWRMLIGHT_H
    22 #define HWRMLIGHT_H
    22 
    23 
    25 
    26 
    26 // CONSTANTS
    27 // CONSTANTS
    27 
    28 
    28 /**
    29 /**
    29 * Minimum allowed intensity setting for Light.
    30 * Minimum allowed intensity setting for Light.
       
    31 *
       
    32 * @publishedAll
       
    33 * @released
    30 */
    34 */
    31 const TInt KHWRMLightMinIntensity = 1;
    35 const TInt KHWRMLightMinIntensity = 1;
    32 
    36 
    33 /**
    37 /**
    34 * Maximum allowed intensity setting for Light.
    38 * Maximum allowed intensity setting for Light.
       
    39 *
       
    40 * @publishedAll
       
    41 * @released
    35 */
    42 */
    36 const TInt KHWRMLightMaxIntensity = 100;
    43 const TInt KHWRMLightMaxIntensity = 100;
    37 
    44 
    38 /**
    45 /**
    39 * Indicates default intensity in various methods.
    46 * Indicates default intensity in various methods.
       
    47 *
       
    48 * @publishedAll
       
    49 * @released
    40 */
    50 */
    41 const TInt KHWRMDefaultIntensity = 0;
    51 const TInt KHWRMDefaultIntensity = 0;
    42 
    52 
    43 /**
    53 /**
    44 * Maximum allowed duration value.
    54 * Maximum allowed duration value.
       
    55 *
       
    56 * @publishedAll
       
    57 * @released
    45 */
    58 */
    46 const TInt KHWRMLightMaxDuration = (KMaxTInt / 1000) - 1;
    59 const TInt KHWRMLightMaxDuration = (KMaxTInt / 1000) - 1;
    47 
    60 
    48 /**
    61 /**
    49 * Infinite duration value.
    62 * Infinite duration value.
       
    63 *
       
    64 * @publishedAll
       
    65 * @released
    50 */
    66 */
    51 const TInt KHWRMInfiniteDuration = 0;
    67 const TInt KHWRMInfiniteDuration = 0;
    52 
    68 
    53 /**
    69 /**
    54 * Indicates device default Blink cycle time.
    70 * Indicates device default Blink cycle time.
       
    71 *
       
    72 * @publishedAll
       
    73 * @released
    55 */
    74 */
    56 const TInt KHWRMDefaultCycleTime = 0;
    75 const TInt KHWRMDefaultCycleTime = 0;
    57 
    76 
    58 
    77 
    59 // FORWARD DECLARATIONS
       
    60 class MHWRMLightObserver;
    78 class MHWRMLightObserver;
    61 
    79 class CHWRMEnhancedLight;
    62 // CLASS DECLARATIONS
    80 
       
    81 /**  
       
    82 * RGB values.
       
    83 *
       
    84 * @publishedAll
       
    85 */
       
    86 
       
    87 struct THWRMLightColor
       
    88 {
       
    89     TUint8 iRed;
       
    90     TUint8 iGreen;
       
    91     TUint8 iBlue;
       
    92 };
       
    93 
    63 
    94 
    64 /**
    95 /**
    65 * The class used to control the device lights.
    96 * The class used to control the device lights.
    66 *
    97 *
    67 * The HW Resource Manager Light API is a library API providing the ability 
    98 * The HW Resource Manager Light API is a library API providing the ability 
    80 * of the MHWRMLightObserver implementing class for the NewL-method.
   111 * of the MHWRMLightObserver implementing class for the NewL-method.
    81 *
   112 *
    82 * Usage:
   113 * Usage:
    83 *
   114 *
    84 * @code
   115 * @code
    85 * #include <HWRMLight.h>  // link against HWRMLightClient.lib
   116 * #include <hwrmlight.h> 
    86 *
   117 *
    87 * // A CHWRMLight instance can be created by using NewL() or NewLC() methods. 
   118 * // A CHWRMLight instance can be created by using NewL() or NewLC() methods. 
    88 * // Up-to-date status information not required, no callbacks.
   119 * // Up-to-date status information not required, no callbacks.
    89 * CHWRMLight* light = CHWRMLight::NewL();
   120 * CHWRMLight* light = CHWRMLight::NewL();
    90 *
   121 *
    94 *
   125 *
    95 * // To clean up, delete the created object:
   126 * // To clean up, delete the created object:
    96 * delete light;
   127 * delete light;
    97 * @endcode
   128 * @endcode
    98 *
   129 *
    99 * @lib HWRMLIGHTCLIENT.DLL
   130 * @publishedAll
   100 * @since S60 3.0
   131 * @released
   101 */
   132 */
   102 class CHWRMLight : public CBase
   133 class CHWRMLight : public CBase
   103     {
   134     {
   104     public:
   135     public:
   105 
   136 
   106 		/**
   137 		/**
   107 		* Possible light states that can be get for the different light targets
   138 		* Possible light states that can be get for the different light targets
   108 		*/
   139 		*/
   109 		enum TLightStatus
   140 		enum TLightStatus
   110 			{
   141 			{
   111 			ELightStatusUnknown = 0, ///< For debugging/development and signaling an error conditions.
   142 			/**
   112 			ELightOn,                ///< Light state switch to light on.
   143 			For debugging/development and signaling an error conditions.
   113 			ELightOff,               ///< Light state switch to light off.
   144 			*/
   114 			ELightBlink            ///< Light state switch to light blinking.
   145 			ELightStatusUnknown = 0,
       
   146 			/**
       
   147 			Light state switch to light on.
       
   148 			*/
       
   149 			ELightOn,              
       
   150 			/**
       
   151 			Light state switch to light off.
       
   152 			*/
       
   153 			ELightOff,             
       
   154 			/**
       
   155 			Light state switch to light blinking.
       
   156 			*/
       
   157 			ELightBlink            
   115 			};
   158 			};
   116 
   159 
   117         /**
   160         /**
   118         * Possible light targets. 
   161         * Possible light targets. 
   119         * Targets can be used as bitmask. Some common masks are provided as enum.
   162         * Targets can be used as bitmask. Some common masks are provided as enum.
   124         *
   167         *
   125         * At least one target must be defined.
   168         * At least one target must be defined.
   126         */
   169         */
   127         enum TLightTarget
   170         enum TLightTarget
   128             {
   171             {
   129             ENoTarget                    = 0x0,     ///< No target. Not a valid target value, used only
   172             /**
   130                                                     ///< for error checking.
   173             No target. Not a valid target value, used only for error checking.
   131             
   174             */
   132             EPrimaryDisplay              = 0x1,     ///< Primary display of the device.
   175             ENoTarget                    = 0x0,    
   133             EPrimaryKeyboard             = 0x2,     ///< Primary keyboard of the device. 
   176             /**
   134             EPrimaryDisplayAndKeyboard   = 0x3,     ///< Both primary display and the 
   177             Primary display of the device.
   135                                                     ///< primary keyboard of the device.  
   178             */            
   136             
   179             EPrimaryDisplay              = 0x1,     
   137             ESecondaryDisplay            = 0x4,     ///< Secondary display of the device.
   180             /**
   138             ESecondaryKeyboard           = 0x8,     ///< Secondary keyboard of the device. 
   181             Primary keyboard of the device. 
   139             ESecondaryDisplayAndKeyboard = 0xC,     ///< Both secondary display and the 
   182             */
   140                                                     ///< secondary keyboard of the device.  
   183             EPrimaryKeyboard             = 0x2,     
   141                                                 
   184             /**
   142             ECustomTarget1               = 0x10,    ///< Device specific custom target 1.
   185             Both primary display and the primary keyboard of the device.  
   143             ECustomTarget2               = 0x20,    ///< Device specific custom target 2.
   186             */
   144             ECustomTarget3               = 0x40,    ///< Device specific custom target 3.
   187             EPrimaryDisplayAndKeyboard   = 0x3,                
   145             ECustomTarget4               = 0x80,    ///< Device specific custom target 4.
   188             /**
   146             
   189             Secondary display of the device.
       
   190             */
       
   191             ESecondaryDisplay            = 0x4,     
       
   192             /**
       
   193             Secondary keyboard of the device. 
       
   194             */
       
   195             ESecondaryKeyboard           = 0x8,     
       
   196             /**
       
   197             Both secondary display and the secondary keyboard of the device.  
       
   198             */
       
   199             ESecondaryDisplayAndKeyboard = 0xC,          
       
   200             /**
       
   201             Device specific custom target 1.
       
   202             */
       
   203             ECustomTarget1               = 0x10, 
       
   204             /**
       
   205             Device specific custom target 2.
       
   206             */
       
   207             ECustomTarget2               = 0x20, 
       
   208             /**
       
   209             Device specific custom target 3.
       
   210             */
       
   211             ECustomTarget3               = 0x40, 
       
   212             /**
       
   213             Device specific custom target 4.
       
   214             */
       
   215             ECustomTarget4               = 0x80,             
   147             /**
   216             /**
   148             * Special target used to control all currently available system lights.
   217             * Special target used to control all currently available system lights.
   149             *
   218             *
   150             * System lights normally include all displays and keyboards, 
   219             * System lights normally include all displays and keyboards, 
   151             * but not custom lights. This is however device dependent.
   220             * but not custom lights. This is however device dependent.
   208         * @leave KErrNotSupported Device doesn't support Light feature.
   277         * @leave KErrNotSupported Device doesn't support Light feature.
   209         * @leave KErrNoMemory There is a memory allocation failure. 
   278         * @leave KErrNoMemory There is a memory allocation failure. 
   210         */
   279         */
   211         IMPORT_C static CHWRMLight* NewLC(MHWRMLightObserver* aCallback);
   280         IMPORT_C static CHWRMLight* NewLC(MHWRMLightObserver* aCallback);
   212 
   281 
       
   282 		
       
   283 		/**
       
   284 		* Destructor
       
   285 		*/
       
   286 		IMPORT_C ~CHWRMLight();
       
   287 		
   213     public: // New functions
   288     public: // New functions
   214 
   289 
   215     	
   290     	
   216     	/**
   291     	/**
   217     	* Reserves light target exclusively for this client.
   292     	* Reserves light target exclusively for this client.
   235     	* @leave KErrNotReady Trying to reserve while on background.
   310     	* @leave KErrNotReady Trying to reserve while on background.
   236         * @leave KErrNoMemory There is a memory allocation failure. 
   311         * @leave KErrNoMemory There is a memory allocation failure. 
   237 		*
   312 		*
   238 	 	* @see TLightTarget
   313 	 	* @see TLightTarget
   239     	*/
   314     	*/
   240     	virtual void ReserveLightL(TInt aTarget)=0;
   315     	virtual void ReserveLightL(TInt aTarget);
   241     	
   316     	
   242     	/**
   317     	/**
   243     	* Reserves light target exclusively for this client.
   318     	* Reserves light target exclusively for this client.
   244     	* A higher priority client may cause lower priority client reservation
   319     	* A higher priority client may cause lower priority client reservation
   245     	* to be temporarily suspended. Commands can still be issued in suspended 
   320     	* to be temporarily suspended. Commands can still be issued in suspended 
   270         *                        on foreground/background status of the client.
   345         *                        on foreground/background status of the client.
   271         *                        Only trusted clients are allowed to set this flag to ETrue.
   346         *                        Only trusted clients are allowed to set this flag to ETrue.
   272     	*                        A client is considered trusted if it has nonstandard
   347     	*                        A client is considered trusted if it has nonstandard
   273         *                        priority defined in the internal lights policy of the 
   348         *                        priority defined in the internal lights policy of the 
   274         *                        HW Resource Manager. A client can be defined trusted
   349         *                        HW Resource Manager. A client can be defined trusted
   275         *                        only by S60 or a product.
   350         *                        only by a product.
   276     	*
   351     	*
   277     	* @leave KErrNotSupported One or more of specified targets are not supported.
   352     	* @leave KErrNotSupported One or more of specified targets are not supported.
   278     	* @leave KErrAccessDenied Paramenter aForceNoCCoeEnv is ETrue and client is not trusted.
   353     	* @leave KErrAccessDenied Paramenter aForceNoCCoeEnv is ETrue and client is not trusted.
   279     	* @leave KErrBadHandle Parameter ForceNoCCoeEnv is EFalse and no CCoeEnv present.
   354     	* @leave KErrBadHandle Parameter ForceNoCCoeEnv is EFalse and no CCoeEnv present.
   280     	* @leave KErrNotReady Trying to reserve while on background and parameter 
   355     	* @leave KErrNotReady Trying to reserve while on background and parameter 
   281         *                     aForceNoCCoeEnv is EFalse.
   356         *                     aForceNoCCoeEnv is EFalse.
   282         * @leave KErrNoMemory There is a memory allocation failure. 
   357         * @leave KErrNoMemory There is a memory allocation failure. 
   283 		*
   358 		*
   284 	 	* @see TLightTarget
   359 	 	* @see TLightTarget
   285     	*/
   360     	*/
   286     	virtual void ReserveLightL(TInt aTarget, TBool aRestoreState, TBool aForceNoCCoeEnv)=0;
   361     	virtual void ReserveLightL(TInt aTarget, TBool aRestoreState, TBool aForceNoCCoeEnv);
   287 
   362 
   288     	/**
   363     	/**
   289     	* Releases light target if it was previously reserved for this client.
   364     	* Releases light target if it was previously reserved for this client.
   290     	* If this client has not reserved any of the specified lights, 
   365     	* If this client has not reserved any of the specified lights, 
   291     	* this method does nothing.
   366     	* this method does nothing.
   296 		* @param aTarget Defines which light should be released. Multiple lights can
   371 		* @param aTarget Defines which light should be released. Multiple lights can
   297 		*                be specified with using bitwise-or.
   372 		*                be specified with using bitwise-or.
   298 		*
   373 		*
   299 	 	* @see TLightTarget
   374 	 	* @see TLightTarget
   300     	*/
   375     	*/
   301     	virtual void ReleaseLight(TInt aTarget)=0;
   376     	virtual void ReleaseLight(TInt aTarget);
   302 
   377 
   303 
   378 
   304 	    /** 
   379 	    /** 
   305 	    * The LightOnL method switches the specified target light on
   380 	    * The LightOnL method switches the specified target light on
   306 	    * for infinite duration using default intensity. Lights will use fade-in.
   381 	    * for infinite duration using default intensity. Lights will use fade-in.
   319         * @leave KErrNoMemory There is a memory allocation failure. 
   394         * @leave KErrNoMemory There is a memory allocation failure. 
   320         * @leave KErrGeneral There is a hardware error.
   395         * @leave KErrGeneral There is a hardware error.
   321 		*
   396 		*
   322 	 	* @see TLightTarget
   397 	 	* @see TLightTarget
   323 		*/
   398 		*/
   324 		virtual void LightOnL(TInt aTarget) = 0;
   399 		virtual void LightOnL(TInt aTarget);
   325 
   400 
   326 	    /** 
   401 	    /** 
   327 	    * The LightOnL method switches the specified target light on
   402 	    * The LightOnL method switches the specified target light on
   328 	    * for the specified duration using default intensity. Lights will use fade-in.
   403 	    * for the specified duration using default intensity. Lights will use fade-in.
   329         *
   404         *
   352         * @leave KErrGeneral There is a hardware error.
   427         * @leave KErrGeneral There is a hardware error.
   353 		*
   428 		*
   354 	 	* @see TLightTarget
   429 	 	* @see TLightTarget
   355 		*/
   430 		*/
   356 		virtual void LightOnL(TInt aTarget, 
   431 		virtual void LightOnL(TInt aTarget, 
   357 		                      TInt aDuration) = 0;
   432 		                      TInt aDuration);
   358 
   433 
   359 	    /** 
   434 	    /** 
   360 	    * The LightOnL method switches the specified target light on
   435 	    * The LightOnL method switches the specified target light on
   361 	    * for the specified duration using specified intensity. Fade-in can also be controlled.
   436 	    * for the specified duration using specified intensity. Fade-in can also be controlled.
   362 	    *
   437 	    *
   391 	 	* @see TLightTarget
   466 	 	* @see TLightTarget
   392 		*/
   467 		*/
   393 		virtual void LightOnL(TInt aTarget, 
   468 		virtual void LightOnL(TInt aTarget, 
   394 		                      TInt aDuration, 
   469 		                      TInt aDuration, 
   395 		                      TInt aIntensity,
   470 		                      TInt aIntensity,
   396 		                      TBool aFadeIn) = 0;
   471 		                      TBool aFadeIn);
   397 
   472 
   398 	    /** 
   473 	    /** 
   399 	    * The LightBlinkL method blinks the target light(s) of the device for infinite duration
   474 	    * The LightBlinkL method blinks the target light(s) of the device for infinite duration
   400 	    * using default intensity.
   475 	    * using default intensity.
   401         *
   476         *
   402         * Calling this method is equal to call 
   477         * Calling this method is equal to call 
       
   478         * @code
   403         * LightBlinkL(aTarget, KHWRMInfiniteDuration, KHWRMDefaultCycleTime, 
   479         * LightBlinkL(aTarget, KHWRMInfiniteDuration, KHWRMDefaultCycleTime, 
   404         *             KHWRMDefaultCycleTime, KHWRMDefaultIntensity).
   480         *             KHWRMDefaultCycleTime, KHWRMDefaultIntensity).
       
   481 	   	* @endcode
   405 	   	*
   482 	   	*
   406 		* @param aTarget Defines which light should be controlled. Multiple lights can
   483 		* @param aTarget Defines which light should be controlled. Multiple lights can
   407 		*                be specified with using bitwise-or.
   484 		*                be specified with using bitwise-or.
   408 	   	*
   485 	   	*
   409         * @leave KErrNotSupported One or more of specified targets are not supported.
   486         * @leave KErrNotSupported One or more of specified targets are not supported.
   414         * @leave KErrNoMemory There is a memory allocation failure. 
   491         * @leave KErrNoMemory There is a memory allocation failure. 
   415         * @leave KErrGeneral There is a hardware error.
   492         * @leave KErrGeneral There is a hardware error.
   416 		*
   493 		*
   417 	 	* @see TLightTarget
   494 	 	* @see TLightTarget
   418 		*/
   495 		*/
   419 		virtual void LightBlinkL(TInt aTarget) = 0;
   496 		virtual void LightBlinkL(TInt aTarget);
   420 
   497 
   421 	    /** 
   498 	    /** 
   422 	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
   499 	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
   423 	    * using default intensity.
   500 	    * using default intensity.
   424         *
   501         *
   448         * @leave KErrGeneral There is a hardware error.
   525         * @leave KErrGeneral There is a hardware error.
   449 		*
   526 		*
   450 	 	* @see TLightTarget
   527 	 	* @see TLightTarget
   451 		*/
   528 		*/
   452 		virtual void LightBlinkL(TInt aTarget, 
   529 		virtual void LightBlinkL(TInt aTarget, 
   453 		                         TInt aDuration) = 0;
   530 		                         TInt aDuration);
   454 
   531 
   455 	    /** 
   532 	    /** 
   456 	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
   533 	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
   457 	    * using specified intensity. On- and Off-cycle times of the blinking can also be controlled.
   534 	    * using specified intensity. On- and Off-cycle times of the blinking can also be controlled.
   458 	   	*
   535 	   	*
   501 		*/
   578 		*/
   502 		virtual void LightBlinkL(TInt aTarget, 
   579 		virtual void LightBlinkL(TInt aTarget, 
   503 		                         TInt aDuration, 
   580 		                         TInt aDuration, 
   504 		                         TInt aOnDuration, 
   581 		                         TInt aOnDuration, 
   505 		                         TInt aOffDuration, 
   582 		                         TInt aOffDuration, 
   506 		                         TInt aIntensity) = 0;
   583 		                         TInt aIntensity);
   507 
   584 
   508    	    /**
   585    	    /**
   509 	    * The LightOffL method switches the device light off for the specified target for
   586 	    * The LightOffL method switches the device light off for the specified target for
   510 	    * infinite duration. Lights will be switched off with fade-out. 
   587 	    * infinite duration. Lights will be switched off with fade-out. 
   511         *
   588         *
   523         * @leave KErrNoMemory There is a memory allocation failure. 
   600         * @leave KErrNoMemory There is a memory allocation failure. 
   524         * @leave KErrGeneral There is a hardware error.
   601         * @leave KErrGeneral There is a hardware error.
   525 		*
   602 		*
   526 	 	* @see TLightTarget
   603 	 	* @see TLightTarget
   527 		*/
   604 		*/
   528 		virtual void LightOffL(TInt aTarget) = 0;
   605 		virtual void LightOffL(TInt aTarget);
   529 
   606 
   530    	    /**
   607    	    /**
   531 	    * The LightOffL method switches the device light off for the specified target for
   608 	    * The LightOffL method switches the device light off for the specified target for
   532 	    * the specified duration time. Lights will be switched off with fade-out.
   609 	    * the specified duration time. Lights will be switched off with fade-out.
   533         *
   610         *
   555         * @leave KErrGeneral There is a hardware error.
   632         * @leave KErrGeneral There is a hardware error.
   556 		*
   633 		*
   557 	 	* @see TLightTarget
   634 	 	* @see TLightTarget
   558 		*/
   635 		*/
   559 		virtual void LightOffL(TInt aTarget, 
   636 		virtual void LightOffL(TInt aTarget, 
   560 		                       TInt aDuration) = 0;
   637 		                       TInt aDuration);
   561 
   638 
   562    	    /**
   639    	    /**
   563 	    * The LightOffL method switches the device light off for the specified target for
   640 	    * The LightOffL method switches the device light off for the specified target for
   564 	    * the specified duration time. Lights fade-out can also be controlled.
   641 	    * the specified duration time. Lights fade-out can also be controlled.
   565 		*
   642 		*
   589 		*
   666 		*
   590 	 	* @see TLightTarget
   667 	 	* @see TLightTarget
   591 		*/
   668 		*/
   592 		virtual void LightOffL(TInt aTarget, 
   669 		virtual void LightOffL(TInt aTarget, 
   593 		                       TInt aDuration, 
   670 		                       TInt aDuration, 
   594 		                       TBool aFadeOut) = 0;
   671 		                       TBool aFadeOut);
   595 		                       
   672 		                       
   596         /**
   673         /**
   597         * This method retrieves the current light status. 
   674         * This method retrieves the current light status. 
   598         *
   675         *
   599 		* @param aTarget Defines which light status is returned. 
   676 		* @param aTarget Defines which light status is returned. 
   603         *         multiple targets were specified, CHWRMLight::ELightStatusUnknown is returned.
   680         *         multiple targets were specified, CHWRMLight::ELightStatusUnknown is returned.
   604         * 
   681         * 
   605         * @see MHWRMLightObserver
   682         * @see MHWRMLightObserver
   606 	 	* @see TLightTarget
   683 	 	* @see TLightTarget
   607         */
   684         */
   608         virtual TLightStatus LightStatus(TInt aTarget) const = 0;
   685         virtual TLightStatus LightStatus(TInt aTarget) const;
   609         
   686         
   610         /**
   687         /**
   611         * This method retrieves the supported light targets of the device.
   688         * This method retrieves the supported light targets of the device.
   612         * Any attempt to use or reserve unsupported targets will fail with
   689         * Any attempt to use or reserve unsupported targets will fail with
   613         * KErrNotSupported.
   690         * KErrNotSupported.
   614         *
   691         *
   615         * @return Bitmask containing supported light targets.
   692         * @return Bitmask containing supported light targets.
   616         *
   693         *
   617         * @see TLightTarget
   694         * @see TLightTarget
   618         */
   695         */
   619         virtual TInt SupportedTargets() const = 0;
   696         virtual TInt SupportedTargets() const;
       
   697 
       
   698         
       
   699         /*
       
   700         *   Used for setting color of Light Target(s).
       
   701         *
       
   702         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   703         *                be specified with using bitwise-or.
       
   704         *
       
   705         * @param aRGB RGB Values to be set for the target(s).
       
   706         *
       
   707         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   708         * @leave KErrBadHandle Light session has been invalidated.
       
   709         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   710         * @leave KErrInUse One or more of specified targets are not reserved for
       
   711         *                  this client but are reserved for others.
       
   712         * @leave KErrNoMemory There is a memory allocation failure. 
       
   713 
       
   714         * @see THWRMLightColor
       
   715         */
       
   716         IMPORT_C void SetLightColorL(TInt aTarget, THWRMLightColor& aRGB);
       
   717         
       
   718         /*
       
   719         *   Used for setting default color of Light Target(s).
       
   720         *
       
   721         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   722         *                be specified with using bitwise-or.
       
   723         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   724         * @leave KErrBadHandle Light session has been invalidated.
       
   725         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   726         * @leave KErrInUse One or more of specified targets are not reserved for
       
   727         *                  this client but are reserved for others.
       
   728         * @leave KErrNoMemory There is a memory allocation failure. 
       
   729 
       
   730         */
       
   731         
       
   732         IMPORT_C void SetLightDefaultColorL(TInt aTarget);
       
   733 
       
   734         /** 
       
   735         * The LightOnL method switches the specified target light on
       
   736         * for the specified duration and specified color.
       
   737         * 
       
   738         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   739         *                be specified with using bitwise-or.
       
   740         * @param aDuration Duration of the time the light is switched on measured in milliseconds.
       
   741         *                  After the duration expires, the light state for target will be changed 
       
   742         *                  to whatever state was caused by the last infinite time duration call, or
       
   743         *                  default state determined by inactivity timer, in case there has not 
       
   744         *                  been a previous infinite time duration call in this session.
       
   745         *                  If the aDuration time is KHWRMInfiniteDuration then it means 
       
   746         *                  an infinite value that has to be stopped by calling of any of 
       
   747         *                  the other light control methods.
       
   748         *                  Duration can have maximum value of KHWRMLightMaxDuration.
       
   749         * @param aRGBParam RGB Values to be set for the target(s).
       
   750         *
       
   751         * @leave KErrArgument One of the parameters is out of range.
       
   752         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   753         * @leave KErrBadHandle Light session has been invalidated.
       
   754         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   755         * @leave KErrInUse One or more of specified targets are not reserved for
       
   756         *                  this client but are reserved for others.
       
   757         * @leave KErrNoMemory There is a memory allocation failure. 
       
   758         * @leave KErrGeneral There is a hardware error.
       
   759         *
       
   760         * @see TLightTarget
       
   761         * @see THWRMLightColor
       
   762         */
       
   763         IMPORT_C void LightOnL(TInt aTarget, TInt aDuration, const THWRMLightColor& aRGBParam);
       
   764 
       
   765         /** 
       
   766         * The LightOnL method switches the specified target light on
       
   767         * for the specified duration using specified intensity and color. Fade-in can also be controlled.
       
   768         * 
       
   769         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   770         *                be specified with using bitwise-or.
       
   771         * @param aDuration Duration of the time the light is switched on measured in milliseconds.
       
   772         *                  After the duration expires, the light state for target will be changed 
       
   773         *                  to whatever state was caused by the last infinite time duration call, or
       
   774         *                  default state determined by inactivity timer, in case there has not 
       
   775         *                  been a previous infinite time duration call in this session.
       
   776         *                  If the aDuration time is KHWRMInfiniteDuration then it means 
       
   777         *                  an infinite value that has to be stopped by calling of any of 
       
   778         *                  the other light control methods.
       
   779         *                  Duration can have maximum value of KHWRMLightMaxDuration.
       
   780         * @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
       
   781         *                   intensity will be used. 
       
   782         *                   Note: All devices might not support user defined intensity, in which case
       
   783         *                   device will behave in its default fashion.
       
   784         * @param aFadeIn If ETrue, lights will not turn on instantly but instead smoothly fade-in.
       
   785         *                Note: All devices will not support fade-in, in which case device will
       
   786         *                behave in its default fashion.
       
   787         * @param aRGBParam RGB Values to be set for the target(s).
       
   788         *
       
   789         * @leave KErrArgument One of the parameters is out of range.
       
   790         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   791         * @leave KErrBadHandle Light session has been invalidated.
       
   792         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   793         * @leave KErrInUse One or more of specified targets are not reserved for
       
   794         *                  this client but are reserved for others.
       
   795         * @leave KErrNoMemory There is a memory allocation failure. 
       
   796         * @leave KErrGeneral There is a hardware error.
       
   797         *
       
   798         * @see TLightTarget
       
   799         * @see THWRMLightColor
       
   800         */
       
   801 
       
   802         IMPORT_C void LightOnL(TInt aTarget, TInt aDuration, TInt aIntensity, TBool aFadeIn, 
       
   803                       const  THWRMLightColor& aRGBParam);
       
   804 
       
   805         /** 
       
   806         * The LightBlinkL method blinks the target light(s) of the device for specified duration and color
       
   807         * using default intensity.
       
   808         *
       
   809         *
       
   810         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   811         *                be specified with using bitwise-or.
       
   812         * @param aDuration Duration of the time the light is set to blink measured in milliseconds.
       
   813         *                  After the duration expires, the light state for target will be changed 
       
   814         *                  to whatever state was caused by the last infinite time duration call, or
       
   815         *                  default state determined by inactivity timer, in case there has not 
       
   816         *                  been a previous infinite time duration call in this session.
       
   817         *                  If the aTotalDuration time is KHWRMInfiniteDuration then it
       
   818         *                  means an infinite value that has to be
       
   819         *                  stopped by calling of any of the other light control methods.
       
   820         *                  Duration can have maximum value of KHWRMLightMaxDuration.
       
   821         *
       
   822         * @param aRGBParam RGB Values to be set for the target(s).
       
   823         *
       
   824         * @leave KErrArgument Parameter aDuration is out of range.
       
   825         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   826         * @leave KErrBadHandle Light session has been invalidated.
       
   827         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   828         * @leave KErrInUse One or more of specified targets are not reserved for
       
   829         *                  this client but are reserved for others.
       
   830         * @leave KErrNoMemory There is a memory allocation failure. 
       
   831         * @leave KErrGeneral There is a hardware error.
       
   832         *
       
   833         * @see TLightTarget
       
   834         * @see THWRMLightColor
       
   835         */
       
   836 
       
   837         IMPORT_C void LightBlinkL(TInt aTarget, TInt aDuration, const THWRMLightColor& aRGBParam);
       
   838 
       
   839         /** 
       
   840         * The LightBlinkL method blinks the target light(s) of the device for specified duration
       
   841         * using specified intensity and color. On- and Off-cycle times of the blinking can also be controlled.
       
   842         *
       
   843         * @param aTarget Defines which light should be controlled. Multiple lights can
       
   844         *                be specified with using bitwise-or.
       
   845         * @param aDuration Duration of the time the light is set to blink measured in milliseconds.
       
   846         *                  After the duration expires, the light state for target will be changed 
       
   847         *                  to whatever state was caused by the last infinite time duration call, or
       
   848         *                  default state determined by inactivity timer, in case there has not 
       
   849         *                  been a previous infinite time duration call in this session.
       
   850         *                  If the aTotalDuration time is KHWRMInfiniteDuration then it
       
   851         *                  means an infinite value that has to be
       
   852         *                  stopped by calling of any of the other light control methods.
       
   853         *                  Duration can have maximum value of KHWRMLightMaxDuration.
       
   854         * @param aOnDuration Duration time, measured in milliseconds, of how long the Light is
       
   855         *                    switched on in every Blink cycle.
       
   856         *                    Duration can have maximum value of KHWRMLightMaxDuration.
       
   857         *                    For device default cycle duration, use value KHWRMDefaultCycleTime.
       
   858         *                    If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
       
   859         *                    both must be KHWRMDefaultCycleTime.
       
   860         *                    Some devices might not support variable blink cycle times, in which
       
   861         *                    case default value will be substituted.
       
   862         * @param aOffDuration Duration time, measured in milliseconds, of how long the Light
       
   863         *                     is switched off in every Blink cycle.
       
   864         *                     Duration can have maximum value of KHWRMLightMaxDuration.
       
   865         *                     For device default cycle duration, use value KHWRMDefaultCycleTime.
       
   866         *                     If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
       
   867         *                     both must be KHWRMDefaultCycleTime.
       
   868         *                     Some devices might not support variable blink cycle times, in which
       
   869         *                     case default value will be substituted.
       
   870         * @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
       
   871         *                   intensity will be used.
       
   872         *                   Note: All devices might not support user defined intensity, in which case
       
   873         *                   device will behave in its default fashion.
       
   874         *
       
   875         * @param aRGBParam RGB Values to be set for the target(s).
       
   876         *
       
   877         * @leave KErrArgument One of the parameters is out of range or otherwise invalid.
       
   878         * @leave KErrNotSupported One or more of specified targets are not supported.
       
   879         * @leave KErrBadHandle Light session has been invalidated.
       
   880         * @leave KErrTimedOut Timeout occurred in controlling light.
       
   881         * @leave KErrInUse One or more of specified targets are not reserved for
       
   882         *                  this client but are reserved for others.
       
   883         * @leave KErrNoMemory There is a memory allocation failure. 
       
   884         * @leave KErrGeneral There is a hardware error.
       
   885         *
       
   886         * @see TLightTarget
       
   887         * @see THWRMLightColor
       
   888         */
       
   889         
       
   890         IMPORT_C void LightBlinkL(TInt aTarget, TInt aDuration, TInt aOnDuration, TInt aOffDuration, 
       
   891                          TInt aIntensity, const THWRMLightColor& aRGBParam);
       
   892 
       
   893 
       
   894 
       
   895         
       
   896 private:
       
   897 		CHWRMLight();
       
   898 		void ConstructL(MHWRMLightObserver* aCallback);        
       
   899         
       
   900 private:
       
   901         CHWRMEnhancedLight* iEnhanced;
       
   902 
   620     };
   903     };
   621     
   904     
   622 /**
   905 /**
   623 * A callback interface for light status reporting.
   906 * A callback interface for light status reporting.
   624 *
   907 *
   628 * 
   911 * 
   629 * A callback object header example:
   912 * A callback object header example:
   630 *
   913 *
   631 * @code 
   914 * @code 
   632 * // INCLUDES
   915 * // INCLUDES
   633 * #include <HWRMLight.h> // Link against HWRMLightClient.lib.
   916 * #include <hwrmlight.h> // Link against HWRMLightClient.lib.
   634 *
   917 *
   635 * class CTests : public CBase,
   918 * class CTests : public CBase,
   636 *                public MHWRMLightObserver
   919 *                public MHWRMLightObserver
   637 *     {
   920 *     {
   638 *     public:
   921 *     public:
   679 *         }
   962 *         }
   680 *     }
   963 *     }
   681 *
   964 *
   682 * @endcode
   965 * @endcode
   683 *
   966 *
   684 * @since S60 3.0
   967 * @publishedAll
       
   968 * @released
   685 */
   969 */
   686 class MHWRMLightObserver
   970 class MHWRMLightObserver
   687     {    
   971     {    
   688     public:
   972     public:
   689         
   973