Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiTouchEventInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file            FUiTouchEventInfo.h
20  * @brief               This is the header file for the %TouchEventInfo class.
21  *
22  * This header file contains the declarations of the %TouchEventInfo class.
23  *
24  */
25
26 #ifndef _FUI_TOUCH_EVENT_INFO_H_
27 #define _FUI_TOUCH_EVENT_INFO_H_
28
29 #include <FBaseObject.h>
30 #include <FGrpPoint.h>
31 #include <FGrpFloatPoint.h>
32
33 namespace Tizen { namespace Base { namespace Runtime
34 {
35 class IEventArg;
36 } } }
37
38 namespace Tizen { namespace Ui
39 {
40
41 class _TouchEventInfoImpl;
42
43 /**
44  *      @enum   TouchStatus
45  *
46  *      Defines constants used to identify touch status.
47  *
48  * @since       2.0
49  */
50 enum TouchStatus
51 {
52         TOUCH_PRESSED,          /**< The touch pressed event type       */
53         TOUCH_LONG_PRESSED,     /**< The touch long pressed event type  */
54         TOUCH_RELEASED,         /**< The touch released event type      */
55         TOUCH_MOVED,            /**< The touch moved event type */
56         TOUCH_DOUBLE_PRESSED,   /**< The touch double pressed event type        */
57         TOUCH_FOCUS_IN,         /**< The touch focus-in event type      */
58         TOUCH_FOCUS_OUT,        /**< The touch focus-out event type     */
59         TOUCH_CANCELED, /**< The touch canceled event type      */
60 };
61
62 /**
63  * @class               TouchEventInfo
64  * @brief               This class stores the information of each touch events.
65  *
66  * @since               2.0
67  *
68  * @final        This class is not intended for extension.
69  *
70  * The %TouchEventInfo class provides the touch event information: touch position, status, ID, and so on.
71  * @see ITouchEventListener::OnTouchPressed()
72  * @see         ITouchEventListener::OnTouchReleased()
73  * @see ITouchEventListener::OnTouchMoved()
74  * @see ITouchEventListener::OnTouchFocusIn()
75  * @see ITouchEventListener::OnTouchFocusOut()
76  * @if OSPDEPREC
77  * @see ITouchEventListener::OnTouchLongPressed()
78  * @see ITouchEventListener::OnTouchDoublePressed()
79  * @endif
80  *
81  */
82 class _OSP_EXPORT_ TouchEventInfo
83         : public Tizen::Base::Object
84 {
85 public:
86         /**
87          * This is the default constructor for this class.
88          *
89          * @since               2.0
90          */
91         TouchEventInfo(void);
92
93         /**
94          * This destructor overrides Tizen::Base::Object::~Object().
95          *
96          * @since               2.0
97          */
98         virtual ~TouchEventInfo(void);
99
100         //
101         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
102         //
103         //
104         // Initializes this instance of %TouchEventInfo with the specified parameters.
105         //
106         // @since               2.0
107         // @return              An error code
108         // @param[in]   eventArg                The touch event argument
109         //
110         result Construct(const Tizen::Base::Runtime::IEventArg& eventArg);
111
112         /**
113          * Gets the ID of the current touch event.
114          *
115          * @since       2.0
116          *
117          * @return      The ID of the current touch event
118          */
119         unsigned long GetPointId(void) const;
120
121         /**
122          * Gets the start position of the touch event.
123          *
124          * @since       2.0
125          *
126          * @return      The start position of the touch event
127          */
128         Tizen::Graphics::Point GetStartPosition(void) const;
129
130         /**
131          * Gets the start position of the touch event.
132          *
133          * @since       2.1
134          *
135          * @return      The start position of the touch event
136          */
137         Tizen::Graphics::FloatPoint GetStartPositionF(void) const;
138
139         /**
140          * Gets the current position of the touch event.
141          *
142          * @since       2.0
143          *
144          * @return      The current position of the touch event
145          */
146         Tizen::Graphics::Point GetCurrentPosition(void) const;
147
148         /**
149          * Gets the current position of the touch event.
150          *
151          * @since       2.1
152          *
153          * @return      The current position of the touch event
154          */
155         Tizen::Graphics::FloatPoint GetCurrentPositionF(void) const;
156
157         /**
158          * Gets the touch status.
159          *
160          * @since       2.0
161          *
162          * @return  The touch status
163          */
164         TouchStatus GetTouchStatus(void) const;
165
166         /**
167          * Checks whether the touch status is flick.
168          *
169          * @since       2.0
170          *
171          * @return      @c true if the touch status is flick, @n
172          *              else @c false
173          */
174         bool IsFlicked(void) const;
175
176 private:
177         //
178         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
179         //
180         TouchEventInfo(const TouchEventInfo&);
181
182         //
183         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
184         //
185         TouchEventInfo& operator =(const TouchEventInfo&);
186
187 private:
188         _TouchEventInfoImpl* __pTouchEventInfoImpl;
189 }; // TouchEventInfo
190
191 } } //Tizen::Ui
192
193 #endif // _FUI_TOUCH_EVENT_INFO_H_