src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp
changeset 23 e6ad4ef83b23
parent 21 4633027730f5
child 28 b7da29130b0e
--- a/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp	Wed Aug 18 10:05:37 2010 +0300
+++ b/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp	Thu Sep 02 20:44:51 2010 +0300
@@ -38,8 +38,8 @@
 #include <hbmainwindow.h>
 #include <hbabstractedit.h>
 #include "hbmenucontainer_p.h"
-#include "hbinputvirtualrocker.h"
 #include <hbnamespace_p.h>
+#include <hbglobal_p.h> // remove with HB_DEPRECATED
 
 /*
     Constructor
@@ -105,8 +105,8 @@
     case Hb::InstantSelectionChanged:
         propertyName = "selectionChangedFeedbackEffect";
         break;
-    case Hb::InstantMultitouchActivated:
-        propertyName = "multitouchActivatedFeedbackEffect";
+    case Hb::InstantAdvancedGestureActivated:
+        propertyName = "advancedGestureActivatedFeedbackEffect";
         break;
     default:
         propertyName = "defaultFeedbackEffect";
@@ -178,8 +178,8 @@
     case Hb::InstantSelectionChanged:
         propertyName = "selectionChangedFeedbackModalities";
         break;
-    case Hb::InstantMultitouchActivated:
-        propertyName = "multitouchActivatedFeedbackModalities";
+    case Hb::InstantAdvancedGestureActivated:
+        propertyName = "advancedGestureActivatedFeedbackModalities";
         break;
     default:
         propertyName = "defaultFeedbackModalities";
@@ -459,37 +459,6 @@
                 effect = HbFeedbackEffectUtils::instantOnEditorHighlight(edit, previousCursorPosition) ;
                 previousCursorPosition = edit->cursorPosition();
             }
-        }
-        else if (const HbInputVirtualRocker *trackPoint = qobject_cast<const HbInputVirtualRocker *>(widget)) {
-            if (trackPoint && trackPoint->mainWindow() && trackPoint->mainWindow()->scene() &&
-                trackPoint->mainWindow()->scene()->focusItem()) {
-
-                QGraphicsItem* graphicsItem = trackPoint->mainWindow()->scene()->focusItem();
-
-                if (graphicsItem->isWidget()) {
-                    if (static_cast<QGraphicsWidget*>(graphicsItem)->inherits("HbAbstractEdit")) {
-                        if (HbAbstractEdit* edit = static_cast<HbAbstractEdit*>(graphicsItem)) {
-                            if (edit->cursorPosition() != previousCursorPosition) {
-                                effect = HbFeedbackEffectUtils::instantOnEditorHighlight(edit, previousCursorPosition);
-                                previousCursorPosition = edit->cursorPosition();
-                            }
-                        }
-                    }
-                    else if (static_cast<QGraphicsWidget*>(graphicsItem)->inherits("QGraphicsWebView") )
-                    {
-                        // This takes care of the case when the track point is used on a QGraphicsWebView (for e.g. cWRT)
-                        QVariant v;
-                        v = graphicsItem->scene()->inputMethodQuery( Qt::ImCursorPosition );
-                        if ( v.isValid() && v.canConvert<int>()) {
-                            int currentCursorPosition = v.toInt();
-                            if (currentCursorPosition != previousCursorPosition) {
-                                effect = HbFeedbackEffectUtils::instantOnEditorHighlight(trackPoint, previousCursorPosition);
-                                previousCursorPosition = currentCursorPosition;
-                            }
-                        }
-                    }
-                }
-            }
         } else {
             effect = HbFeedbackEffectUtils::instantOnDrag(widget, modifiers());
         }
@@ -639,14 +608,23 @@
 */
 void HbFeedbackEffectEngine::multitouchActivated(const HbWidget *widget)
 {
+    HB_DEPRECATED("HbFeedbackEffectEngine::multitouchActivated(const HbWidget*) is deprecated. Use HbFeedbackEffectEngine::advancedGestureActivated(const HbWidget*) instead");
+    advancedGestureActivated(widget);
+}
+
+/*
+    Called by the feedback manager when a touch gesture with more than one finger is detected.
+*/
+void HbFeedbackEffectEngine::advancedGestureActivated(const HbWidget *widget)
+{
     HbFeedback::InstantEffect effect = HbFeedback::None ;
     HbFeedback::Modalities modalities = 0 ;
-    Hb::InstantInteraction interaction = Hb::InstantMultitouchActivated;
+    Hb::InstantInteraction interaction = Hb::InstantAdvancedGestureActivated;
 
     if(widgetOverridesEffect( widget, interaction)) {
         effect = overrider.newInstantEffect;
     } else {
-        effect = HbFeedback::MultitouchActivate;
+        effect = HbFeedback::AdvancedGestureActivate;
     }
 
     if(widgetOverridesModalities(widget,interaction)) {