Tizen 2.1 base
[framework/osp/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
32 namespace Tizen { namespace Base { namespace Runtime
33 {
34 class IEventArg;
35 }}}
36
37 namespace Tizen { namespace Ui
38 {
39
40 class _TouchEventInfoImpl;
41
42 /**
43  *      @enum   TouchStatus
44  *
45  *      Defines constants used to identify touch status.
46  *
47  * @since       2.0
48  */
49 enum TouchStatus
50 {
51         TOUCH_PRESSED,          /**< The touch pressed event type       */
52         TOUCH_LONG_PRESSED,     /**< The touch long pressed event type  */
53         TOUCH_RELEASED,         /**< The touch released event type      */
54         TOUCH_MOVED,            /**< The touch moved event type */
55         TOUCH_DOUBLE_PRESSED,   /**< The touch double pressed event type        */
56         TOUCH_FOCUS_IN,         /**< The touch focus-in event type      */
57         TOUCH_FOCUS_OUT,        /**< The touch focus-out event type     */
58         TOUCH_CANCELED, /**< The touch canceled event type      */
59 };
60
61 /**
62  * @class               TouchEventInfo
63  * @brief               This class stores the information of each touch events.
64  *
65  * @since               2.0
66  *
67  * @final        This class is not intended for extension.
68  *
69  * The %TouchEventInfo class provides the touch event information: touch position, status, ID, and so on.
70  * @see     ITouchEventListener, ITouchEventListener::OnTouchPressed(), @if OSPDEREC ITouchEventListener::OnTouchLongPressed(), @endif ITouchEventListener::OnTouchReleased(), ITouchEventListener::OnTouchMoved(), @if OSPDEPREC ITouchEventListener::OnTouchDoublePressed(), @endif   ITouchEventListener::OnTouchFocusIn(), ITouchEventListener::OnTouchFocusOut()
71  *
72  */
73 class _OSP_EXPORT_ TouchEventInfo
74         : public Tizen::Base::Object
75 {
76 public:
77         /**
78          * This is the default constructor for this class.
79          *
80          * @since               2.0
81          */
82         TouchEventInfo(void);
83
84         /**
85          * This destructor overrides Tizen::Base::Object::~Object().
86          *
87          * @since               2.0
88          */
89         virtual ~TouchEventInfo(void);
90
91         //
92         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
93         //
94         //
95         // Initializes this instance of %TouchEventInfo with the specified parameters.
96         //
97         // @since               2.0
98         // @return              An error code
99         // @param[in]   eventArg                The touch event argument
100         //
101         result Construct(const Tizen::Base::Runtime::IEventArg& eventArg);
102
103         /**
104          * Gets the ID of the current touch event.
105          *
106          * @since       2.0
107          *
108          * @return      The ID of the current touch event
109          */
110         unsigned long GetPointId(void) const;
111
112         /**
113          * Gets the start position of the touch event.
114          *
115          * @since       2.0
116          *
117          * @return      The start position of the touch event
118          */
119         Tizen::Graphics::Point GetStartPosition(void) const;
120
121         /**
122          * Gets the current position of the touch event.
123          *
124          * @since       2.0
125          *
126          * @return      The current position of the touch event
127          */
128         Tizen::Graphics::Point GetCurrentPosition(void) const;
129
130         /**
131          * Gets the touch status.
132          *
133          * @since       2.0
134          *
135          * @return  The touch status
136          */
137         TouchStatus GetTouchStatus(void) const;
138
139         /**
140          * Checks whether the touch status is flick.
141          *
142          * @since       2.0
143          *
144          * @return      @c true if the touch status is flick, @n
145          *              else @c false
146          */
147         bool IsFlicked(void) const;
148
149 private:
150         //
151         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
152         //
153         TouchEventInfo(const TouchEventInfo&);
154
155         //
156         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
157         //
158         TouchEventInfo& operator =(const TouchEventInfo&);
159
160 private:
161         _TouchEventInfoImpl* __pTouchEventInfoImpl;
162 }; // TouchEventInfo
163
164 }} //Tizen::Ui
165
166 #endif // _FUI_TOUCH_EVENT_INFO_H_