#include <hwrmlight.h>
class MHWRMLightObserver |
Public Member Functions | |
---|---|
pure virtual void | LightStatusChanged(TInt, CHWRMLight::TLightStatus) |
A callback interface for light status reporting.
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; } }
void | LightStatusChanged | ( | TInt | aTarget, |
CHWRMLight::TLightStatus | aStatus | |||
) | [pure virtual] |
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.
Parameters | |
---|---|
aTarget | Indicates target(s) the new status applies to. |
aStatus | Indicates light request status. |