N_SE-47263 : reset touch cancel when indicator touch released/N_SE-51832 : fix checki...
[platform/framework/native/uifw.git] / inc / FUiIFocusEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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                        FUiIFocusEventListener.h
20  * @brief               This is the header file for the %IFocusEventListener interface.
21  *
22  * This header file contains the declarations of the %IFocusEventListener interface.
23  */
24
25 #ifndef _FUI_IFOCUS_EVENT_LISTENER_H_
26 #define _FUI_IFOCUS_EVENT_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29
30 namespace Tizen { namespace Ui
31 {
32
33 class Control;
34
35 //
36 //@enum         FocusStatus
37 //Defines       constants used to identify focus status.
38 //@since                        2.0
39 //
40
41 enum FocusStatus
42 {
43         FOCUS_GAINED = 0,   // The Control has gained focus
44         FOCUS_LOST = 1      // The Control has lost focus
45 };
46
47 /**
48  * @interface           IFocusEventListener
49  * @brief                       This interface is used as the argument to focus the event listener.
50  *
51  * @since                       2.0
52  *
53  * The %IFocusEventListener interface is the listener interface for receiving focus events.
54  * The class that processes a focus event implements this interface, and the instance created with that class is registered with a
55  * UI control, using the Control::AddFocusEventListener() method. When the focus event occurs, a method of that instance is
56  * invoked.
57  * @n
58  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
59  */
60 class _OSP_EXPORT_ IFocusEventListener
61         : public Tizen::Base::Runtime::IEventListener
62 {
63 public:
64         /**
65          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
66          *
67          * @since       2.0
68          *
69          */
70         virtual ~IFocusEventListener(void) {}
71
72         /**
73          * Called when Control gains the input focus.
74          *
75          * @since                               2.0
76          *
77          * @param[in]   source          The source of the event
78          */
79         virtual void OnFocusGained(const Tizen::Ui::Control& source) = 0;
80
81         /**
82          * Called when Control loses the input focus.
83          *
84          * @since                               2.0
85          *
86          * @param[in]   source          The source of the event
87          */
88         virtual void OnFocusLost(const Tizen::Ui::Control& source) = 0;
89
90 protected:
91         //
92         // This method is for internal use only. Using this method can cause behavioral, security-related,
93         // and consistency-related issues in the application.
94         //
95         // This method is reserved and may change its name at any time without
96         // prior notice.
97         //
98         virtual void IFocusEventListener_Reserved1(void) {}
99
100         //
101         // This method is for internal use only. Using this method can cause behavioral, security-related,
102         // and consistency-related issues in the application.
103         //
104         // This method is reserved and may change its name at any time without
105         // prior notice.
106         //
107         virtual void IIFocusEventListener_Reserved2(void) {}
108
109         //
110         // This method is for internal use only. Using this method can cause behavioral, security-related,
111         // and consistency-related issues in the application.
112         //
113         // This method is reserved and may change its name at any time without
114         // prior notice.
115         //
116         virtual void IIFocusEventListener_Reserved3(void) {}
117 }; // IFocusEventListener
118
119 }} // Tizen::Ui
120
121 #endif // _FUI_IFOCUS_EVENT_LISTENER_H_