Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_TouchEventArg.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 * @file                 FUi_TouchEventArg.h
19 * @brief                This is the header file for _TouchEventArg class.
20 * @version              2.0
21 *
22 * This header file contains declarations of _TouchEventArg class.
23 */
24
25 #ifndef _FUI_TOUCH_EVENT_ARG_H_
26 #define _FUI_TOUCH_EVENT_ARG_H_
27
28 // includes
29 #include <FOspConfig.h>
30 #include <FBaseObject.h>
31 #include <FBaseRt_Event.h>
32 #include <FBaseRtIEventArg.h>
33 #include <FGrpPoint.h>
34 #include "FUi_UiTouchEvent.h"
35
36
37 namespace Tizen { namespace Ui
38 {
39
40 /**
41  * @class       _TouchEventArg
42  *
43  * @brief       This class is used as tje argument to touch event listener.
44  *
45  * This class is used as the argument of touch event listener. When touch event event is generated,
46  * the @c TouchEvent instance calls the registered ITouchEventListener with an instance of this
47  * class as the argument.
48  *
49  */
50 class _TouchEventArg
51         : public Tizen::Base::Object
52         , public Tizen::Base::Runtime::IEventArg
53 {
54 // Lifecycle
55 public:
56         /**
57          * This is the default class constructor.
58          *
59          * @param[in]   source          - A pointer to the Object instance which contains this instance.
60          * @param[in]   status                  - TouchStatus
61          */
62         _TouchEventArg(const Tizen::Ui::Control& source, _TouchStatus status);
63
64
65         /**
66          * This is the class destructor.
67          */
68         virtual ~_TouchEventArg(void);
69
70
71 // Access
72 public:
73         /**
74         * This method returns the object which the event initially occurred.
75         *
76         * @return       The object  which the event initially occurred.
77         */
78         const Tizen::Ui::Control* GetSource(void) const;
79
80         /**
81         * This method sets the positions of touch event on the window rectangle coordination.
82         * @param[in]    PointId         - PointId of the touch event
83         * @param[in]    startX          - x coordinate of the original touch pressed event
84         * @param[in]    startY          - y coordinate of the original touch pressed event
85         * @param[in]    currentX  - x coordinate of the current touch event
86         * @param[in]    currentY        - y coordinate of the currenttouch event
87         */
88         void SetTouchPosition(unsigned long PointId, int startX, int startY, int currentX, int currentY);
89
90         /**
91          * This method returns the touch id
92          *
93          * @return      see the above
94          */
95         unsigned long GetPointId(void) const;
96
97         /**
98          * This method returns the touch status
99          *
100          * @return      see the above
101          */
102         _TouchStatus GetTouchStatus(void) const;
103
104         /**
105          * This method returns the start position of touch pressed event on the window rectangle coordination.
106          *
107          * @return      see the above
108          */
109         const Tizen::Graphics::Point GetStartPosition(void) const;
110
111         /**
112          * This method returns the current position of touch event on the window rectangle coordination.
113          *
114          * @return      see the above
115          */
116         const Tizen::Graphics::Point GetCurrentPosition(void) const;
117
118         /**
119         * This method sets the positions of touch event on the window rectangle coordination.
120         *
121         * @param[in]    isFlicked               - Flag whether it is flicked.
122         */
123         void SetFlickedStatus(bool isFlicked);
124
125         /**
126         * This method returns the flicked status
127         *
128         * @return       see the above
129         */
130         bool IsFlicked(void) const;
131
132 // Attributes
133 private:
134         unsigned long __PointId;
135         Tizen::Ui::Control* __pSource;
136         _TouchStatus __touchStatus;
137         Tizen::Graphics::Point __startPosition;
138         Tizen::Graphics::Point __currentPosition;
139         bool __isFlicked;
140 }; // _TouchEventArg
141
142 } } // Tizen::Ui
143
144 #endif // _FUI_TOUCH_EVENT_ARG_H_