Creating an instance

Create a new instance of Extended Light API is using NewL() or NewLC() method. If the instance require the status feedback from the lights, derive the instance of the API from the MHWRMExtendedLight.

The following code demonstrates how to create an instance of Extended Light API:

#include HWRMExtendedLight.h //Link against HWRMExtendedLightClient.lib.
class CNewApp : public CBase,
                public MHWRMExtendedLightObserver
    {
    public:
        CNewApp();
        ~CNewApp();
        void ConstructL();
        static CNewApp* NewL();
        // from MHWRMExtendedLightObserver
        virtual void LightStatusChanged( TInt aTarget,
                                         CHWRMExtendedLight::TLightStatus aStatus );
    private:
        CHWRMExtendedLight* iLight;
    };

Without a notification, the instance can be derived from CBase and created using NewL() or NewLC().

CHWRMExtendedLight* light = CHWRMExtendedLight::NewLC(); // No callbacks