API published in: S60 3rd Ed
Link against: hwrmlightclient.lib
Required Capabilities
None
#include <hwrmlight.h>
If the client requires up-to-date status information, the client needs to derive a class from the MHWRMlightObserver interface and implement the LightStatusChanged() method.
A callback object header example:
// INCLUDES #include <HWRMLight.h> // Link against HWRMLightClient.lib. class CTests : public CBase, public MHWRMLightObserver { public: CTests(); ~CTests(); void ConstructL(); static CTests* NewL(); // from MHWRMLightObserver virtual void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus); private: CHWRMLight* iLight; };
A callback method implementation example:
void CTests::LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus) { RDebug::Print(_L("### Light state changed for target: 0x%x"), aTarget); switch ( aStatus ) { case CHWRMLight::ELightOn: RDebug::Print(_L("### Light state changed: ELightOn")); break; case CHWRMLight::ELightOff: RDebug::Print(_L("### Light state changed: ELightOff")); break; case CHWRMLight::ELightBlink: RDebug::Print(_L("### Light state changed: ELightBlink")); break; case CHWRMLight::ELightStatusUnknown: RDebug::Print(_L("### Light state changed: ELightStatusUnknown")); break; default: RDebug::Print(_L("### Light state changed: UNDEFINED !")); break; } }
Public Member Functions |
|
virtual void | LightStatusChanged (TInt aTarget, CHWRMLight::TLightStatus aStatus)=0 |
Called when the device light status changes. |
|
Called when the device light status changes. Note that if the light status for certain target changes very rapidly, some state transitions might be missed. It is however guaranteed that latest state is always obtained.
|