CHWRMExtendedLight Class Reference

class CHWRMExtendedLight : public CBase

Base class of Extended Light Client API of HWRM

The HWRM Extended Light API provides the ability to control the device display light as well as the keyboard illumination.

Every new call of the extended light API method stops all ongoing light control orders. Light state after duration based orders expire is the state specified by the last non-duration based order.

The interface contains synchronous methods that will block the client application.

Inherits from

Public Member Functions
voidLightBlinkL(TInt)
voidLightBlinkL(TInt, TInt)
voidLightBlinkL(TInt, TInt, TInt, TInt, TInt)
voidLightOffL(TInt)
voidLightOffL(TInt, TInt)
voidLightOffL(TInt, TInt, TBool)
voidLightOnL(TInt)
voidLightOnL(TInt, TInt)
voidLightOnL(TInt, TInt, TInt, TBool)
TLightStatus LightStatus(TInt)
IMPORT_C CHWRMExtendedLight *NewL()
IMPORT_C CHWRMExtendedLight *NewL(MHWRMExtendedLightObserver *)
IMPORT_C CHWRMExtendedLight *NewL(TInt)
IMPORT_C CHWRMExtendedLight *NewL(MHWRMExtendedLightObserver *, TInt)
IMPORT_C CHWRMExtendedLight *NewLC()
IMPORT_C CHWRMExtendedLight *NewLC(MHWRMExtendedLightObserver *)
voidReleaseLight(TInt)
voidReserveLightL(TInt)
voidReserveLightL(TInt, TBool, TBool)
TInt SupportedTargets()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTLightStatus { ELightStatusUnknown = 0, ELightOn, ELightOff, ELightBlink }
enumTLightTarget {
ENoTarget = 0x0, EPrimaryDisplay = 0x1, EPrimaryKeyboard = 0x2, EPrimaryDisplayAndKeyboard = 0x3, ESecondaryDisplay = 0x4, ESecondaryKeyboard = 0x8, ESecondaryDisplayAndKeyboard = 0xC, ECustomTarget1 = 0x10, ECustomTarget2 = 0x20, ECustomTarget3 = 0x40, ECustomTarget4 = 0x80, ECustomTarget5 = 0x100, ECustomTarget6 = 0x200, ECustomTarget7 = 0x400, ECustomTarget8 = 0x800, ECustomTarget9 = 0x1000, ECustomTarget10 = 0x2000, ECustomTarget11 = 0x4000, ECustomTarget12 = 0x8000, ECustomTarget13 = 0x10000, ECustomTarget14 = 0x20000, ECustomTarget15 = 0x40000, ECustomTarget16 = 0x80000, ECustomTarget17 = 0x100000, ECustomTarget18 = 0x200000, ECustomTarget19 = 0x400000, ECustomTarget20 = 0x800000, ECustomTarget21 = 0x1000000, ECustomTarget22 = 0x2000000, ECustomTarget23 = 0x4000000, ECustomTarget24 = 0x8000000, ECustomTarget25 = 0x10000000, ECustomTarget26 = 0x20000000, ECustomTarget27 = 0x40000000, ESystemTarget = 0x80000000
}

Member Functions Documentation

LightBlinkL(TInt)

voidLightBlinkL(TIntaTarget)[pure virtual]

The LightBlinkL method blinks the target light(s) of the device for infinite duration using default intensity.

leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.

LightBlinkL(TInt, TInt)

voidLightBlinkL(TIntaTarget,
TIntaDuration
)[pure virtual]

The LightBlinkL method blinks the target light(s) of the device for specified duration using default intensity.

leave
KErrArgument aDuration is out of range.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is set to blink measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aTotalDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.

LightBlinkL(TInt, TInt, TInt, TInt, TInt)

voidLightBlinkL(TIntaTarget,
TIntaDuration,
TIntaOnDuration,
TIntaOffDuration,
TIntaIntensity
)[pure virtual]

The LightBlinkL method blinks the target light(s) of the device for specified duration using specified intensity. On- and Off-cycle times of the blinking can also be controlled.

leave
KErrArgument One of the parameters is out of range or otherwise invalid.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is set to blink measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aTotalDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.
TInt aOnDurationDuration time, measured in milliseconds, of how long the Light is switched on in every Blink cycle. Duration can have maximum value of KHWRMLightMaxDuration. For device default cycle duration, use value KHWRMDefaultCycleTime. If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime, both must be KHWRMDefaultCycleTime. Some devices might not support variable blink cycle times, in which case default value will be substituted.
TInt aOffDurationDuration time, measured in milliseconds, of how long the Light is switched off in every Blink cycle. Duration can have maximum value of KHWRMLightMaxDuration. For device default cycle duration, use value KHWRMDefaultCycleTime. If either of aOnDuration or aOffDuration is KHWRMDefaultCycleTime, both must be KHWRMDefaultCycleTime. Some devices might not support variable blink cycle times, in which case default value will be substituted.
TInt aIntensityIntensity of the light. If aIntensity is KHWRMDefaultIntensity, device default intensity will be used. Note: All devices might not support user defined intensity, in which case device will behave in its default fashion.

LightOffL(TInt)

voidLightOffL(TIntaTarget)[pure virtual]

The LightOffL method switches the device light off for the specified target for infinite duration. Lights will be switched off with fade-out.

leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.

LightOffL(TInt, TInt)

voidLightOffL(TIntaTarget,
TIntaDuration
)[pure virtual]

The LightOffL method switches the device light off for the specified target for the specified duration time. Lights will be switched off with fade-out.

leave
KErrArgument aDuration is out of range.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is switched off measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.

LightOffL(TInt, TInt, TBool)

voidLightOffL(TIntaTarget,
TIntaDuration,
TBoolaFadeOut
)[pure virtual]

The LightOffL method switches the device light off for the specified target for the specified duration time. Lights fade-out can also be controlled.

leave
KErrArgument aDuration is out of range.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is switched off measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.
TBool aFadeOutIf ETrue, lights will not turn off instantly but instead smoothly fade-out Note: All devices will not support fade-out, in which case device will behave in its default fashion.

LightOnL(TInt)

voidLightOnL(TIntaTarget)[pure virtual]

The LightOnL method switches the specified target light on for infinite duration using default intensity. Lights will use fade-in.

leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.

LightOnL(TInt, TInt)

voidLightOnL(TIntaTarget,
TIntaDuration
)[pure virtual]

The LightOnL method switches the specified target light on for the specified duration using default intensity. Lights will use fade-in.

leave
KErrArgument aDuration is out of range.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is switched on measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.

LightOnL(TInt, TInt, TInt, TBool)

voidLightOnL(TIntaTarget,
TIntaDuration,
TIntaIntensity,
TBoolaFadeIn
)[pure virtual]

The LightOnL method switches the specified target light on for the specified duration using specified intensity. Fade-in can also be controlled.

leave
KErrArgument One of the parameters is out of range.
leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrBadHandle if light session has been invalidated.
leave
KErrTimedOut if timeout occurred in controlling light.
leave
KErrInUse if one or more of specified targets are not reserved for this client but are reserved for others.
leave
KErrNoMemory if there is a memory allocation failure.
leave
KErrGeneral if there is a hardware error.
TLightTarget

Parameters

TInt aTargetDefines which light should be controlled. Multiple lights can be specified with using bitwise-or.
TInt aDurationDuration of the time the light is switched on measured in milliseconds. After the duration expires, the light state for target will be changed to whatever state was caused by the last infinite time duration call, or default state determined by inactivity timer, in case there has not been a previous infinite time duration call in this session. If the aDuration time is KHWRMInfiniteDuration then it means an infinite value that has to be stopped by calling of any of the other light control methods. Duration can have maximum value of KHWRMLightMaxDuration.
TInt aIntensityIntensity of the light. If aIntensity is KHWRMDefaultIntensity, device default intensity will be used. Note: All devices might not support user defined intensity, in which case device will behave in its default fashion.
TBool aFadeInIf ETrue, lights will not turn on instantly but instead smoothly fade-in. Note: All devices will not support fade-in, in which case device will behave in its default fashion.

LightStatus(TInt)

TLightStatus LightStatus(TIntaTarget)const [pure virtual]

This method retrieves the current light status.

MHWRMExtendedLightObserver TLightTarget

Parameters

TInt aTargetDefines which light status is returned. This method only supports single target, as different targets might have different statuses.

NewL()

IMPORT_C CHWRMExtendedLight *NewL()[static]

Two-phased constructor for implementation class.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

NewL(MHWRMExtendedLightObserver *)

IMPORT_C CHWRMExtendedLight *NewL(MHWRMExtendedLightObserver *aCallback)[static]

Two-phased constructor for implementation class. Use this method for creating a Light client with callbacks.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

Parameters

MHWRMExtendedLightObserver * aCallbackPointer to callback instance

NewL(TInt)

IMPORT_C CHWRMExtendedLight *NewL(TIntaPermittedTargets)[static]

Two-phased constructor for implementation class. On opening passes permitted targets.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

Parameters

TInt aPermittedTargetspermitted targets.

NewL(MHWRMExtendedLightObserver *, TInt)

IMPORT_C CHWRMExtendedLight *NewL(MHWRMExtendedLightObserver *aCallback,
TIntaPermittedTargets
)[static]

Two-phased constructor for implementation class. Use this method for creating a Light client with callbacks. On opening passes permitted targets.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

Parameters

MHWRMExtendedLightObserver * aCallbackPointer to callback instance
TInt aPermittedTargetspermitted targets.

NewLC()

IMPORT_C CHWRMExtendedLight *NewLC()[static]

Two-phased constructor for implementation class. Leaves instance to cleanup stack.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

NewLC(MHWRMExtendedLightObserver *)

IMPORT_C CHWRMExtendedLight *NewLC(MHWRMExtendedLightObserver *aCallback)[static]

Two-phased constructor for implementation class. Use this method for creating a Light client with callbacks. Leaves instance to cleanup stack.

leave
KErrNotSupported Device doesn't support Light feature.
leave
KErrNoMemory if there is a memory allocation failure.

Parameters

MHWRMExtendedLightObserver * aCallbackPointer to callback instance

ReleaseLight(TInt)

voidReleaseLight(TIntaTarget)[pure virtual]

Releases light target if it was previously reserved for this client. If this client has not reserved any of the specified lights, this method does nothing. Any reserved light targets that are released and have no other suspended clients will be reset to default state, which is either lights on or lights off, depending on system inactivity time.

TLightTarget

Parameters

TInt aTargetDefines which light should be released. Multiple lights can be specified with using bitwise-or.

ReserveLightL(TInt)

voidReserveLightL(TIntaTarget)[pure virtual]

Reserves light target exclusively for this client. A higher priority client may cause lower priority client reservation to be temporarily suspended. Commands can still be issued in suspended state, but they will not be acted upon unless suspension is lifted within specified duration. The suspended client will not get any notification about suspension. If light target is already reserved by a higher or equal priority application, reserving will still succeeds, but reservation is immediately suspended.

Calling this method is equal to call ReserveLightL( aTarget, EFalse, EFalse), i.e. any previously frozen state will not be restored and CCoeEnv background/foreground status is always used to control further reservations.

leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrAccessDenied if no CCoeEnv present.
leave
KErrNotReady if trying to reserve while on background.
leave
KErrNoMemory if there is a memory allocation failure.
TLightTarget

Parameters

TInt aTargetDefines which light should be reserved. Multiple lights can be specified with using bitwise-or.

ReserveLightL(TInt, TBool, TBool)

voidReserveLightL(TIntaTarget,
TBoolaRestoreState,
TBoolaForceNoCCoeEnv
)[pure virtual]

Reserves light target exclusively for this client. A higher priority client may cause lower priority client reservation to be temporarily suspended. Commands can still be issued in suspended state, but they will not be acted upon unless suspension is lifted within specified duration. The suspended client will not get any notification about suspension. If light target is already reserved by a higher or equal priority application, reserving will still succeeds, but reservation is immediately suspended.

leave
KErrNotSupported One or more of specified targets are not supported.
leave
KErrAccessDenied if aForceNoCCoeEnv is ETrue and client is not trusted.
leave
KErrBadHandle if aForceNoCCoeEnv is EFalse and no CCoeEnv present.
leave
KErrNotReady if trying to reserve while on background and aForceNoCCoeEnv is EFalse.
leave
KErrNoMemory if there is a memory allocation failure.
TLightTarget

Parameters

TInt aTargetDefines which light should be reserved. Multiple lights can be specified with using bitwise-or.
TBool aRestoreStateIf ETrue, the state frozen on last release will be restored upon successful reservation. I.e. if light was blinking when it was released by this client the last time, it would start blinking again upon successful reservation. For the first reservation of each session this parameter is always considered EFalse regardless of what is supplied, as there is no previous frozen state to restore.
TBool aForceNoCCoeEnvIf EFalse, then reservation requires that this client is on the foreground at the time of reservation and light target will be automatically released and re-reserved based on background/foreground status of the this client. This also implies that CCoeEnv::Static() != NULL is required. If ETrue, the client will not require CCoeEnv to be present nor does it automatically reserve/release light by depending on foreground/background status of the client. Only trusted clients are allowed to set this flag to ETrue. Client is considered trusted if it has nonstandard priority defined in the lights policy.

SupportedTargets()

TInt SupportedTargets()const [pure virtual]

This method retrieves the supported light targets of the device. Any attempt to use or reserve unsupported targets will fail with KErrNotSupported.

TLightTarget

Member Enumerations Documentation

Enum TLightStatus

Possible light states that can be get for the different light targets

Enumerators

ELightStatusUnknown = 0

For debugging/development and signaling an error conditions

ELightOn

Light state switch to light on

ELightOff

Light state switch to light off

ELightBlink

Light state switch to light blinking

Enum TLightTarget

Possible light targets. Targets can be used as bitmask. Some common masks are provided as enum.

Note that all targets are not supported by all devices. Attempting to use unsupported target will result in KErrNotSupported.

At least one target must be defined.

Enumerators

ENoTarget = 0x0

No target. Not a valid target value, used only for error checking.

EPrimaryDisplay = 0x1

Primary display of the device.

EPrimaryKeyboard = 0x2

Primary keyboard of the device.

EPrimaryDisplayAndKeyboard = 0x3

Both primary display and the primary keyboard of the device.

ESecondaryDisplay = 0x4

Secondary display of the device.

ESecondaryKeyboard = 0x8

Secondary keyboard of the device.

ESecondaryDisplayAndKeyboard = 0xC

Both secondary display and the secondary keyboard of the device.

ECustomTarget1 = 0x10

Device specific custom target 1.

ECustomTarget2 = 0x20

Device specific custom target 2.

ECustomTarget3 = 0x40

Device specific custom target 3.

ECustomTarget4 = 0x80

Device specific custom target 4.

ECustomTarget5 = 0x100

Device specific custom target 5.

ECustomTarget6 = 0x200

Device specific custom target 6.

ECustomTarget7 = 0x400

Device specific custom target 7.

ECustomTarget8 = 0x800

Device specific custom target 8.

ECustomTarget9 = 0x1000

Device specific custom target 9.

ECustomTarget10 = 0x2000

Device specific custom target 10.

ECustomTarget11 = 0x4000

Device specific custom target 11.

ECustomTarget12 = 0x8000

Device specific custom target 12.

ECustomTarget13 = 0x10000

Device specific custom target 13.

ECustomTarget14 = 0x20000

Device specific custom target 14.

ECustomTarget15 = 0x40000

Device specific custom target 15.

ECustomTarget16 = 0x80000

Device specific custom target 16.

ECustomTarget17 = 0x100000

Device specific custom target 17.

ECustomTarget18 = 0x200000

Device specific custom target 18.

ECustomTarget19 = 0x400000

Device specific custom target 19.

ECustomTarget20 = 0x800000

Device specific custom target 20.

ECustomTarget21 = 0x1000000

Device specific custom target 21.

ECustomTarget22 = 0x2000000

Device specific custom target 22.

ECustomTarget23 = 0x4000000

Device specific custom target 23.

ECustomTarget24 = 0x8000000

Device specific custom target 24.

ECustomTarget25 = 0x10000000

Device specific custom target 25.

ECustomTarget26 = 0x20000000

Device specific custom target 26.

ECustomTarget27 = 0x40000000

Device specific custom target 27.

ESystemTarget = 0x80000000

Special target used to control all currently available system lights.

System lights normally include all displays and keyboards, but not custom lights. This is however device dependant.

A target mask including this target is always changed to a device state specific target mask. Note that the system target with any other target is not supported.

This target is always supported but it is never included in supported targets mask.

CHWRMExtendedLight::SupportedTargets()