epoc32/include/hwrmlight.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@4
     2
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@4
    14
* Description:
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@4
    19
williamr@4
    20
williamr@2
    21
#ifndef HWRMLIGHT_H
williamr@2
    22
#define HWRMLIGHT_H
williamr@2
    23
williamr@2
    24
// INCLUDES
williamr@2
    25
#include <e32base.h>
williamr@2
    26
williamr@2
    27
// CONSTANTS
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
* Minimum allowed intensity setting for Light.
williamr@4
    31
*
williamr@4
    32
* @publishedAll
williamr@4
    33
* @released
williamr@2
    34
*/
williamr@2
    35
const TInt KHWRMLightMinIntensity = 1;
williamr@2
    36
williamr@2
    37
/**
williamr@2
    38
* Maximum allowed intensity setting for Light.
williamr@4
    39
*
williamr@4
    40
* @publishedAll
williamr@4
    41
* @released
williamr@2
    42
*/
williamr@2
    43
const TInt KHWRMLightMaxIntensity = 100;
williamr@2
    44
williamr@2
    45
/**
williamr@2
    46
* Indicates default intensity in various methods.
williamr@4
    47
*
williamr@4
    48
* @publishedAll
williamr@4
    49
* @released
williamr@2
    50
*/
williamr@2
    51
const TInt KHWRMDefaultIntensity = 0;
williamr@2
    52
williamr@2
    53
/**
williamr@2
    54
* Maximum allowed duration value.
williamr@4
    55
*
williamr@4
    56
* @publishedAll
williamr@4
    57
* @released
williamr@2
    58
*/
williamr@2
    59
const TInt KHWRMLightMaxDuration = (KMaxTInt / 1000) - 1;
williamr@2
    60
williamr@2
    61
/**
williamr@2
    62
* Infinite duration value.
williamr@4
    63
*
williamr@4
    64
* @publishedAll
williamr@4
    65
* @released
williamr@2
    66
*/
williamr@2
    67
const TInt KHWRMInfiniteDuration = 0;
williamr@2
    68
williamr@2
    69
/**
williamr@2
    70
* Indicates device default Blink cycle time.
williamr@4
    71
*
williamr@4
    72
* @publishedAll
williamr@4
    73
* @released
williamr@2
    74
*/
williamr@2
    75
const TInt KHWRMDefaultCycleTime = 0;
williamr@2
    76
williamr@2
    77
williamr@2
    78
class MHWRMLightObserver;
williamr@4
    79
class CHWRMEnhancedLight;
williamr@2
    80
williamr@4
    81
/**  
williamr@4
    82
* RGB values.
williamr@4
    83
*
williamr@4
    84
* @publishedAll
williamr@4
    85
*/
williamr@4
    86
williamr@4
    87
struct THWRMLightColor
williamr@4
    88
{
williamr@4
    89
    TUint8 iRed;
williamr@4
    90
    TUint8 iGreen;
williamr@4
    91
    TUint8 iBlue;
williamr@4
    92
};
williamr@4
    93
williamr@2
    94
williamr@2
    95
/**
williamr@2
    96
* The class used to control the device lights.
williamr@2
    97
*
williamr@2
    98
* The HW Resource Manager Light API is a library API providing the ability 
williamr@2
    99
* to control the various light targets of the device. The API provides also
williamr@2
   100
* methods to retrieve the current light status and the supported light targets
williamr@2
   101
* of the device. The API is meant for all applications which need to control 
williamr@2
   102
* lights of the device.
williamr@2
   103
*
williamr@2
   104
* Type of the HW Resource Manager Light API is a synchronous method call meaning 
williamr@2
   105
* the method call will block the client application. Every new call of the light
williamr@2
   106
* API method stops all ongoing light control orders. Light state after duration
williamr@2
   107
* based orders expire is the state specified by the last non-duration based order. 
williamr@2
   108
*
williamr@2
   109
* The API consist of the classes CHWRMLight and MHWRMLightObserver. If the client
williamr@2
   110
* requires up-to-date status information, it should also provide callback pointer
williamr@2
   111
* of the MHWRMLightObserver implementing class for the NewL-method.
williamr@2
   112
*
williamr@2
   113
* Usage:
williamr@2
   114
*
williamr@2
   115
* @code
williamr@4
   116
* #include <hwrmlight.h> 
williamr@2
   117
*
williamr@2
   118
* // A CHWRMLight instance can be created by using NewL() or NewLC() methods. 
williamr@2
   119
* // Up-to-date status information not required, no callbacks.
williamr@2
   120
* CHWRMLight* light = CHWRMLight::NewL();
williamr@2
   121
*
williamr@2
   122
* // After this, lights can be directly controlled via the provided class methods. 
williamr@2
   123
* light-> LightOnL (EPrimaryDisplay, 5000); // Turn display lights on for five seconds.
williamr@2
   124
* light->LightOffL(EPrimaryDisplay); // Turn display lights off indefinitely.
williamr@2
   125
*
williamr@2
   126
* // To clean up, delete the created object:
williamr@2
   127
* delete light;
williamr@2
   128
* @endcode
williamr@2
   129
*
williamr@4
   130
* @publishedAll
williamr@4
   131
* @released
williamr@2
   132
*/
williamr@2
   133
class CHWRMLight : public CBase
williamr@2
   134
    {
williamr@2
   135
    public:
williamr@2
   136
williamr@2
   137
		/**
williamr@2
   138
		* Possible light states that can be get for the different light targets
williamr@2
   139
		*/
williamr@2
   140
		enum TLightStatus
williamr@2
   141
			{
williamr@4
   142
			/**
williamr@4
   143
			For debugging/development and signaling an error conditions.
williamr@4
   144
			*/
williamr@4
   145
			ELightStatusUnknown = 0,
williamr@4
   146
			/**
williamr@4
   147
			Light state switch to light on.
williamr@4
   148
			*/
williamr@4
   149
			ELightOn,              
williamr@4
   150
			/**
williamr@4
   151
			Light state switch to light off.
williamr@4
   152
			*/
williamr@4
   153
			ELightOff,             
williamr@4
   154
			/**
williamr@4
   155
			Light state switch to light blinking.
williamr@4
   156
			*/
williamr@4
   157
			ELightBlink            
williamr@2
   158
			};
williamr@2
   159
williamr@2
   160
        /**
williamr@2
   161
        * Possible light targets. 
williamr@2
   162
        * Targets can be used as bitmask. Some common masks are provided as enum.
williamr@2
   163
        * 
williamr@2
   164
        * Note that all targets are not supported by all devices.
williamr@2
   165
        * Attempting to use unsupported target will result in
williamr@2
   166
        * KErrNotSupported.
williamr@2
   167
        *
williamr@2
   168
        * At least one target must be defined.
williamr@2
   169
        */
williamr@2
   170
        enum TLightTarget
williamr@2
   171
            {
williamr@4
   172
            /**
williamr@4
   173
            No target. Not a valid target value, used only for error checking.
williamr@4
   174
            */
williamr@4
   175
            ENoTarget                    = 0x0,    
williamr@4
   176
            /**
williamr@4
   177
            Primary display of the device.
williamr@4
   178
            */            
williamr@4
   179
            EPrimaryDisplay              = 0x1,     
williamr@4
   180
            /**
williamr@4
   181
            Primary keyboard of the device. 
williamr@4
   182
            */
williamr@4
   183
            EPrimaryKeyboard             = 0x2,     
williamr@4
   184
            /**
williamr@4
   185
            Both primary display and the primary keyboard of the device.  
williamr@4
   186
            */
williamr@4
   187
            EPrimaryDisplayAndKeyboard   = 0x3,                
williamr@4
   188
            /**
williamr@4
   189
            Secondary display of the device.
williamr@4
   190
            */
williamr@4
   191
            ESecondaryDisplay            = 0x4,     
williamr@4
   192
            /**
williamr@4
   193
            Secondary keyboard of the device. 
williamr@4
   194
            */
williamr@4
   195
            ESecondaryKeyboard           = 0x8,     
williamr@4
   196
            /**
williamr@4
   197
            Both secondary display and the secondary keyboard of the device.  
williamr@4
   198
            */
williamr@4
   199
            ESecondaryDisplayAndKeyboard = 0xC,          
williamr@4
   200
            /**
williamr@4
   201
            Device specific custom target 1.
williamr@4
   202
            */
williamr@4
   203
            ECustomTarget1               = 0x10, 
williamr@4
   204
            /**
williamr@4
   205
            Device specific custom target 2.
williamr@4
   206
            */
williamr@4
   207
            ECustomTarget2               = 0x20, 
williamr@4
   208
            /**
williamr@4
   209
            Device specific custom target 3.
williamr@4
   210
            */
williamr@4
   211
            ECustomTarget3               = 0x40, 
williamr@4
   212
            /**
williamr@4
   213
            Device specific custom target 4.
williamr@4
   214
            */
williamr@4
   215
            ECustomTarget4               = 0x80,             
williamr@2
   216
            /**
williamr@2
   217
            * Special target used to control all currently available system lights.
williamr@2
   218
            *
williamr@2
   219
            * System lights normally include all displays and keyboards, 
williamr@2
   220
            * but not custom lights. This is however device dependent.
williamr@2
   221
            *
williamr@2
   222
            * A target mask including this target is 
williamr@2
   223
            * always changed to a device state specific target mask. 
williamr@2
   224
            * Note that the  system target with any other target is not supported. 
williamr@2
   225
            *
williamr@2
   226
            * This target is always supported but it is never
williamr@2
   227
            * included in supported targets mask.
williamr@2
   228
            *
williamr@2
   229
            * @see CHWRMLight::SupportedTargets()
williamr@2
   230
            */
williamr@2
   231
            ESystemTarget                = 0x80000000  
williamr@2
   232
            };
williamr@2
   233
            
williamr@2
   234
    public:  // Constructors
williamr@2
   235
        
williamr@2
   236
        /**
williamr@2
   237
        * Two-phased constructor.
williamr@2
   238
        *
williamr@2
   239
        * @return A pointer to a new instance of the CHWRMLight class.
williamr@2
   240
        *
williamr@2
   241
        * @leave KErrNotSupported Device doesn't support Light feature.
williamr@2
   242
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   243
        */
williamr@2
   244
        IMPORT_C static CHWRMLight* NewL();
williamr@2
   245
        
williamr@2
   246
        /**
williamr@2
   247
        * Two-phased constructor. 
williamr@2
   248
        * Leaves instance to cleanup stack.
williamr@2
   249
        *
williamr@2
   250
        * @return A pointer to a new instance of the CHWRMLight class.
williamr@2
   251
        *
williamr@2
   252
        * @leave KErrNotSupported Device doesn't support Light feature.
williamr@2
   253
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   254
        */
williamr@2
   255
        IMPORT_C static CHWRMLight* NewLC();
williamr@2
   256
williamr@2
   257
        /**
williamr@2
   258
        * Two-phased constructor.
williamr@2
   259
        * Use this method for creating a Light client with callbacks.
williamr@2
   260
        *
williamr@2
   261
        * @param aCallback Pointer to the callback instance.
williamr@2
   262
        * @return A pointer to a new instance of the CHWRMLight class.
williamr@2
   263
        *
williamr@2
   264
        * @leave KErrNotSupported Device doesn't support Light feature.
williamr@2
   265
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   266
        */
williamr@2
   267
        IMPORT_C static CHWRMLight* NewL(MHWRMLightObserver* aCallback);
williamr@2
   268
        
williamr@2
   269
        /**
williamr@2
   270
        * Two-phased constructor. 
williamr@2
   271
        * Use this method for creating a Light client with callbacks.
williamr@2
   272
        * Leaves instance to cleanup stack.
williamr@2
   273
        *
williamr@2
   274
        * @param aCallback Pointer to the callback instance
williamr@2
   275
        * @return A pointer to a new instance of the CHWRMLight class.
williamr@2
   276
        *
williamr@2
   277
        * @leave KErrNotSupported Device doesn't support Light feature.
williamr@2
   278
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   279
        */
williamr@2
   280
        IMPORT_C static CHWRMLight* NewLC(MHWRMLightObserver* aCallback);
williamr@2
   281
williamr@4
   282
		
williamr@4
   283
		/**
williamr@4
   284
		* Destructor
williamr@4
   285
		*/
williamr@4
   286
		IMPORT_C ~CHWRMLight();
williamr@4
   287
		
williamr@2
   288
    public: // New functions
williamr@2
   289
williamr@2
   290
    	
williamr@2
   291
    	/**
williamr@2
   292
    	* Reserves light target exclusively for this client.
williamr@2
   293
    	* A higher priority client may cause lower priority client reservation
williamr@2
   294
    	* to be temporarily suspended. Commands can still be issued in suspended 
williamr@2
   295
    	* state, but they will not be acted upon unless suspension is lifted
williamr@2
   296
    	* within specified duration.
williamr@2
   297
    	* The suspended client will not get any notification about suspension.
williamr@2
   298
    	* If light target is already reserved by a higher or equal priority application, 
williamr@2
   299
    	* reserving will still succeeds, but reservation is immediately suspended.
williamr@2
   300
    	*
williamr@2
   301
    	* Calling this method is equal to calling ReserveLightL( aTarget, EFalse, EFalse),
williamr@2
   302
    	* i.e. any previously frozen state will not be restored and CCoeEnv
williamr@2
   303
    	* background/foreground status is always used to control further reservations.
williamr@2
   304
    	*
williamr@2
   305
		* @param aTarget Defines which light should be reserved. Multiple lights can
williamr@2
   306
		*                be specified with using bitwise-or.
williamr@2
   307
    	*
williamr@2
   308
    	* @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   309
    	* @leave KErrAccessDenied No CCoeEnv present.
williamr@2
   310
    	* @leave KErrNotReady Trying to reserve while on background.
williamr@2
   311
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   312
		*
williamr@2
   313
	 	* @see TLightTarget
williamr@2
   314
    	*/
williamr@4
   315
    	virtual void ReserveLightL(TInt aTarget);
williamr@2
   316
    	
williamr@2
   317
    	/**
williamr@2
   318
    	* Reserves light target exclusively for this client.
williamr@2
   319
    	* A higher priority client may cause lower priority client reservation
williamr@2
   320
    	* to be temporarily suspended. Commands can still be issued in suspended 
williamr@2
   321
    	* state, but they will not be acted upon unless suspension is lifted
williamr@2
   322
    	* within specified duration.
williamr@2
   323
    	* The suspended client will not get any notification about suspension.
williamr@2
   324
    	* If light target is already reserved by a higher or equal priority application, 
williamr@2
   325
    	* reserving will still succeeds, but reservation is immediately suspended.
williamr@2
   326
    	*
williamr@2
   327
    	*
williamr@2
   328
		* @param aTarget Defines which light should be reserved. Multiple lights can
williamr@2
   329
		*                be specified with using bitwise-or.
williamr@2
   330
    	* @param aRestoreState If ETrue, the state frozen on last release will be
williamr@2
   331
    	*                      restored upon successful reservation.
williamr@2
   332
    	*                      I.e. if light was blinking when it was released by this
williamr@2
   333
        *                      client the last time, it would start blinking again upon
williamr@2
   334
        *                      successful reservation.
williamr@2
   335
    	*                      For the first reservation of each session this parameter 
williamr@2
   336
        *                      is always considered EFalse regardless of what is supplied,
williamr@2
   337
        *                      as there is no previous frozen state to restore.
williamr@2
   338
    	* @param aForceNoCCoeEnv If EFalse, then reservation requires that this client is
williamr@2
   339
        *                        on the foreground at the time of reservation and light
williamr@2
   340
        *                        target will be automatically released and re-reserved based
williamr@2
   341
        *                        on background/foreground status of the this client. This 
williamr@2
   342
        *                        also implies that CCoeEnv::Static() != NULL is required.
williamr@2
   343
    	*                        If ETrue, the client will not require CCoeEnv to be present
williamr@2
   344
        *                        nor does it automatically reserve/release light by depending
williamr@2
   345
        *                        on foreground/background status of the client.
williamr@2
   346
        *                        Only trusted clients are allowed to set this flag to ETrue.
williamr@2
   347
    	*                        A client is considered trusted if it has nonstandard
williamr@2
   348
        *                        priority defined in the internal lights policy of the 
williamr@2
   349
        *                        HW Resource Manager. A client can be defined trusted
williamr@4
   350
        *                        only by a product.
williamr@2
   351
    	*
williamr@2
   352
    	* @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   353
    	* @leave KErrAccessDenied Paramenter aForceNoCCoeEnv is ETrue and client is not trusted.
williamr@2
   354
    	* @leave KErrBadHandle Parameter ForceNoCCoeEnv is EFalse and no CCoeEnv present.
williamr@2
   355
    	* @leave KErrNotReady Trying to reserve while on background and parameter 
williamr@2
   356
        *                     aForceNoCCoeEnv is EFalse.
williamr@2
   357
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   358
		*
williamr@2
   359
	 	* @see TLightTarget
williamr@2
   360
    	*/
williamr@4
   361
    	virtual void ReserveLightL(TInt aTarget, TBool aRestoreState, TBool aForceNoCCoeEnv);
williamr@2
   362
williamr@2
   363
    	/**
williamr@2
   364
    	* Releases light target if it was previously reserved for this client.
williamr@2
   365
    	* If this client has not reserved any of the specified lights, 
williamr@2
   366
    	* this method does nothing.
williamr@2
   367
    	* Any reserved light targets that are released and have no other suspended
williamr@2
   368
    	* clients will be reset to default state, which is either lights on or lights off, 
williamr@2
   369
    	* depending on system inactivity time.
williamr@2
   370
    	*
williamr@2
   371
		* @param aTarget Defines which light should be released. Multiple lights can
williamr@2
   372
		*                be specified with using bitwise-or.
williamr@2
   373
		*
williamr@2
   374
	 	* @see TLightTarget
williamr@2
   375
    	*/
williamr@4
   376
    	virtual void ReleaseLight(TInt aTarget);
williamr@2
   377
williamr@2
   378
williamr@2
   379
	    /** 
williamr@2
   380
	    * The LightOnL method switches the specified target light on
williamr@2
   381
	    * for infinite duration using default intensity. Lights will use fade-in.
williamr@2
   382
        *
williamr@2
   383
        * Calling this method is equal to calling 
williamr@2
   384
        * LightOnL(aTarget, KHWRMInfiniteDuration, KHWRMDefaultIntensity, ETrue).
williamr@2
   385
	    *
williamr@2
   386
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   387
		*                be specified with using bitwise-or.
williamr@2
   388
		*
williamr@2
   389
    	* @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   390
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   391
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   392
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   393
        *                  this client but are reserved for others.
williamr@2
   394
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   395
        * @leave KErrGeneral There is a hardware error.
williamr@2
   396
		*
williamr@2
   397
	 	* @see TLightTarget
williamr@2
   398
		*/
williamr@4
   399
		virtual void LightOnL(TInt aTarget);
williamr@2
   400
williamr@2
   401
	    /** 
williamr@2
   402
	    * The LightOnL method switches the specified target light on
williamr@2
   403
	    * for the specified duration using default intensity. Lights will use fade-in.
williamr@2
   404
        *
williamr@2
   405
        * Calling this method is equal to call 
williamr@2
   406
        * LightOnL(aTarget, aDuration, KHWRMDefaultIntensity, ETrue).
williamr@2
   407
	    *
williamr@2
   408
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   409
		*                be specified with using bitwise-or.
williamr@2
   410
		* @param aDuration Duration of the time the light is switched on measured in milliseconds.
williamr@2
   411
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   412
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   413
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   414
		*                  been a previous infinite time duration call in this session.
williamr@2
   415
		*                  If the aDuration time is KHWRMInfiniteDuration then it means an 
williamr@2
   416
        *                  infinite value that has to be stopped by calling of any of the other
williamr@2
   417
        '                  light control methods.
williamr@2
   418
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   419
		*
williamr@2
   420
        * @leave KErrArgument Parameter aDuration is out of range.
williamr@2
   421
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   422
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   423
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   424
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   425
        *                  this client but are reserved for others.
williamr@2
   426
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   427
        * @leave KErrGeneral There is a hardware error.
williamr@2
   428
		*
williamr@2
   429
	 	* @see TLightTarget
williamr@2
   430
		*/
williamr@2
   431
		virtual void LightOnL(TInt aTarget, 
williamr@4
   432
		                      TInt aDuration);
williamr@2
   433
williamr@2
   434
	    /** 
williamr@2
   435
	    * The LightOnL method switches the specified target light on
williamr@2
   436
	    * for the specified duration using specified intensity. Fade-in can also be controlled.
williamr@2
   437
	    *
williamr@2
   438
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   439
		*                be specified with using bitwise-or.
williamr@2
   440
		* @param aDuration Duration of the time the light is switched on measured in milliseconds.
williamr@2
   441
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   442
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   443
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   444
		*                  been a previous infinite time duration call in this session.
williamr@2
   445
		*                  If the aDuration time is KHWRMInfiniteDuration then it means 
williamr@2
   446
        *                  an infinite value that has to be stopped by calling of any of 
williamr@2
   447
        *                  the other light control methods.
williamr@2
   448
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   449
		* @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
williamr@2
   450
		*                   intensity will be used. 
williamr@2
   451
		*                   Note: All devices might not support user defined intensity, in which case
williamr@2
   452
		*                   device will behave in its default fashion.
williamr@2
   453
		* @param aFadeIn If ETrue, lights will not turn on instantly but instead smoothly fade-in.
williamr@2
   454
		*                Note: All devices will not support fade-in, in which case device will
williamr@2
   455
		*                behave in its default fashion.
williamr@2
   456
		*
williamr@2
   457
        * @leave KErrArgument One of the parameters is out of range.
williamr@2
   458
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   459
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   460
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   461
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   462
        *                  this client but are reserved for others.
williamr@2
   463
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   464
        * @leave KErrGeneral There is a hardware error.
williamr@2
   465
		*
williamr@2
   466
	 	* @see TLightTarget
williamr@2
   467
		*/
williamr@2
   468
		virtual void LightOnL(TInt aTarget, 
williamr@2
   469
		                      TInt aDuration, 
williamr@2
   470
		                      TInt aIntensity,
williamr@4
   471
		                      TBool aFadeIn);
williamr@2
   472
williamr@2
   473
	    /** 
williamr@2
   474
	    * The LightBlinkL method blinks the target light(s) of the device for infinite duration
williamr@2
   475
	    * using default intensity.
williamr@2
   476
        *
williamr@2
   477
        * Calling this method is equal to call 
williamr@4
   478
        * @code
williamr@2
   479
        * LightBlinkL(aTarget, KHWRMInfiniteDuration, KHWRMDefaultCycleTime, 
williamr@2
   480
        *             KHWRMDefaultCycleTime, KHWRMDefaultIntensity).
williamr@4
   481
	   	* @endcode
williamr@2
   482
	   	*
williamr@2
   483
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   484
		*                be specified with using bitwise-or.
williamr@2
   485
	   	*
williamr@2
   486
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   487
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   488
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   489
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   490
        *                  this client but are reserved for others.
williamr@2
   491
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   492
        * @leave KErrGeneral There is a hardware error.
williamr@2
   493
		*
williamr@2
   494
	 	* @see TLightTarget
williamr@2
   495
		*/
williamr@4
   496
		virtual void LightBlinkL(TInt aTarget);
williamr@2
   497
williamr@2
   498
	    /** 
williamr@2
   499
	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
williamr@2
   500
	    * using default intensity.
williamr@2
   501
        *
williamr@2
   502
        * Calling this method is equal to calling
williamr@2
   503
        * LightBlinkL(aTarget, aDuration, KHWRMDefaultCycleTime, 
williamr@2
   504
        *             KHWRMDefaultCycleTime, KHWRMDefaultIntensity).
williamr@2
   505
	   	*
williamr@2
   506
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   507
		*                be specified with using bitwise-or.
williamr@2
   508
		* @param aDuration Duration of the time the light is set to blink measured in milliseconds.
williamr@2
   509
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   510
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   511
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   512
		*                  been a previous infinite time duration call in this session.
williamr@2
   513
		*                  If the aTotalDuration time is KHWRMInfiniteDuration then it
williamr@2
   514
		*                  means an infinite value that has to be
williamr@2
   515
		*                  stopped by calling of any of the other light control methods.
williamr@2
   516
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   517
	   	*
williamr@2
   518
        * @leave KErrArgument Parameter aDuration is out of range.
williamr@2
   519
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   520
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   521
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   522
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   523
        *                  this client but are reserved for others.
williamr@2
   524
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   525
        * @leave KErrGeneral There is a hardware error.
williamr@2
   526
		*
williamr@2
   527
	 	* @see TLightTarget
williamr@2
   528
		*/
williamr@2
   529
		virtual void LightBlinkL(TInt aTarget, 
williamr@4
   530
		                         TInt aDuration);
williamr@2
   531
williamr@2
   532
	    /** 
williamr@2
   533
	    * The LightBlinkL method blinks the target light(s) of the device for specified duration
williamr@2
   534
	    * using specified intensity. On- and Off-cycle times of the blinking can also be controlled.
williamr@2
   535
	   	*
williamr@2
   536
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   537
		*                be specified with using bitwise-or.
williamr@2
   538
		* @param aDuration Duration of the time the light is set to blink measured in milliseconds.
williamr@2
   539
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   540
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   541
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   542
		*                  been a previous infinite time duration call in this session.
williamr@2
   543
		*                  If the aTotalDuration time is KHWRMInfiniteDuration then it
williamr@2
   544
		*                  means an infinite value that has to be
williamr@2
   545
		*                  stopped by calling of any of the other light control methods.
williamr@2
   546
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   547
	   	* @param aOnDuration Duration time, measured in milliseconds, of how long the Light is
williamr@2
   548
	   	*                    switched on in every Blink cycle.
williamr@2
   549
		*                    Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   550
		*                    For device default cycle duration, use value KHWRMDefaultCycleTime.
williamr@2
   551
		*                    If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
williamr@2
   552
		*                    both must be KHWRMDefaultCycleTime.
williamr@2
   553
		*                    Some devices might not support variable blink cycle times, in which
williamr@2
   554
		*                    case default value will be substituted.
williamr@2
   555
	   	* @param aOffDuration Duration time, measured in milliseconds, of how long the Light
williamr@2
   556
	   	*                     is switched off in every Blink cycle.
williamr@2
   557
		*                     Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   558
        *                     For device default cycle duration, use value KHWRMDefaultCycleTime.
williamr@2
   559
        *                     If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
williamr@2
   560
		*                     both must be KHWRMDefaultCycleTime.
williamr@2
   561
		*                     Some devices might not support variable blink cycle times, in which
williamr@2
   562
		*                     case default value will be substituted.
williamr@2
   563
		* @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
williamr@2
   564
		*                   intensity will be used.
williamr@2
   565
		*                   Note: All devices might not support user defined intensity, in which case
williamr@2
   566
		*                   device will behave in its default fashion.
williamr@2
   567
	   	*
williamr@2
   568
        * @leave KErrArgument One of the parameters is out of range or otherwise invalid.
williamr@2
   569
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   570
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   571
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   572
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   573
        *                  this client but are reserved for others.
williamr@2
   574
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   575
        * @leave KErrGeneral There is a hardware error.
williamr@2
   576
		*
williamr@2
   577
	 	* @see TLightTarget
williamr@2
   578
		*/
williamr@2
   579
		virtual void LightBlinkL(TInt aTarget, 
williamr@2
   580
		                         TInt aDuration, 
williamr@2
   581
		                         TInt aOnDuration, 
williamr@2
   582
		                         TInt aOffDuration, 
williamr@4
   583
		                         TInt aIntensity);
williamr@2
   584
williamr@2
   585
   	    /**
williamr@2
   586
	    * The LightOffL method switches the device light off for the specified target for
williamr@2
   587
	    * infinite duration. Lights will be switched off with fade-out. 
williamr@2
   588
        *
williamr@2
   589
        * Calling this method is equal to call 
williamr@2
   590
        * LightOffL(aTarget, KHWRMInfiniteDuration, ETrue).
williamr@2
   591
		*
williamr@2
   592
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   593
		*                be specified with using bitwise-or.
williamr@2
   594
		*
williamr@2
   595
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   596
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   597
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   598
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   599
        *                  this client but are reserved for others.
williamr@2
   600
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   601
        * @leave KErrGeneral There is a hardware error.
williamr@2
   602
		*
williamr@2
   603
	 	* @see TLightTarget
williamr@2
   604
		*/
williamr@4
   605
		virtual void LightOffL(TInt aTarget);
williamr@2
   606
williamr@2
   607
   	    /**
williamr@2
   608
	    * The LightOffL method switches the device light off for the specified target for
williamr@2
   609
	    * the specified duration time. Lights will be switched off with fade-out.
williamr@2
   610
        *
williamr@2
   611
        * Calling this method is equal to call LightOffL(aTarget, aDuration, ETrue).
williamr@2
   612
		*
williamr@2
   613
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   614
		*                be specified with using bitwise-or.
williamr@2
   615
		* @param aDuration Duration of the time the light is switched off measured in milliseconds.
williamr@2
   616
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   617
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   618
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   619
		*                  been a previous infinite time duration call in this session.
williamr@2
   620
		*                  If the aDuration time is KHWRMInfiniteDuration then it 
williamr@2
   621
		*                  means an infinite value that has to be
williamr@2
   622
		*                  stopped by calling of any of the other light control methods.
williamr@2
   623
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   624
		*
williamr@2
   625
        * @leave KErrArgument Parameter aDuration is out of range.
williamr@2
   626
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   627
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   628
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   629
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   630
        *                  this client but are reserved for others.
williamr@2
   631
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   632
        * @leave KErrGeneral There is a hardware error.
williamr@2
   633
		*
williamr@2
   634
	 	* @see TLightTarget
williamr@2
   635
		*/
williamr@2
   636
		virtual void LightOffL(TInt aTarget, 
williamr@4
   637
		                       TInt aDuration);
williamr@2
   638
williamr@2
   639
   	    /**
williamr@2
   640
	    * The LightOffL method switches the device light off for the specified target for
williamr@2
   641
	    * the specified duration time. Lights fade-out can also be controlled.
williamr@2
   642
		*
williamr@2
   643
		* @param aTarget Defines which light should be controlled. Multiple lights can
williamr@2
   644
		*                be specified with using bitwise-or.
williamr@2
   645
		* @param aDuration Duration of the time the light is switched off measured in milliseconds.
williamr@2
   646
		*                  After the duration expires, the light state for target will be changed 
williamr@2
   647
		*                  to whatever state was caused by the last infinite time duration call, or
williamr@2
   648
		*                  default state determined by inactivity timer, in case there has not 
williamr@2
   649
		*                  been a previous infinite time duration call in this session.
williamr@2
   650
		*                  If the aDuration time is KHWRMInfiniteDuration then it 
williamr@2
   651
		*                  means an infinite value that has to be
williamr@2
   652
		*                  stopped by calling of any of the other light control methods.
williamr@2
   653
		*                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@2
   654
		* @param aFadeOut If ETrue, lights will not turn off instantly but instead smoothly fade-out
williamr@2
   655
		*                 Note: All devices will not support fade-out, in which case device will
williamr@2
   656
		*                 behave in its default fashion.
williamr@2
   657
		*
williamr@2
   658
        * @leave KErrArgument aDuration is out of range.
williamr@2
   659
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@2
   660
        * @leave KErrBadHandle Light session has been invalidated.
williamr@2
   661
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@2
   662
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@2
   663
        *                  this client but are reserved for others.
williamr@2
   664
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@2
   665
        * @leave KErrGeneral There is a hardware error.
williamr@2
   666
		*
williamr@2
   667
	 	* @see TLightTarget
williamr@2
   668
		*/
williamr@2
   669
		virtual void LightOffL(TInt aTarget, 
williamr@2
   670
		                       TInt aDuration, 
williamr@4
   671
		                       TBool aFadeOut);
williamr@2
   672
		                       
williamr@2
   673
        /**
williamr@2
   674
        * This method retrieves the current light status. 
williamr@2
   675
        *
williamr@2
   676
		* @param aTarget Defines which light status is returned. 
williamr@2
   677
		*                This method only supports single target, as different
williamr@2
   678
		*                targets might have different statuses.
williamr@2
   679
        * @return TLightStatus indicating the current light status. If there is a problem or
williamr@2
   680
        *         multiple targets were specified, CHWRMLight::ELightStatusUnknown is returned.
williamr@2
   681
        * 
williamr@2
   682
        * @see MHWRMLightObserver
williamr@2
   683
	 	* @see TLightTarget
williamr@2
   684
        */
williamr@4
   685
        virtual TLightStatus LightStatus(TInt aTarget) const;
williamr@2
   686
        
williamr@2
   687
        /**
williamr@2
   688
        * This method retrieves the supported light targets of the device.
williamr@2
   689
        * Any attempt to use or reserve unsupported targets will fail with
williamr@2
   690
        * KErrNotSupported.
williamr@2
   691
        *
williamr@2
   692
        * @return Bitmask containing supported light targets.
williamr@2
   693
        *
williamr@2
   694
        * @see TLightTarget
williamr@2
   695
        */
williamr@4
   696
        virtual TInt SupportedTargets() const;
williamr@4
   697
williamr@4
   698
        
williamr@4
   699
        /*
williamr@4
   700
        *   Used for setting color of Light Target(s).
williamr@4
   701
        *
williamr@4
   702
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   703
        *                be specified with using bitwise-or.
williamr@4
   704
        *
williamr@4
   705
        * @param aRGB RGB Values to be set for the target(s).
williamr@4
   706
        *
williamr@4
   707
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   708
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   709
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   710
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   711
        *                  this client but are reserved for others.
williamr@4
   712
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   713
williamr@4
   714
        * @see THWRMLightColor
williamr@4
   715
        */
williamr@4
   716
        IMPORT_C void SetLightColorL(TInt aTarget, THWRMLightColor& aRGB);
williamr@4
   717
        
williamr@4
   718
        /*
williamr@4
   719
        *   Used for setting default color of Light Target(s).
williamr@4
   720
        *
williamr@4
   721
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   722
        *                be specified with using bitwise-or.
williamr@4
   723
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   724
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   725
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   726
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   727
        *                  this client but are reserved for others.
williamr@4
   728
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   729
williamr@4
   730
        */
williamr@4
   731
        
williamr@4
   732
        IMPORT_C void SetLightDefaultColorL(TInt aTarget);
williamr@4
   733
williamr@4
   734
        /** 
williamr@4
   735
        * The LightOnL method switches the specified target light on
williamr@4
   736
        * for the specified duration and specified color.
williamr@4
   737
        * 
williamr@4
   738
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   739
        *                be specified with using bitwise-or.
williamr@4
   740
        * @param aDuration Duration of the time the light is switched on measured in milliseconds.
williamr@4
   741
        *                  After the duration expires, the light state for target will be changed 
williamr@4
   742
        *                  to whatever state was caused by the last infinite time duration call, or
williamr@4
   743
        *                  default state determined by inactivity timer, in case there has not 
williamr@4
   744
        *                  been a previous infinite time duration call in this session.
williamr@4
   745
        *                  If the aDuration time is KHWRMInfiniteDuration then it means 
williamr@4
   746
        *                  an infinite value that has to be stopped by calling of any of 
williamr@4
   747
        *                  the other light control methods.
williamr@4
   748
        *                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   749
        * @param aRGBParam RGB Values to be set for the target(s).
williamr@4
   750
        *
williamr@4
   751
        * @leave KErrArgument One of the parameters is out of range.
williamr@4
   752
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   753
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   754
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   755
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   756
        *                  this client but are reserved for others.
williamr@4
   757
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   758
        * @leave KErrGeneral There is a hardware error.
williamr@4
   759
        *
williamr@4
   760
        * @see TLightTarget
williamr@4
   761
        * @see THWRMLightColor
williamr@4
   762
        */
williamr@4
   763
        IMPORT_C void LightOnL(TInt aTarget, TInt aDuration, const THWRMLightColor& aRGBParam);
williamr@4
   764
williamr@4
   765
        /** 
williamr@4
   766
        * The LightOnL method switches the specified target light on
williamr@4
   767
        * for the specified duration using specified intensity and color. Fade-in can also be controlled.
williamr@4
   768
        * 
williamr@4
   769
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   770
        *                be specified with using bitwise-or.
williamr@4
   771
        * @param aDuration Duration of the time the light is switched on measured in milliseconds.
williamr@4
   772
        *                  After the duration expires, the light state for target will be changed 
williamr@4
   773
        *                  to whatever state was caused by the last infinite time duration call, or
williamr@4
   774
        *                  default state determined by inactivity timer, in case there has not 
williamr@4
   775
        *                  been a previous infinite time duration call in this session.
williamr@4
   776
        *                  If the aDuration time is KHWRMInfiniteDuration then it means 
williamr@4
   777
        *                  an infinite value that has to be stopped by calling of any of 
williamr@4
   778
        *                  the other light control methods.
williamr@4
   779
        *                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   780
        * @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
williamr@4
   781
        *                   intensity will be used. 
williamr@4
   782
        *                   Note: All devices might not support user defined intensity, in which case
williamr@4
   783
        *                   device will behave in its default fashion.
williamr@4
   784
        * @param aFadeIn If ETrue, lights will not turn on instantly but instead smoothly fade-in.
williamr@4
   785
        *                Note: All devices will not support fade-in, in which case device will
williamr@4
   786
        *                behave in its default fashion.
williamr@4
   787
        * @param aRGBParam RGB Values to be set for the target(s).
williamr@4
   788
        *
williamr@4
   789
        * @leave KErrArgument One of the parameters is out of range.
williamr@4
   790
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   791
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   792
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   793
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   794
        *                  this client but are reserved for others.
williamr@4
   795
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   796
        * @leave KErrGeneral There is a hardware error.
williamr@4
   797
        *
williamr@4
   798
        * @see TLightTarget
williamr@4
   799
        * @see THWRMLightColor
williamr@4
   800
        */
williamr@4
   801
williamr@4
   802
        IMPORT_C void LightOnL(TInt aTarget, TInt aDuration, TInt aIntensity, TBool aFadeIn, 
williamr@4
   803
                      const  THWRMLightColor& aRGBParam);
williamr@4
   804
williamr@4
   805
        /** 
williamr@4
   806
        * The LightBlinkL method blinks the target light(s) of the device for specified duration and color
williamr@4
   807
        * using default intensity.
williamr@4
   808
        *
williamr@4
   809
        *
williamr@4
   810
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   811
        *                be specified with using bitwise-or.
williamr@4
   812
        * @param aDuration Duration of the time the light is set to blink measured in milliseconds.
williamr@4
   813
        *                  After the duration expires, the light state for target will be changed 
williamr@4
   814
        *                  to whatever state was caused by the last infinite time duration call, or
williamr@4
   815
        *                  default state determined by inactivity timer, in case there has not 
williamr@4
   816
        *                  been a previous infinite time duration call in this session.
williamr@4
   817
        *                  If the aTotalDuration time is KHWRMInfiniteDuration then it
williamr@4
   818
        *                  means an infinite value that has to be
williamr@4
   819
        *                  stopped by calling of any of the other light control methods.
williamr@4
   820
        *                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   821
        *
williamr@4
   822
        * @param aRGBParam RGB Values to be set for the target(s).
williamr@4
   823
        *
williamr@4
   824
        * @leave KErrArgument Parameter aDuration is out of range.
williamr@4
   825
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   826
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   827
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   828
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   829
        *                  this client but are reserved for others.
williamr@4
   830
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   831
        * @leave KErrGeneral There is a hardware error.
williamr@4
   832
        *
williamr@4
   833
        * @see TLightTarget
williamr@4
   834
        * @see THWRMLightColor
williamr@4
   835
        */
williamr@4
   836
williamr@4
   837
        IMPORT_C void LightBlinkL(TInt aTarget, TInt aDuration, const THWRMLightColor& aRGBParam);
williamr@4
   838
williamr@4
   839
        /** 
williamr@4
   840
        * The LightBlinkL method blinks the target light(s) of the device for specified duration
williamr@4
   841
        * using specified intensity and color. On- and Off-cycle times of the blinking can also be controlled.
williamr@4
   842
        *
williamr@4
   843
        * @param aTarget Defines which light should be controlled. Multiple lights can
williamr@4
   844
        *                be specified with using bitwise-or.
williamr@4
   845
        * @param aDuration Duration of the time the light is set to blink measured in milliseconds.
williamr@4
   846
        *                  After the duration expires, the light state for target will be changed 
williamr@4
   847
        *                  to whatever state was caused by the last infinite time duration call, or
williamr@4
   848
        *                  default state determined by inactivity timer, in case there has not 
williamr@4
   849
        *                  been a previous infinite time duration call in this session.
williamr@4
   850
        *                  If the aTotalDuration time is KHWRMInfiniteDuration then it
williamr@4
   851
        *                  means an infinite value that has to be
williamr@4
   852
        *                  stopped by calling of any of the other light control methods.
williamr@4
   853
        *                  Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   854
        * @param aOnDuration Duration time, measured in milliseconds, of how long the Light is
williamr@4
   855
        *                    switched on in every Blink cycle.
williamr@4
   856
        *                    Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   857
        *                    For device default cycle duration, use value KHWRMDefaultCycleTime.
williamr@4
   858
        *                    If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
williamr@4
   859
        *                    both must be KHWRMDefaultCycleTime.
williamr@4
   860
        *                    Some devices might not support variable blink cycle times, in which
williamr@4
   861
        *                    case default value will be substituted.
williamr@4
   862
        * @param aOffDuration Duration time, measured in milliseconds, of how long the Light
williamr@4
   863
        *                     is switched off in every Blink cycle.
williamr@4
   864
        *                     Duration can have maximum value of KHWRMLightMaxDuration.
williamr@4
   865
        *                     For device default cycle duration, use value KHWRMDefaultCycleTime.
williamr@4
   866
        *                     If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime,
williamr@4
   867
        *                     both must be KHWRMDefaultCycleTime.
williamr@4
   868
        *                     Some devices might not support variable blink cycle times, in which
williamr@4
   869
        *                     case default value will be substituted.
williamr@4
   870
        * @param aIntensity Intensity of the light. If aIntensity is KHWRMDefaultIntensity, device default 
williamr@4
   871
        *                   intensity will be used.
williamr@4
   872
        *                   Note: All devices might not support user defined intensity, in which case
williamr@4
   873
        *                   device will behave in its default fashion.
williamr@4
   874
        *
williamr@4
   875
        * @param aRGBParam RGB Values to be set for the target(s).
williamr@4
   876
        *
williamr@4
   877
        * @leave KErrArgument One of the parameters is out of range or otherwise invalid.
williamr@4
   878
        * @leave KErrNotSupported One or more of specified targets are not supported.
williamr@4
   879
        * @leave KErrBadHandle Light session has been invalidated.
williamr@4
   880
        * @leave KErrTimedOut Timeout occurred in controlling light.
williamr@4
   881
        * @leave KErrInUse One or more of specified targets are not reserved for
williamr@4
   882
        *                  this client but are reserved for others.
williamr@4
   883
        * @leave KErrNoMemory There is a memory allocation failure. 
williamr@4
   884
        * @leave KErrGeneral There is a hardware error.
williamr@4
   885
        *
williamr@4
   886
        * @see TLightTarget
williamr@4
   887
        * @see THWRMLightColor
williamr@4
   888
        */
williamr@4
   889
        
williamr@4
   890
        IMPORT_C void LightBlinkL(TInt aTarget, TInt aDuration, TInt aOnDuration, TInt aOffDuration, 
williamr@4
   891
                         TInt aIntensity, const THWRMLightColor& aRGBParam);
williamr@4
   892
williamr@4
   893
williamr@4
   894
williamr@4
   895
        
williamr@4
   896
private:
williamr@4
   897
		CHWRMLight();
williamr@4
   898
		void ConstructL(MHWRMLightObserver* aCallback);        
williamr@4
   899
        
williamr@4
   900
private:
williamr@4
   901
        CHWRMEnhancedLight* iEnhanced;
williamr@4
   902
williamr@2
   903
    };
williamr@2
   904
    
williamr@2
   905
/**
williamr@2
   906
* A callback interface for light status reporting.
williamr@2
   907
*
williamr@2
   908
* If the client requires up-to-date status information, the client needs 
williamr@2
   909
* to derive a class from the MHWRMlightObserver interface and implement 
williamr@2
   910
* the LightStatusChanged() method. 
williamr@2
   911
* 
williamr@2
   912
* A callback object header example:
williamr@2
   913
*
williamr@2
   914
* @code 
williamr@2
   915
* // INCLUDES
williamr@4
   916
* #include <hwrmlight.h> // Link against HWRMLightClient.lib.
williamr@2
   917
*
williamr@2
   918
* class CTests : public CBase,
williamr@2
   919
*                public MHWRMLightObserver
williamr@2
   920
*     {
williamr@2
   921
*     public:
williamr@2
   922
*         CTests();
williamr@2
   923
*         ~CTests();
williamr@2
   924
*                           
williamr@2
   925
*         void ConstructL();
williamr@2
   926
*         static CTests* NewL();
williamr@2
   927
*                
williamr@2
   928
*         // from MHWRMLightObserver
williamr@2
   929
*         virtual void LightStatusChanged(TInt aTarget, 
williamr@2
   930
*                                         CHWRMLight::TLightStatus aStatus);
williamr@2
   931
*
williamr@2
   932
*    private:
williamr@2
   933
*         CHWRMLight* iLight;
williamr@2
   934
*    };
williamr@2
   935
*
williamr@2
   936
* @endcode
williamr@2
   937
*
williamr@2
   938
* A callback method implementation example:
williamr@2
   939
*
williamr@2
   940
* @code
williamr@2
   941
* void CTests::LightStatusChanged(TInt aTarget, 
williamr@2
   942
*                          CHWRMLight::TLightStatus aStatus)
williamr@2
   943
*     {
williamr@2
   944
*     RDebug::Print(_L("### Light state changed for target: 0x%x"), aTarget);
williamr@2
   945
*     switch ( aStatus )
williamr@2
   946
*         {
williamr@2
   947
*         case CHWRMLight::ELightOn:
williamr@2
   948
*             RDebug::Print(_L("### Light state changed: ELightOn"));
williamr@2
   949
*             break;
williamr@2
   950
*         case CHWRMLight::ELightOff:
williamr@2
   951
*             RDebug::Print(_L("### Light state changed: ELightOff"));
williamr@2
   952
*             break;
williamr@2
   953
*         case CHWRMLight::ELightBlink:
williamr@2
   954
*             RDebug::Print(_L("### Light state changed: ELightBlink"));
williamr@2
   955
*             break;
williamr@2
   956
*         case CHWRMLight::ELightStatusUnknown:
williamr@2
   957
*             RDebug::Print(_L("### Light state changed: ELightStatusUnknown"));
williamr@2
   958
*             break;
williamr@2
   959
*         default:
williamr@2
   960
*             RDebug::Print(_L("### Light state changed: UNDEFINED !"));
williamr@2
   961
*             break;
williamr@2
   962
*         }
williamr@2
   963
*     }
williamr@2
   964
*
williamr@2
   965
* @endcode
williamr@2
   966
*
williamr@4
   967
* @publishedAll
williamr@4
   968
* @released
williamr@2
   969
*/
williamr@2
   970
class MHWRMLightObserver
williamr@2
   971
    {    
williamr@2
   972
    public:
williamr@2
   973
        
williamr@2
   974
        /** 
williamr@2
   975
        * Called when the device light status changes.
williamr@2
   976
        * Note that if the light status for certain target changes
williamr@2
   977
        * very rapidly, some state transitions might be missed.
williamr@2
   978
        * It is however guaranteed that latest state is always obtained.
williamr@2
   979
        *
williamr@2
   980
        * @param aTarget Indicates target(s) the new status applies to.
williamr@2
   981
        * @param aStatus Indicates light request status.
williamr@2
   982
		*
williamr@2
   983
	 	* @see CHWRMLight::TLightTarget
williamr@2
   984
	 	* @see CHWRMLight::TLightStatus
williamr@2
   985
		*/
williamr@2
   986
        virtual void LightStatusChanged(TInt aTarget, 
williamr@2
   987
                                        CHWRMLight::TLightStatus aStatus) = 0;
williamr@2
   988
	};
williamr@2
   989
williamr@2
   990
williamr@2
   991
#endif      // HWRMLIGHT_H   
williamr@2
   992
            
williamr@2
   993
// End of File