diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-CD87FAF6-A11D-4260-9472-CABA18BF86B1.dita --- a/Symbian3/PDK/Source/GUID-CD87FAF6-A11D-4260-9472-CABA18BF86B1.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-CD87FAF6-A11D-4260-9472-CABA18BF86B1.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,49 +1,49 @@ - - - - - -Creating -a light instance -

Create an instance of CHWRMLight instance -using NewL() or NewLC() methods. After creating -the instance, lights can be directly controlled via the provided class methods.

Without -notify handling

Create an instance of the CHWRMLight implementation -class using the NewL() or NewLC() constructor -without a parameter.

The following code snippet demonstrates how to -create an instance without notify handling to control the lights of the device:

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

With notify handling

Derive a class from the MHWRMLightObserver interface -and implement the LightStatusChanged() method.

The -following code snippet is an example of the header of the class implemented -by the client:

// INCLUDES -#include HWRMLight.h // Link against HWRMLightClient.lib. -class CLightStatusObserver : public CBase, - public MHWRMLightObserver - { - public: - CLightStatusObserver(); - ~CLightStatusObserver(); - void ConstructL(); - static CLightStatusObserver* NewL(); - //from MHWRMLightObserver - virtual void LightStatusChanged( TInt aTarget, - CHWRMLight::TLightStatus aStatus ); - private: - CHWRMLight* iLight; - };

Create an instance of the CHWRMLight implementation -class using the NewL() or NewLC() constructor -with a parameter. This parameter is a pointer to an object that is derived -from MHWRMLightObserver. After this, lights can be directly -controlled through the provided class methods. Every light status change causes -a notification using MHWRMLightObserver::LightStatusChanged().

The -following code snippet demonstrates how to create an instance with notify -handling to control the lights of the device:

void CLightStatusObserver::ConstructL() - { - iLight = CHWRMLight::NewL( this ) - }
+ + + + + +Creating +a light instance +

Create an instance of CHWRMLight instance +using NewL() or NewLC() methods. After creating +the instance, lights can be directly controlled via the provided class methods.

Without +notify handling

Create an instance of the CHWRMLight implementation +class using the NewL() or NewLC() constructor +without a parameter.

The following code snippet demonstrates how to +create an instance without notify handling to control the lights of the device:

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

With notify handling

Derive a class from the MHWRMLightObserver interface +and implement the LightStatusChanged() method.

The +following code snippet is an example of the header of the class implemented +by the client:

// INCLUDES +#include HWRMLight.h // Link against HWRMLightClient.lib. +class CLightStatusObserver : public CBase, + public MHWRMLightObserver + { + public: + CLightStatusObserver(); + ~CLightStatusObserver(); + void ConstructL(); + static CLightStatusObserver* NewL(); + //from MHWRMLightObserver + virtual void LightStatusChanged( TInt aTarget, + CHWRMLight::TLightStatus aStatus ); + private: + CHWRMLight* iLight; + };

Create an instance of the CHWRMLight implementation +class using the NewL() or NewLC() constructor +with a parameter. This parameter is a pointer to an object that is derived +from MHWRMLightObserver. After this, lights can be directly +controlled through the provided class methods. Every light status change causes +a notification using MHWRMLightObserver::LightStatusChanged().

The +following code snippet demonstrates how to create an instance with notify +handling to control the lights of the device:

void CLightStatusObserver::ConstructL() + { + iLight = CHWRMLight::NewL( this ) + }
\ No newline at end of file