44 class QStm_StateEngine; |
44 class QStm_StateEngine; |
45 class QStm_HwEvent; |
45 class QStm_HwEvent; |
46 class QStm_StateEngineConfiguration; |
46 class QStm_StateEngineConfiguration; |
47 |
47 |
48 |
48 |
49 class QStm_StateMachine : public QObject, public QStm_TimerInterfaceIf, public QStm_StateMachineIf |
49 class QSTMGESTURELIB_EXPORT QStm_StateMachine : public QStm_TimerInterfaceIf, public QStm_StateMachineIf |
50 { |
50 { |
51 Q_OBJECT |
|
52 public: |
51 public: |
53 virtual QRect getTouchArea(int pointerNumber) ; |
52 virtual QRect getTouchArea(int pointerNumber) ; |
54 virtual void setTouchTimeArea(long fingersize_mm) ; |
53 virtual void setTouchTimeArea(long fingersize_mm) ; |
55 virtual void setTouchArea(long fingersize_mm) ; |
54 virtual void setTouchArea(long fingersize_mm) ; |
56 virtual QStm_AreaShape getTouchAreaShape() ; |
55 virtual QStm_AreaShape getTouchAreaShape() ; |
68 virtual unsigned int getMoveSuppressTimeout() ; |
67 virtual unsigned int getMoveSuppressTimeout() ; |
69 virtual void setMoveSuppressTimeout(unsigned int a) ; |
68 virtual void setMoveSuppressTimeout(unsigned int a) ; |
70 virtual bool addUiEventObserver(QStm_UiEventObserverIf* observer) ; |
69 virtual bool addUiEventObserver(QStm_UiEventObserverIf* observer) ; |
71 virtual bool removeUiEventObserver(QStm_UiEventObserverIf* observer) ; |
70 virtual bool removeUiEventObserver(QStm_UiEventObserverIf* observer) ; |
72 virtual bool wasLastMessageFiltered(int pointerNumber) ; |
71 virtual bool wasLastMessageFiltered(int pointerNumber) ; |
|
72 virtual bool wasLastMessageFiltered() ; |
73 virtual void enableCapacitiveUp(bool enable) ; |
73 virtual void enableCapacitiveUp(bool enable) ; |
74 virtual void enableLogging(bool aEnable) ; |
74 virtual void enableLogging(bool aEnable) ; |
75 virtual void enableYadjustment(bool aEnable) ; |
75 virtual void enableYadjustment(bool aEnable) ; |
76 virtual int getNumberOfPointers() ; |
76 virtual int getNumberOfPointers() ; |
77 |
77 virtual void enableDblClick(bool aEnable) ; |
78 /* |
78 /* |
79 virtual void setPointerBuffer(TPoint* aBufferPtr, int aBufSize) { m_pointBuffer = aBufferPtr; m_pointBufferSize = aBufSize; } |
79 virtual void setPointerBuffer(TPoint* aBufferPtr, int aBufSize) { m_pointBuffer = aBufferPtr; m_pointBufferSize = aBufSize; } |
80 |
80 |
81 virtual TPoint* getPointerBuffer() { return m_pointBuffer; } |
81 virtual TPoint* getPointerBuffer() { return m_pointBuffer; } |
82 |
82 |
88 |
88 |
89 |
89 |
90 bool handleSymbianPlatformEvent(const QSymbianEvent* platEvent); |
90 bool handleSymbianPlatformEvent(const QSymbianEvent* platEvent); |
91 |
91 |
92 bool handleX11PlatformEvent(const XEvent* platEvent); |
92 bool handleX11PlatformEvent(const XEvent* platEvent); |
|
93 bool handleWinPlatformEvent(const void* platEvent); |
93 |
94 |
94 bool handleStateEvent(const QStm_PlatformPointerEvent& platPointerEvent) ; |
95 bool handleStateEvent(const QStm_PlatformPointerEvent& platPointerEvent) ; |
95 /*! |
96 /*! |
96 * Setting the Y adjustment useful in capacitive touch |
97 * Setting the Y adjustment useful in capacitive touch |
97 * Note that there are problems with the adjustment if done at this level, |
98 * Note that there are problems with the adjustment if done at this level, |
149 bool m_WasMessageFiltered ; |
150 bool m_WasMessageFiltered ; |
150 bool m_wseventmonitoringenabled ; |
151 bool m_wseventmonitoringenabled ; |
151 bool m_loggingenabled ; |
152 bool m_loggingenabled ; |
152 bool m_capacitiveup ; |
153 bool m_capacitiveup ; |
153 bool m_pointerBufferSupported; |
154 bool m_pointerBufferSupported; |
154 |
155 bool m_dblClickEnabled; |
155 |
156 |
156 //TPoint* m_pointBuffer; |
|
157 //int m_pointBufferSize; |
|
158 //int m_pointBufferRetrieved; |
|
159 //int m_currentPointBuffIdx; |
|
160 //CCoeControl* m_destination; |
|
161 //CPeriodic* m_pointBufferTimer; |
|
162 //RArray<TPoint> m_pointBufferPoints; |
|
163 |
157 |
164 int m_3mminpixels ; |
158 int m_3mminpixels ; |
165 bool m_adjustYposition ; |
159 bool m_adjustYposition ; |
|
160 void* m_currentNativeWin; |
|
161 QWidget* m_widget; |
166 // Use same naming scheme with the timers, and variables and methods |
162 // Use same naming scheme with the timers, and variables and methods |
167 // using macro expansion tricks (with multitouch support starts to look quite ugly): |
163 // using macro expansion tricks (with multitouch support starts to look quite ugly): |
168 #define DECLARE_TIMER(x) \ |
164 #define DECLARE_TIMER(x) \ |
169 void start##x##Timer(int aPointerNumber) ;\ |
165 void start##x##Timer(int aPointerNumber) ;\ |
170 QStm_CallbackTimer* m_##x##Timer[KMaxNumberOfPointers] ;\ |
166 QStm_CallbackTimer* m_##x##Timer[KMaxNumberOfPointers] ;\ |
171 void handle##x##Timer(int aPointerNumber) ;\ |
167 void handle##x##Timer(int aPointerNumber) ;\ |
|
168 static void s_handle##x##Timer(QStm_StateMachine* obj, int aPointerNumber) { obj->handle##x##Timer(aPointerNumber); } \ |
172 void cancel##x##Timer(int aPointerNumber) |
169 void cancel##x##Timer(int aPointerNumber) |
173 |
170 |
174 //public slots: |
171 //public slots: |
175 DECLARE_TIMER(touch) ; |
172 DECLARE_TIMER(touch) ; |
176 DECLARE_TIMER(hold) ; |
173 DECLARE_TIMER(hold) ; |