Link against: HWRMVibraClient.lib
None
#include <HWRMVibra.h>
If the client requires up-to-date status information, the client needs to derive a class from the MHWRMVibraFeedbackObserver interface and implement the VibraFeedbackModeChanged() method. In order to register for callback, client needs to call SetFeedbackObserver-method.
A callback object header example:
// INCLUDES #include <HWRMVibra.h> // Link against HWRMVibraClient.lib. class CTest : public CBase, public MHWRMVibraFeedbackObserver { public: CTest(); ~CTest(); void ConstructL(); static CTest* NewL(); // from MHWRMVibraFeedbackObserver virtual void VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode); private: CHWRMVibra* iVibra; };
A callback method implementation example:
#include <HWRMVibra.h> // link against HWRMVibraClient.lib // A CHWRMVibra instance can be created by using NewL() or NewLC() methods. CHWRMVibra* vibra = CHWRMVibra::NewL(); // Request notification of feedback setting change vibra->SetFeedbackObserver(this); // To clean up, delete the created object: delete vibra; void CTest::VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode) { switch ( aMode ) { case CHWRMVibra::EVibraFeedbackModeUnknown: RDebug::Print(_L("### Feedback vibration mode : EVibraFeedbackModeUnknown")); break; case CHWRMVibra::EVibraFeedbackModeON: RDebug::Print(_L("### Feedback vibration mode : EVibraFeedbackModeON")); break; case CHWRMVibra::EVibraFeedbackModeOFF: RDebug::Print(_L("### Feedback vibration mode : EVibraFeedbackModeOFF")); break; default: break; } }
Public Member Functions | |
virtual void | VibraFeedbackModeChanged (CHWRMVibra::TVibraFeedbackModeState aMode)=0 |
Called when the tactile feedback vibration setting in the user profile is changed. |
|
Called when the tactile feedback vibration setting in the user profile is changed.
|