Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_DragDropEvent.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_DragDropEvent.h
19  * @brief               This is the header file for _DragDropEvent class.
20  * @version             2.0
21  *
22  * This header file contains declaration of _DragDropEvent class.
23  */
24 #ifndef _FUI_INTERNAL_DRAG_DROP_EVENT_H_
25 #define _FUI_INTERNAL_DRAG_DROP_EVENT_H_
26
27 // includes
28 #include <FOspConfig.h>
29 #include <FBaseResult.h>
30 #include <FBaseRtIEventFilter.h>
31 #include <FBaseRt_Event.h>
32 #include <FBaseRt_EventDispatcher.h>
33 #include <FBaseRtIEventArg.h>
34
35 namespace Tizen { namespace Ui
36 {
37 class Control;
38 } }
39
40 namespace Tizen { namespace Ui
41 {
42 /**
43  *      @enum   DragDropStatus
44  *
45  *      Defines constants used to identify drag drop status.
46  */
47 enum DragDropStatus
48 {
49         DRAG_DROP_INDICATED = 0,        /**< The touch indicated event type     */
50         DRAG_DROP_PRESSED,          /**< The touch pressed event type   */
51         DRAG_DROP_LONG_PRESSED,     /**< The touch long pressed event type      */
52         DRAG_DROP_RELEASED,         /**< The touch released event type  */
53         DRAG_DROP_MOVED,            /**< The touch moved event type     */
54         DRAG_DROP_DOUBLE_PRESSED,   /**< The touch double pressed event type    */
55         DRAG_DROP_FOCUS_IN,         /**< The touch focus-in event type  */
56         DRAG_DROP_FOCUS_OUT,        /**< The touch focus-out event type */
57         DRAG_DROP_FLICKED,          /**< The touch flicked event type   */
58         DRAG_DROP_FLICK_HELD,       /**< The touch flick held event type        */
59         DRAG_DROP_DRAGGED,          /**< The touch dragged event type   */
60         DRAG_DROP_DROPPED           /**< The touch dropped event type   */
61 };
62
63 /**
64  * @class       _DragDropEvent
65  * @brief       This class handles a touch event. It is inherited from LowLevelEvent class.
66  *
67  * The Control class has an instance of the _DragDropEvent class as a member variable.
68  * _DragDropEvent notifies the listeners when a control receives a touch event.
69  *
70  * @since       2.0
71  */
72 class _OSP_EXPORT_ _DragDropEvent
73         : public Tizen::Base::Runtime::_Event
74         , public Tizen::Base::Runtime::IEventFilter
75 {
76 // Lifecycle
77 public:
78         /**
79          * This is the default class constructor. After creating an instance of this
80          * class, you must explicitly call one of construction methods to initialize
81          * the instance.
82          */
83         _DragDropEvent(void);
84
85         /**
86            * This method constructs this _DragDropEvent instance.
87            *
88            * @return            This method returns the error code.
89            * @param[in] source                  The owner of this key event.
90            * @exception E_SUCCESS               - The method is successful.
91            * @exception E_SYSTEM                - The method has failed.
92            * @exception E_ARG_NULL              - @c pSource is @c NULL.
93            */
94         result Construct(const Tizen::Ui::Control& source);
95
96
97         /**
98          * This is the class destructor.
99          */
100         virtual ~_DragDropEvent(void);
101
102
103 // Operations
104 public:
105         /**
106          * This method enables/disables this event. A disabled event can not fire notification.
107          *
108          * @return              This method returns the error code.
109          * @param[in]   enable          Determines the state of this event.
110          * @exception   E_SUCCESS       - This method is successful.
111          * @exception   E_SYSTEM        - This method has failed.
112          */
113         result SetEnabled(bool enable);
114
115
116 // Accessors
117 public:
118         /**
119          * This method returns the owner of this event.
120          *
121          * @return              See the comment above.
122          */
123         const Tizen::Ui::Control* GetSource(void) const;
124
125
126         bool Filter(const Tizen::Base::Runtime::IEventArg& eventArg);
127
128         // due to build error
129         virtual result AddListener(const Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::_EventDispatcher* pEventDispatcher);
130         virtual result Wait(void);
131
132
133 // Operations
134 protected:
135         /**
136          * This method calls appropriate IKeyEventListener method.
137          *
138          * @return              This method returns the error code.
139          * @param[in]   pListener               The IKeyEventListener instance.
140          * @param[in]   arg                             The _DragDropEventArg.
141          * @exception   E_SUCCESS               - The method is successful.
142          * @exception   E_INVALID_ARG   - The argument passed to a method contains an invalid value.
143          * @exception   E_INVALID_ARG   - @c pListener is @c NULL.
144          */
145         virtual result FireImpl(Tizen::Base::Runtime::IEventListener* pListener, const Tizen::Base::Runtime::IEventArg& arg);
146
147 private:
148         /**
149          *      The event source.
150          */
151         Tizen::Ui::Control* __pSource;
152
153 }; // _DragDropEvent
154
155 } } // Tizen::Ui
156
157 #endif //_FUI_INTERNAL_DRAG_DROP_EVENT_H_