2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUi_UiTouchEvent.h
19 * @brief This is the header file for the _UiTouchEvent class.
21 * This header file contains the declarations of the %_UiTouchEvent class.
24 #ifndef _FUI_INTERNAL_UI_TOUCH_EVENT_H_
25 #define _FUI_INTERNAL_UI_TOUCH_EVENT_H_
28 #include <FUiITouchEventListener.h>
29 #include "FUi_UiEvent.h"
30 #include "FUi_ITouchGestureEventListener.h"
31 #include "FUi_ITouchEventPreviewer.h"
33 namespace Tizen {namespace Ui
38 _TOUCH_PRESSED = TOUCH_PRESSED, /**< Touch pressed event type */
39 _TOUCH_LONG_PRESSED = TOUCH_LONG_PRESSED, /**< Touch long pressed event type */
40 _TOUCH_RELEASED = TOUCH_RELEASED, /**< Touch released event type */
41 _TOUCH_MOVED = TOUCH_MOVED, /**< Touch moved event type */
42 _TOUCH_DOUBLE_PRESSED = TOUCH_DOUBLE_PRESSED, /**< Touch double pressed event type */
43 _TOUCH_FOCUS_IN = TOUCH_FOCUS_IN, /**< Touch focus-in event type */
44 _TOUCH_FOCUS_OUT = TOUCH_FOCUS_OUT, /**< Touch focus-out event type */
45 _TOUCH_CANCELED = TOUCH_CANCELED, /**< Touch canceled event type */
48 class _OSP_EXPORT_ _TouchInfo
52 _TouchInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::Point& current, const bool isFlick, long long timeStamp);
53 _TouchInfo(const _TouchInfo& rhs);
54 _TouchInfo& operator =(const _TouchInfo& rhs);
59 * This method returns the touch status.
62 * @return The touch status
64 _TouchStatus GetTouchStatus(void) const;
67 * This method returns the current position of the touch event.
70 * @return The current position of the touch event
72 Tizen::Graphics::Point GetCurrentPosition(void) const;
75 * This method returns the touch pointId.
78 * @return The touch pointId
80 unsigned long GetPointId(void) const;
82 bool IsFlicked(void) const;
83 long long GetTimeStamp(void) const;
84 void SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::Point& current, bool isFlick, long long timeStamp);
87 unsigned long __pointId;
88 _TouchStatus __touchStatus;
89 Tizen::Graphics::Point __currentPosition;
91 long long __timeStamp;
94 class _ITouchEventListener;
98 * This is internal. If used in an application, the application can get rejected during the certification process.
99 * @class _UiTouchEvent
100 * @brief This class impliments _UiTouchEvent and
101 * fire the Window Event object of a Ui Control.
103 class _OSP_EXPORT_ _UiTouchEvent
109 * This is the default class constructor.
112 _UiTouchEvent(const _UiObjectHandle& destination, const _TouchInfo& touchInfo, _UiEventRouteType routeType = _UI_EVENT_ROUTE_TUNNEL_BUBBLE, const _UiObjectHandle& source = _UiObjectHandle());
113 _UiTouchEvent(const _UiTouchEvent& rhs);
116 * This is the default class destructor.
119 virtual ~_UiTouchEvent(void);
122 _UiTouchEvent& operator =(const _UiTouchEvent& rhs);
125 const _TouchInfo* GetTouchInfo(void) const;
128 virtual _UiTouchEvent* CloneN(void) const;
129 virtual _UiEventType GetEventType(void) const;
130 virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered);
131 virtual result OnEventProcessing(const _Control& control, bool& isFiltered);
132 virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered);
133 virtual result OnEventHandled(const _Control& control);
136 result ProcessGesture(const _Control& control, bool& isFiltered);
137 result FireListener(const _ITouchEventListener* pListener, const _Control* pControl, bool isTouchEvent, bool& isFiltered);
138 result FirePreviewListener(const _ITouchEventPreviewer* pListener, const _Control* pControl, bool& isFiltered);
139 Tizen::Graphics::Point GetRelativePoint(const _Control& control, const Tizen::Graphics::Point& point) const;
140 result ResetTouchInfo(const _Control* pControl, const _TouchInfo& touchInfo);
141 bool ExistGlobalGesture(void);
144 _TouchInfo __touchInfo;
145 std::tr1::shared_ptr<Tizen::Base::Collection::IListT<_Control*> > __pForcedGestureList;
150 #endif //_FUI_INTERNAL_UI_TOUCH_EVENT_H_