MHWRMVibraObserver Class Reference

API published in: S60 3rd Ed

Link against: hwrmvibraclient.lib

Capability Information

Required Capabilities

None


#include <hwrmvibra.h>

Detailed Description

A callback interface for vibra status reporting.

If the client requires up-to-date status information, the client needs to derive a class from the MHWRMVibraObserver interface and implement the VibraModeChanged() and VibraStatusChanged() methods.

A callback object header example:

 // INCLUDES
 #include <HWRMVibra.h> // Link against HWRMVibraClient.lib.

 class CTest : public CBase, 
               public MHWRMVibraObserver    
    {
    public:
        CTest();
        ~CTest();
                       
        void ConstructL();
        static CTest* NewL();
                
        // from MHWRMVibraObserver
        virtual void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus);
        virtual void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus);

    private:
        CHWRMVibra* iVibra;
    };

A callback method implementation example:

 void CTest::VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus)
    {
    switch ( aStatus )
        {
        case CHWRMVibra::EVibraStatusUnknown:
            RDebug::Print(_L("### Vibra state changed: EVibraStatusUnknown"));
            break;
        case CHWRMVibra::EVibraStatusNotAllowed:
            RDebug::Print(_L("### Vibra state changed: EVibraStatusNotAllowed"));
            break;
        case CHWRMVibra::EVibraStatusStopped:
            RDebug::Print(_L("### Vibra state changed: EVibraStatusStopped"));
            break;
        case CHWRMVibra::EVibraStatusOn:
            RDebug::Print(_L("### Vibra state changed: EVibraStatusOn"));
            break;
        default:
            RDebug::Print(_L("### Vibra state changed: UNDEFINED !"));
            break;
        }
    }

Public Member Functions

virtual void  VibraModeChanged (CHWRMVibra::TVibraModeState aStatus)=0
  Called when the vibration setting in the user profile is changed.
virtual void  VibraStatusChanged (CHWRMVibra::TVibraStatus aStatus)=0
  Called when the device vibration feature state changes.

Member Function Documentation

virtual void MHWRMVibraObserver::VibraModeChanged CHWRMVibra::TVibraModeState  aStatus  )  [pure virtual]
 

Called when the vibration setting in the user profile is changed.

Parameters:
aStatus  Indicates the new setting.
See also:
CHWRMVibra::TVibraModeState
virtual void MHWRMVibraObserver::VibraStatusChanged CHWRMVibra::TVibraStatus  aStatus  )  [pure virtual]
 

Called when the device vibration feature state changes.

Parameters:
aStatus  Indicates vibra status.
See also:
CHWRMVibra::TVibraStatus

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

Copyright © Nokia Corporation 2001-2008
Back to top