Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_DragDropEventArg.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_DragDropEventArg.h
19 * @brief                This is the header file for _DragDropEventArg class.
20 * @since                2.0
21 *
22 * This header file contains declarations of _DragDropEventArg class.
23 */
24
25 #ifndef _FUI_DRAG_DROP_EVENT_ARG_H_
26 #define _FUI_DRAG_DROP_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_DragDropEvent.h"
35
36
37 namespace Tizen { namespace Ui
38 {
39 /**
40  * @class       _DragDropEventArg
41  *
42  * @brief       This class is used as the argument to drag drop event listener.
43  *
44  * This class is used as the argument of drag drop event listener. When drag drop event event is generated,
45  * the @c DragDropEvent instance calls the registered IDragDropEventListener with an instance of this
46  * class as the argument.
47  *
48  */
49 class _OSP_EXPORT_ _DragDropEventArg
50         : public Tizen::Base::Object
51         , public Tizen::Base::Runtime::IEventArg
52 {
53 // Lifecycle
54 public:
55         /**
56          * This is the default class constructor.
57          *
58          * @param[in]   source          - A pointer to the Object instance which contains this instance.
59          * @param[in]   status                  - DragDropStatus
60          */
61         _DragDropEventArg(const Tizen::Ui::Control& source, DragDropStatus status);
62
63
64         /**
65          * This is the class destructor.
66          */
67         virtual ~_DragDropEventArg(void);
68
69 // Access
70 public:
71         /**
72         * This method returns the object which the event initially occurred.
73         *
74         * @return       The object  which the event initially occurred.
75         */
76         const Tizen::Ui::Control* GetSource(void) const;
77
78         /**
79          * This method returns the touch status
80          *
81          * @return      see the above
82          */
83         DragDropStatus GetDragDropStatus(void) const;
84
85         /**
86          * This method returns the start position of touch pressed event on the window rectangle coordination.
87          *
88          * @return      see the above
89          */
90         const Tizen::Graphics::Point GetStartPosition(void) const;
91
92         /**
93          * This method returns the current position of touch event on the window rectangle coordination.
94          *
95          * @return      see the above
96          */
97         const Tizen::Graphics::Point GetCurrentPosition(void) const;
98
99         /**
100          * This method sets the dragged controls pointer.
101          *
102          * @return      see the above
103          */
104
105         result SetDraggedControl(const Tizen::Ui::Control* pDraggedControl);
106
107         /**
108          * This method returns the dragged controls pointer.
109          *
110          * @return      see the above
111          */
112         const Tizen::Ui::Control* GetDraggedControl(void) const;
113
114         /**
115          * This method sets the positions of touch event on the window rectangle coordination.
116          *
117          * @param[in]   startX          - x coordinate of the original touch pressed event
118          * @param[in]   startY          - y coordinate of the original touch pressed event
119          * @param[in]   currentX  - x coordinate of the current touch event
120          * @param[in]   currentY        - y coordinate of the currenttouch event
121          * @return      The method returns error code.
122          * @exception   E_SUCCESS       - This method is successful.
123          */
124         result SetTouchPosition(int startX, int startY, int currentX, int currentY);
125
126
127 // Attributes
128 private:
129         Tizen::Ui::Control* __pSource; // destination
130         Tizen::Ui::Control* __pDraggedControl;
131
132
133         DragDropStatus __dragDropStatus;
134         Tizen::Graphics::Point __startPosition;
135         Tizen::Graphics::Point __currentPosition;
136 }; // _DragDropEventArg
137
138 } } // Tizen::Ui
139
140 #endif // _FUI_DRAG_DROP_EVENT_ARG_H_