MHWRMLightObserver Class Reference

API published in: S60 3rd Ed

Link against: hwrmlightclient.lib

Capability Information

Required Capabilities

None


#include <hwrmlight.h>

Detailed Description

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;
         }
     }

Public Member Functions

virtual void  LightStatusChanged (TInt aTarget, CHWRMLight::TLightStatus aStatus)=0
  Called when the device light status changes.

Member Function Documentation

virtual void MHWRMLightObserver::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.
See also:
CHWRMLight::TLightTarget

CHWRMLight::TLightStatus


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top