Revision: 201023
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 18:31:51 +0300
changeset 27 dabdd02a1ba9
parent 22 4838b44af342
child 28 89310418a649
child 33 03a5a9b9cb9f
Revision: 201023 Kit: 2010125
hapticsservices_pub/tactile_feedback_client_api/inc/touchfeedback.h
hapticsservices_pub/tactile_feedback_client_api/inc/touchlogicalfeedback.h
tactilefeedback/tactilearearegistry/inc/tactileinternaldatatypes.h
tactilefeedback/tactilefeedbackclient/inc/touchfeedbackimpl.h
tactilefeedback/tactilefeedbackclient/src/touchfeedbackimpl.cpp
tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel1_A.ivt
tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel2_A.ivt
tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel3_A.ivt
tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel4_A.ivt
tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel5_A.ivt
tactilefeedback/tactilefeedbackresolver/inc/tactilefeedbackresolver.h
tactilefeedback/tactilefeedbackresolver/plugins/tactileaudioplugin/src/tactileaudioplayer.cpp
tactilefeedback/tactilefeedbackresolver/plugins/tactilehapticsplugin/src/tactilehapticsplayer.cpp
tactilefeedback/tactilefeedbackresolver/plugins/tactiletoneplugin/src/tactiletoneplayer.cpp
tactilefeedback/tactilefeedbackresolver/plugins/tactilevibraplugin/src/tactilevibraplayer.cpp
tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp
--- a/hapticsservices_pub/tactile_feedback_client_api/inc/touchfeedback.h	Fri Jun 11 13:57:13 2010 +0300
+++ b/hapticsservices_pub/tactile_feedback_client_api/inc/touchfeedback.h	Wed Jun 23 18:31:51 2010 +0300
@@ -694,6 +694,25 @@
                                   TTouchFeedbackType aFeedbackType,
                                   const TPointerEvent& aPointerEvent ) = 0;
 
+    /**
+     * Gives direct feedback.
+     *
+     * Notice that the feedback might not be actually played, if 
+     * for example user has disabled the feedback from the settings.
+     *
+     * This function always causes a synchronous client-server transaction, 
+     * and potentially flushing of window server client-side buffer. Using this
+     * overload it is also possible to disable unwanted feedback (vibra/audio)
+     * by giving only wanted feedback type as parameter.
+     *
+     * @since S60 5.2
+     * @param aType         - The logical feedback type to play.
+     * @param aFeedbackType - Feedback types to be played as a bitmask 
+     *                        combination of enumeration items from
+     *                        TTouchFeedbackType
+     */
+    virtual void InstantFeedback( TTouchLogicalFeedback aType,
+                                  TTouchFeedbackType aFeedbackType ) = 0;
 
 
     };
--- a/hapticsservices_pub/tactile_feedback_client_api/inc/touchlogicalfeedback.h	Fri Jun 11 13:57:13 2010 +0300
+++ b/hapticsservices_pub/tactile_feedback_client_api/inc/touchlogicalfeedback.h	Wed Jun 23 18:31:51 2010 +0300
@@ -97,11 +97,7 @@
     ETouchFeedbackRotateStep,
     ETouchFeedbackSensitiveSlider,
     ETouchFeedbackStopFlick,
-    ETouchFeedbackLongTap,
-    ETouchFeedbackSubMenuOpen,
-    ETouchFeedbackSubMenuClosed,
-    ETouchFeedbackOptionsMenuOpen,
-    ETouchFeedbackOptionsMenuClosed
+    ETouchFeedbackLongPress
     };
     
 /**  
@@ -114,8 +110,7 @@
     ETouchContinuousSlider,
     ETouchContinuousInput,
     ETouchContinuousPopup,
-    ETouchContinuousPinch,
-    ETouchDynamicSlider
+    ETouchContinuousPinch
     };
     
 /**  
--- a/tactilefeedback/tactilearearegistry/inc/tactileinternaldatatypes.h	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilearearegistry/inc/tactileinternaldatatypes.h	Wed Jun 23 18:31:51 2010 +0300
@@ -24,6 +24,7 @@
 
 
 #include <e32std.h>
+#include <e32svr.h>
 #include <touchlogicalfeedback.h>
 
 
--- a/tactilefeedback/tactilefeedbackclient/inc/touchfeedbackimpl.h	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackclient/inc/touchfeedbackimpl.h	Wed Jun 23 18:31:51 2010 +0300
@@ -305,6 +305,12 @@
                           TTouchFeedbackType aFeedbackType,
                           const TPointerEvent& aPointerEvent );
       
+    /**
+     * @see MTouchFeedback.
+     */
+    void InstantFeedback( TTouchLogicalFeedback aType,
+                          TTouchFeedbackType aFeedbackType );
+
 private:
     /**
      * Constructor.
--- a/tactilefeedback/tactilefeedbackclient/src/touchfeedbackimpl.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackclient/src/touchfeedbackimpl.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -1146,6 +1146,35 @@
     }
         
 // ---------------------------------------------------------------------------
+// CTouchFeedbackImpl::InstantFeedback
+// ---------------------------------------------------------------------------
+//    
+void CTouchFeedbackImpl::InstantFeedback( TTouchLogicalFeedback aType,
+                                          TTouchFeedbackType aFeedbackType )
+    {
+    if ( iClient && ( iAudioEnabledForThisApp || iVibraEnabledForThisApp ) )
+        {
+        // Initialize vibra and audio enablers as given in param.
+        TBool vibraEnabled = aFeedbackType & ETouchFeedbackVibra;
+        TBool audioEnabled = aFeedbackType & ETouchFeedbackAudio;
+
+        // Check application level vibra and audio enablers
+        if ( !iVibraEnabledForThisApp )
+            {
+            vibraEnabled = EFalse;
+            }
+        if ( !iAudioEnabledForThisApp )
+            {
+            audioEnabled = EFalse;
+            }
+
+        TRACE4( "CTouchFeedbackImpl::InstantFeedback, type:=%d Vibra:%d Audio:%d",
+                aType, vibraEnabled, audioEnabled );
+        iClient->ImmediateFeedback( aType, vibraEnabled, audioEnabled );
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // Here we do the actual work for adding new area to the registry
 // (or updating an existing one).
 //
@@ -1730,9 +1759,8 @@
     item.iEventType = aEventType;        
     
 	// range check. update when logical feedback types are changed.
-    if (! ( aFeedback >= ETouchFeedbackNone || aFeedback <= ETouchFeedbackSensitive) 
-     || ! ( aFeedback >= ETouchFeedbackBasicButton || 
-            aFeedback <= ETouchFeedbackOptionsMenuClosed ) )
+    if ( !(aFeedback >= ETouchFeedbackNone && aFeedback <= ETouchFeedbackSensitive) 
+            && !(aFeedback >= ETouchFeedbackBasicButton && aFeedback <= ETouchFeedbackLongPress) )
         {
         return KErrArgument;
         }
Binary file tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel1_A.ivt has changed
Binary file tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel2_A.ivt has changed
Binary file tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel3_A.ivt has changed
Binary file tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel4_A.ivt has changed
Binary file tactilefeedback/tactilefeedbackresolver/data/10.1_TactileFeedbackLevel5_A.ivt has changed
--- a/tactilefeedback/tactilefeedbackresolver/inc/tactilefeedbackresolver.h	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/inc/tactilefeedbackresolver.h	Wed Jun 23 18:31:51 2010 +0300
@@ -244,6 +244,12 @@
     CRepository*          iRepository;
     
     /**
+     * Central repository for reading profile settings.
+     * Own.
+     */
+    CRepository*          iProfileRepository;
+    
+    /**
      * Central repository notifier, which sends notification when tactile 
      * feedback settings has been changed.
      * Own.
--- a/tactilefeedback/tactilefeedbackresolver/plugins/tactileaudioplugin/src/tactileaudioplayer.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/plugins/tactileaudioplugin/src/tactileaudioplayer.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -156,11 +156,7 @@
         case ETouchFeedbackMultipleCheckbox:
         case ETouchFeedbackRotateStep:
         case ETouchFeedbackStopFlick:
-        case ETouchFeedbackLongTap:
-        case ETouchFeedbackSubMenuOpen:
-        case ETouchFeedbackSubMenuClosed:
-        case ETouchFeedbackOptionsMenuOpen:
-        case ETouchFeedbackOptionsMenuClosed:
+        case ETouchFeedbackLongPress:
             volumeIndex = 0;
             break;
         case ETouchFeedbackSensitive:           // flow through
--- a/tactilefeedback/tactilefeedbackresolver/plugins/tactilehapticsplugin/src/tactilehapticsplayer.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/plugins/tactilehapticsplugin/src/tactilehapticsplayer.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -71,11 +71,7 @@
 _LIT8( KTFRotateStep,           "TFRotateStep");            // Mapped to IVT file version 10.1
 _LIT8( KTFSensitiveSlider,      "TFSensitiveSlider");       // Mapped to IVT file version 10.1
 _LIT8( KTFStopFlick,            "TFStopFlick");             // Mapped to IVT file version 10.1
-_LIT8( KTFLongTap,              "TFLongTap");               // Mapped to IVT file version 10.1
-_LIT8( KTFSubMenuOpen,          "TFSubMenuOpen");           // Mapped to IVT file version 10.1
-_LIT8( KTFSubMenuClosed,        "TFSubMenuClosed");         // Mapped to IVT file version 10.1
-_LIT8( KTFOptionsMenuOpen,      "TFOptionsMenuOpen");       // Mapped to IVT file version 10.1
-_LIT8( KTFOptionsMenuClosed,    "TFOptionsMenuClosed");     // Mapped to IVT file version 10.1
+_LIT8( KTFLongPress,              "TFLongPress");               // Mapped to IVT file version 10.1
 
 // Continuous feedback's names
 _LIT8( KTFContinuousSmooth,     "TFContinuousSmooth");
@@ -83,7 +79,6 @@
 _LIT8( KTFContinuousInput,      "TFContinuousInput");
 _LIT8( KTFContinuousPopup,      "TFContinuousPopup");       // Mapped to IVT file version 10.1
 _LIT8( KTFContinuousPinch,      "TFContinuousPinch");       // Mapped to IVT file version 10.1
-_LIT8( KTFDynamicSlider,        "TFDynamicSlider");         // Mapped to IVT file version 10.1
 // ---------------------------------------------------------------------------
 // Constructor.
 // ---------------------------------------------------------------------------
@@ -315,20 +310,8 @@
         case ETouchFeedbackStopFlick:
             name = KTFStopFlick;
             break;
-        case ETouchFeedbackLongTap:
-            name = KTFLongTap;
-            break;
-        case ETouchFeedbackSubMenuOpen:
-            name = KTFSubMenuOpen;
-            break;
-        case ETouchFeedbackSubMenuClosed:
-            name = KTFSubMenuClosed;
-            break;
-        case ETouchFeedbackOptionsMenuOpen:
-            name = KTFOptionsMenuOpen;
-            break;
-        case ETouchFeedbackOptionsMenuClosed:
-            name = KTFOptionsMenuClosed;
+        case ETouchFeedbackLongPress:
+            name = KTFLongPress;
             break;
         default:
             User::Leave( KErrArgument );
@@ -439,9 +422,6 @@
         case ETouchContinuousPinch:
             name = KTFContinuousPinch;
             break;    
-        case ETouchDynamicSlider:
-            name = KTFDynamicSlider;
-            break;
         default:
             ret = KErrArgument;
             break;
--- a/tactilefeedback/tactilefeedbackresolver/plugins/tactiletoneplugin/src/tactiletoneplayer.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/plugins/tactiletoneplugin/src/tactiletoneplayer.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -161,11 +161,7 @@
             case ETouchFeedbackMultipleCheckbox:
             case ETouchFeedbackRotateStep:
             case ETouchFeedbackStopFlick:
-            case ETouchFeedbackLongTap:
-            case ETouchFeedbackSubMenuOpen:
-            case ETouchFeedbackSubMenuClosed:
-            case ETouchFeedbackOptionsMenuOpen:
-            case ETouchFeedbackOptionsMenuClosed:
+            case ETouchFeedbackLongPress:
                 effectIndex = 0;
                 break;
             case ETouchFeedbackSensitive:           // flow through
--- a/tactilefeedback/tactilefeedbackresolver/plugins/tactilevibraplugin/src/tactilevibraplayer.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/plugins/tactilevibraplugin/src/tactilevibraplayer.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -136,11 +136,7 @@
             case ETouchFeedbackMultipleCheckbox:
             case ETouchFeedbackRotateStep:
             case ETouchFeedbackStopFlick:
-            case ETouchFeedbackLongTap:
-            case ETouchFeedbackSubMenuOpen:
-            case ETouchFeedbackSubMenuClosed:
-            case ETouchFeedbackOptionsMenuOpen:
-            case ETouchFeedbackOptionsMenuClosed:
+            case ETouchFeedbackLongPress:
                 effectIndex = 0;
                 break;
             case ETouchFeedbackSensitive:           // flow through
--- a/tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp	Fri Jun 11 13:57:13 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp	Wed Jun 23 18:31:51 2010 +0300
@@ -23,6 +23,7 @@
 
 #include <centralrepository.h>
 #include <ecom/implementationinformation.h>
+#include <ProfileEngineInternalCRKeys.h>
 
 #include "tactilefeedbackprivatecrkeys.h"
 #include "tactilefeedbackinternalpskeys.h"
@@ -103,6 +104,7 @@
     {
     delete iCenRepNotifier;
     delete iRepository;
+    delete iProfileRepository;
     delete iPropertyWatcher;
     delete iHapticsPlayer;
     delete iAudioPlayer;
@@ -118,25 +120,15 @@
         return ETrue;
         }
     
-    return ( ( aFeedback == ETouchFeedbackPopUp || 
+    return ( aFeedback == ETouchFeedbackPopUp || 
             aFeedback == ETouchFeedbackPopupOpen || 
             aFeedback == ETouchFeedbackPopupClose ||
-            aFeedback == ETouchFeedbackBounceEffect ||
-            aFeedback == ETouchFeedbackOptionsMenuOpen ||
-            aFeedback == ETouchFeedbackOptionsMenuClosed ||
-            aFeedback == ETouchFeedbackSubMenuOpen ||
-            aFeedback == ETouchFeedbackSubMenuClosed ) &&
+            aFeedback == ETouchFeedbackBounceEffect ) &&
             ( iLastFeedback == ETouchFeedbackBasicButton ||
             iLastFeedback == ETouchFeedbackSensitiveButton ||
             iLastFeedback == ETouchFeedbackSensitiveItem ||
             iLastFeedback == ETouchFeedbackBasicItem ||
-            iLastFeedback == ETouchFeedbackCheckbox ) ) 
-            || (
-             aFeedback == ETouchFeedbackPopUp && 
-             ( iLastFeedback == ETouchFeedbackPopupOpen ||
-              iLastFeedback == ETouchFeedbackOptionsMenuOpen ||
-              iLastFeedback == ETouchFeedbackSubMenuOpen )
-             );
+            iLastFeedback == ETouchFeedbackCheckbox );
     }
 
 // ---------------------------------------------------------------------------
@@ -172,6 +164,7 @@
     else if ( IsHigherThanPlaying( aFeedback ) )
         {
         willPlay = ETrue;
+        StopFeedback();
         }
 
     if ( willPlay )
@@ -195,6 +188,16 @@
             aPlayAudio = EFalse;
             }
         
+        // check silent mode, if device is in silent mode, 
+        // audio feedback is not allowed.
+        TInt err;
+        TInt isAudioSupported;
+        err = iProfileRepository->Get( KProEngSilenceMode, isAudioSupported );
+        if ( KErrNone == err && 1 == isAudioSupported )
+            {
+            aPlayAudio = EFalse;
+            }
+
         if ( ( aPlayVibra || aPlayAudio ) &&        // #1
                aFeedback != ETouchFeedbackNone )    // #2
             {
@@ -239,7 +242,12 @@
     if ( !iRepository )
         {
         iRepository = CRepository::NewL( KCRUidTactileFeedback );    
-        }    
+        }
+
+    if ( !iProfileRepository )
+        {
+        iProfileRepository = CRepository::NewL( KCRUidProfileEngine );
+        }
     
     TInt minInterval(0);
     // Read and store minimun feedback interfal