Revert "[Tizen] Import Extension::Capture to support backward compatibility"
[platform/core/uifw/dali-extension.git] / dali-extension / internal / evas-plugin / evas-event-handler.h
1 #ifndef __DALI_EXTENSION_INTERNAL_EVAS_EVENT_HANDLER__
2 #define __DALI_EXTENSION_INTERNAL_EVAS_EVENT_HANDLER__
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <Evas.h>
23
24 #include <Elementary.h>
25 #include <Ecore_Wl2.h>
26 #include <Ecore_Input.h>
27 #include <Ecore_IMF.h>
28 #include <Ecore_IMF_Evas.h>
29
30 #include <dali/public-api/events/touch-point.h>
31 #include <dali/public-api/events/wheel-event.h>
32 #include <dali/public-api/events/key-event.h>
33 #include <dali/public-api/math/rect.h>
34 // #include <dali/integration-api/adaptors/input-method-context.h>
35
36 #include <string>
37
38 // INTERNAL INCLUDES
39 #include "evas-plugin-event-interface.h"
40
41
42
43 namespace Dali
44 {
45 template <typename T>
46 class Rect;
47
48 struct TouchPoint;
49 struct WheelEvent;
50 struct KeyEvent;
51
52 namespace Extension
53 {
54
55 namespace Internal
56 {
57
58 class EvasPluginEventInterface;
59
60 class EvasEventHandler
61 {
62 public:
63   /**
64    * @brief Constructor
65    *
66    * @param[in] imageEvasObject is stream showing the pixmap which is drawn by dali
67    *
68    *
69    * @param[in] evasPluginEventInterface Used to send event to evas plugin
70    */
71   EvasEventHandler(Evas_Object* imageEvasObject,
72                    Evas_Object* elmAccessEvasObject,
73                    Evas_Object* elmFocusEvasObject,
74                    EvasPluginEventInterface& evasPluginEventInterface);
75
76   /**
77    * Destructor.
78    */
79   ~EvasEventHandler();
80
81 public:
82
83   EvasPluginEventInterface& GetEvasPluginInterface() { return mEvasPluginEventInterface; }
84
85 private:
86
87   /////////////////////////////////////////////////////////////////////////////////////////////////////
88   // Event callbacks
89   /////////////////////////////////////////////////////////////////////////////////////////////////////
90
91   /**
92    * @brief Called when the mouse down is received
93    */
94   static void OnEvasObjectMouseDown(void *data, Evas* evas, Evas_Object* evasObject, void* event);
95
96   /**
97    * @brief Called when the mouse up is received
98    */
99   static void OnEvasObjectMouseUp(void *data, Evas* evas, Evas_Object* evasObject, void* event);
100
101   /**
102    * @brief Called when the mouse move is received
103    */
104   static void OnEvasObjectMouseMove(void *data, Evas* evas, Evas_Object* evasObject, void* event);
105
106   /**
107    * @brief Called when the mouse wheel is received
108    */
109   static void OnEvasObjectMouseWheel(void *data, Evas* evas, Evas_Object* evasObject, void* event);
110
111   /**
112    * @brief Called when the multi-touch down is received
113    */
114   static void OnEvasObjectMultiTouchDown(void *data, Evas* evas, Evas_Object* evasObject, void* event);
115
116   /**
117    * @brief Called when the multi-touch up is received
118    */
119   static void OnEvasObjectMultiTouchUp(void *data, Evas* evas, Evas_Object* evasObject, void* event);
120
121   /**
122    * @brief Called when the multi-touch move is received
123    */
124   static void OnEvasObjectMultiTouchMove(void *data, Evas* evas, Evas_Object* evasObject, void* event);
125
126   /**
127    * @brief Called when key down is received
128    */
129   static void OnEvasObjectKeyDown(void *data, Evas* evas, Evas_Object* evasObject, void* event);
130
131   /**
132    * @brief Called when key up is received
133    */
134   static void OnEvasObjectKeyUp(void *data, Evas* evas, Evas_Object* evasObject, void* event);
135
136   /////////////////////////////////////////////////////////////////////////////////////////////////////
137   // Geometry callbacks
138   /////////////////////////////////////////////////////////////////////////////////////////////////////
139
140   /**
141    * @brief Called when move is received
142    */
143   static void OnEvasObjectMove(void *data, Evas* evas, Evas_Object* evasObject, void* event);
144
145   /**
146    * @brief Called when resize is received
147    */
148   static void OnEvasObjectResize(void *data, Evas* evas, Evas_Object* evasObject, void* event);
149
150   /////////////////////////////////////////////////////////////////////////////////////////////////////
151   // Focus callbacks
152   /////////////////////////////////////////////////////////////////////////////////////////////////////
153
154   /**
155    * @brief Called when evas object focus in is received
156    */
157   static void OnEvasObjectFocusIn(void *data, Evas* evas, Evas_Object* evasObject, void* event);
158
159   /**
160    * @brief Called when evas object focus out is received
161    */
162   static void OnEvasObjectFocusOut(void *data, Evas* evas, Evas_Object* evasObject, void* event);
163
164   /**
165    * @brief Called when evas focus in is received
166    */
167   static void OnEvasFocusIn(void *data, Evas* evas, void* event);
168
169   /**
170    * @brief Called when evas focus out is received
171    */
172   static void OnEvasFocusOut(void *data, Evas* evas, void* event);
173
174   /////////////////////////////////////////////////////////////////////////////////////////////////////
175   // Render callbacks
176   /////////////////////////////////////////////////////////////////////////////////////////////////////
177
178   /**
179    * @brief Called when evas render post
180    */
181   static void OnEvasRenderPost(void *data, Evas* evas, void* event);
182
183   /////////////////////////////////////////////////////////////////////////////////////////////////////
184   // Elm Access callbacks
185   /////////////////////////////////////////////////////////////////////////////////////////////////////
186
187   static Eina_Bool OnElmAccessActionHighlight(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
188
189   static Eina_Bool OnElmAccessActionUnhighlight(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
190
191   static Eina_Bool OnElmAccessActionHighlightNext(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
192
193   static Eina_Bool OnElmAccessActionHighlightPrev(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
194
195   static Eina_Bool OnElmAccessActionActivate(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
196
197   static Eina_Bool OnElmAccessActionScroll(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
198
199   static Eina_Bool OnElmAccessActionUp(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
200
201   static Eina_Bool OnElmAccessActionDown(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
202
203   static Eina_Bool OnElmAccessActionBack(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
204
205   static Eina_Bool OnElmAccessActionRead(void* data, Evas_Object* evasObject, Elm_Access_Action_Info* info);
206
207   /////////////////////////////////////////////////////////////////////////////////////////////////////
208   // Elm Focus callbacks
209   /////////////////////////////////////////////////////////////////////////////////////////////////////
210
211   static void OnEvasObjectSmartFocused(void *data, Evas_Object* evasObject, void* event);
212
213   static void OnEvasObjectSmartUnfocused(void *data, Evas_Object* evasObject, void* event);
214
215 private:
216   EvasPluginEventInterface& mEvasPluginEventInterface;
217
218   Evas* mEvas;
219   Evas_Object* mImageEvasObject;
220   Evas_Object* mElmAccessEvasObject;
221   Evas_Object* mElmFocusEvasObject;
222 };
223
224 }  // namespace Internal
225
226 }  // namespace Extension
227
228 }  // namespace Dali
229
230 #endif