You Are Here:

Community: Wiki

This page was last modified on 30 September 2009, at 06:03.

Monitoring Tactile Feedback Vibration Mode

From Forum Nokia Wiki

Reviewer Approved   



ID ... Creation date 03.11.2008
Platform S60 5th Edition Tested on devices Nokia 5800 XpressMusic.
Category Symbian C++ Subcategory Touch UI


Keywords (APIs, classes, methods, functions): VibraFeedbackModeChanged(),MHWRMVibraFeedbackObserver ,Tactile Feedback Vibration Mode



Overview

This snippet shows how to Monitor Touch Screen Vibration Mode Change.

This snippet can be self-signed.

Preconditions

Here we assume that we already have a working application.

MMP file

The following capabilities and libraries are required:

CAPABILITY None


LIBRARY HWRMVibraClient.lib



<STEP 1>

Whatever Client that needs to monitor Touch Screen Vibration should derive from the MHWRMVibraFeedbackObserver interface and implement the VibraFeedbackModeChanged() method.


#include <HWRMVibra.h> 
 
class CVibrationModeMonitorAppView : public CCoeControl, public MHWRMVibraFeedbackObserver
{
...
 
public:
// from MHWRMVibraFeedbackObserver
virtual void VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode);
 
...
 
private:
/**
* Owned
* CHWRMVibra instance
*/

CHWRMVibra* iVibra;
};



<STEP 2>

Create CHWRMVibra instance and set CVibrationModeMonitorAppView as observer for notification of feedback setting change.


void CVibrationModeMonitorAppView::ConstructL(const TRect& aRect)
{
...
 
iVibra = CHWRMVibra::NewL();
 
// Set View as observer for notification of feedback setting change //
iVibra->SetFeedbackObserver(this);
 
...
}



<STEP 3>

Implement VibraFeedbackModeChanged().



void CVibrationModeMonitorAppView::VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode)
{
 
// Create new CAknGlobalNote instance.
CAknGlobalNote* globalNote = CAknGlobalNote::NewL();
// Push CAknGlobalNote's pointer to CleanupStack
CleanupStack::PushL( globalNote );
TBuf<KMaxMessageLen> message;
 
switch ( aMode )
{
case CHWRMVibra::EVibraFeedbackModeON:
 
message.Copy( KVibraModeOn );
globalNote->ShowNoteL( EAknGlobalInformationNote, message );
break;
case CHWRMVibra::EVibraFeedbackModeOFF:
message.Copy( KVibraModeOff );
globalNote->ShowNoteL( EAknGlobalInformationNote, message );
break;
default:
break;
 
}
// Pop and Destroy CAknGlobalNote's pointer from CleanupStack
CleanupStack::PopAndDestroy();
 
}



<STEP 4>

Testing : For testing the Vibration Mode, run the attached application, keep the application running in the background and then try to enable/disable tactile feedback through Control Panel -> Personal -> Profiles -> <Profile_in_use> -> <Personalise> -> Touch Screen Tones.

After changing the status you will see the appropriate message on the profile screen itself, because we have used Global Notes in the example.



Postconditions

Appropriate Tactile Feedback Vibration Mode Status Events will be received by CVibrationModeMonitorAppView displaying notes with appropriate message.

Example Application

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHowE5ftoE5fcreateE5faE5fCountryE2dInfoE5fWidgetE5fE28WE52TE29X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ