qstmgesturelib/qstmuievent.h
changeset 0 1450b09d0cfd
child 3 0954f5dd2cd0
equal deleted inserted replaced
-1:000000000000 0:1450b09d0cfd
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef QSTMUIEVENT_H_
       
    20 #define QSTMUIEVENT_H_
       
    21 
       
    22 #include "qstmuievent_if.h"
       
    23 
       
    24 
       
    25 namespace qstmUiEventEngine
       
    26 {
       
    27 
       
    28 class QStm_UiEvent : public QStm_UiEventIf
       
    29 {
       
    30 public:
       
    31     virtual const QPoint& startPos() const ;
       
    32     virtual const QPoint& currentXY() const ; // current yx-coordinate
       
    33     virtual const QPoint& previousXY() const ;    // Past yx coordinate
       
    34     virtual long stateTransition() const ;    // Time taken for state transition
       
    35     virtual bool timerExpired() const;   // if timer expired
       
    36     virtual QStm_UiEventCode code()const ;
       
    37     virtual void* target() const ;
       
    38     virtual int index() const ;
       
    39     QStm_UiEventIf* previousEvent() const ;
       
    40     virtual int countOfEvents() const  ;
       
    41     virtual QTime timestamp() const ;
       
    42     virtual float speed() const /* __SOFTFP */; // pixels / millisecond
       
    43     virtual void setSpeed(float speed) { m_speed = speed; }		
       
    44     
       
    45     virtual QPointF speedVec() const;
       
    46     virtual void  setSpeedVec(QPointF speedVec) { m_speedVec = speedVec; }
       
    47     virtual QEvent::Type  mapToMouseEventType();
       
    48     virtual QEvent::Type  mapToTouchEventType();
       
    49 
       
    50     
       
    51     // for testing...
       
    52     virtual void logSpeed() const ;
       
    53 
       
    54     QStm_UiEvent(
       
    55         QStm_UiEventCode code,
       
    56         const QPoint& start, const QPoint& xy, const QPoint& previousXY,
       
    57         bool timerExpired, void* target, long interval,
       
    58         int index, QTime timestamp) ;
       
    59 
       
    60     ~QStm_UiEvent() ;
       
    61     /*!
       
    62      * Chain the UI events ; the whole chain is deleted after release has been handled
       
    63      * in UI sender
       
    64      */
       
    65     virtual void setPrevious(QStm_UiEvent* aEvent) ;
       
    66 private:
       
    67 
       
    68     QStm_UiEventCode m_code ;
       
    69     QPoint m_start ;
       
    70     QPoint m_XY ;
       
    71     QPoint m_previousXY ;
       
    72     int    m_statetransition ;
       
    73     void*  m_target ;
       
    74     bool   m_timerExpired ;
       
    75     int    m_index ;
       
    76     QStm_UiEvent* m_previousEvent ;
       
    77     QTime  m_timestamp ;
       
    78 };
       
    79 }
       
    80 
       
    81 
       
    82 #endif /* QSTMUIEVENT_H_ */