src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.h
changeset 0 16d8024aca5e
child 1 f7ac710697a9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbPlugins module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBFEEDBACKEFFECTENGINE_H
       
    27 #define HBFEEDBACKEFFECTENGINE_H
       
    28 
       
    29 #include <hbfeedbackengine.h>
       
    30 
       
    31 #include <QMap>
       
    32 #include <QList>
       
    33 
       
    34 class QGraphicsItem;
       
    35 class HbAbstractViewItem;
       
    36 class HbWidget;
       
    37 
       
    38 class HbFeedbackEffectEngine : public HbFeedbackEngine
       
    39 {
       
    40     Q_OBJECT
       
    41         
       
    42 public:
       
    43     HbFeedbackEffectEngine();
       
    44     ~HbFeedbackEffectEngine();
       
    45 
       
    46     void triggered(const HbWidget* widget, Hb::InstantInteraction interaction, Hb::InteractionModifiers modifiers);
       
    47     void pressed(const HbWidget *widget);
       
    48     void released(const HbWidget *widget);
       
    49     void longPressed(const HbWidget *widget);
       
    50     void clicked(const HbWidget *widget);
       
    51     void keyRepeated(const HbWidget *widget);
       
    52     void draggedOver(const HbWidget *widget);
       
    53     void flicked(const HbWidget *widget);
       
    54     void popupOpened(const HbWidget *widget);
       
    55     void popupClosed(const HbWidget *widget);
       
    56     void boundaryReached(const HbWidget *widget);
       
    57     void rotated90Degrees(const HbWidget *widget);
       
    58     void selectionChanged(const HbWidget *widget);
       
    59     void multitouchActivated(const HbWidget *widget);
       
    60     void continuousTriggered(const HbWidget *widget, Hb::ContinuousInteraction interaction, QPointF delta);
       
    61     void continuousStopped(const HbWidget *widget, Hb::ContinuousInteraction interaction);
       
    62         
       
    63 protected:
       
    64     void playInstantFeedback(const HbWidget* widget, HbFeedback::InstantEffect effect);
       
    65     void playContinuousFeedback(const HbWidget* widget, HbFeedback::ContinuousEffect effect, int intensity);
       
    66     void cancelContinuousFeedback(const HbWidget* HbWidget);
       
    67 
       
    68 private:
       
    69     QMap<const HbWidget*, int> continuousFeedbacks;
       
    70     QList<int> oldVisibleIndexes;
       
    71     const HbWidget* activelyScrollingItemView;
       
    72     QList<const HbWidget*> boundaryWidgets;
       
    73 
       
    74     int previousCursorPosition;
       
    75 };
       
    76 
       
    77 #endif // HBFEEDBACKEFFECTENGINE_H