[NUI] Add InterceptWheelEvent
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewEvent.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21
22 namespace Tizen.NUI.BaseComponents
23 {
24     /// <summary>
25     /// View is the base class for all views.
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     public partial class View
29     {
30         private EventHandler offWindowEventHandler;
31         private OffWindowEventCallbackType offWindowEventCallback;
32         private EventHandlerWithReturnType<object, WheelEventArgs, bool> interceptWheelHandler;
33         private WheelEventCallbackType interceptWheelCallback;
34         private EventHandlerWithReturnType<object, WheelEventArgs, bool> wheelEventHandler;
35         private WheelEventCallbackType wheelEventCallback;
36         private EventHandlerWithReturnType<object, KeyEventArgs, bool> keyEventHandler;
37         private KeyCallbackType keyCallback;
38         private EventHandlerWithReturnType<object, TouchEventArgs, bool> interceptTouchDataEventHandler;
39         private TouchDataCallbackType interceptTouchDataCallback;
40         private EventHandlerWithReturnType<object, TouchEventArgs, bool> touchDataEventHandler;
41         private TouchDataCallbackType touchDataCallback;
42         private EventHandlerWithReturnType<object, HoverEventArgs, bool> hoverEventHandler;
43         private HoverEventCallbackType hoverEventCallback;
44         private EventHandler<VisibilityChangedEventArgs> visibilityChangedEventHandler;
45         private VisibilityChangedEventCallbackType visibilityChangedEventCallback;
46         private EventHandler keyInputFocusGainedEventHandler;
47
48         private KeyInputFocusGainedCallbackType keyInputFocusGainedCallback;
49         private EventHandler keyInputFocusLostEventHandler;
50
51         private KeyInputFocusLostCallbackType keyInputFocusLostCallback;
52         private EventHandler onRelayoutEventHandler;
53         private OnRelayoutEventCallbackType onRelayoutEventCallback;
54         private EventHandler onWindowEventHandler;
55         private OnWindowEventCallbackType onWindowEventCallback;
56         private EventHandler<LayoutDirectionChangedEventArgs> layoutDirectionChangedEventHandler;
57         private LayoutDirectionChangedEventCallbackType layoutDirectionChangedEventCallback;
58         // Resource Ready Signal
59         private EventHandler resourcesLoadedEventHandler;
60         private ResourcesLoadedCallbackType resourcesLoadedCallback;
61         private EventHandler<BackgroundResourceLoadedEventArgs> backgroundResourceLoadedEventHandler;
62         private _backgroundResourceLoadedCallbackType backgroundResourceLoadedCallback;
63         private TouchDataCallbackType hitTestResultDataCallback;
64
65         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
66         private delegate void OffWindowEventCallbackType(IntPtr control);
67         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
68         private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
69         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
70         private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent);
71         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
72         private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData);
73         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
74         private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent);
75         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
76         private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type);
77         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
78         private delegate void ResourcesLoadedCallbackType(IntPtr control);
79         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
80         private delegate void _backgroundResourceLoadedCallbackType(IntPtr view);
81
82         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
83         private delegate void KeyInputFocusGainedCallbackType(IntPtr control);
84         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
85         private delegate void KeyInputFocusLostCallbackType(IntPtr control);
86
87         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
88         private delegate void OnRelayoutEventCallbackType(IntPtr control);
89         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
90         private delegate void OnWindowEventCallbackType(IntPtr control);
91         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
92         private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type);
93
94         /// <summary>
95         /// Event when a child is removed.
96         /// </summary>
97         /// <since_tizen> 5 </since_tizen>
98         public new event EventHandler<ChildRemovedEventArgs> ChildRemoved;
99         /// <summary>
100         /// Event when a child is added.
101         /// </summary>
102         /// <since_tizen> 5 </since_tizen>
103         public new event EventHandler<ChildAddedEventArgs> ChildAdded;
104
105         /// <summary>
106         /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
107         /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.<br />
108         /// </summary>
109         /// <since_tizen> 3 </since_tizen>
110         public event EventHandler FocusGained
111         {
112             add
113             {
114                 if (keyInputFocusGainedEventHandler == null)
115                 {
116                     keyInputFocusGainedCallback = OnKeyInputFocusGained;
117                     Interop.ViewSignal.KeyInputFocusGainedConnect(SwigCPtr, keyInputFocusGainedCallback.ToHandleRef(this));
118                     NDalicPINVOKE.ThrowExceptionIfExists();
119                 }
120                 keyInputFocusGainedEventHandler += value;
121             }
122
123             remove
124             {
125                 keyInputFocusGainedEventHandler -= value;
126                 if (keyInputFocusGainedEventHandler == null && keyInputFocusGainedCallback != null)
127                 {
128                     Interop.ViewSignal.KeyInputFocusGainedDisconnect(SwigCPtr, keyInputFocusGainedCallback.ToHandleRef(this));
129                     NDalicPINVOKE.ThrowExceptionIfExists();
130                     keyInputFocusGainedCallback = null;
131                 }
132             }
133         }
134
135         /// <summary>
136         /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
137         /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.<br />
138         /// </summary>
139         /// <since_tizen> 3 </since_tizen>
140         public event EventHandler FocusLost
141         {
142             add
143             {
144                 if (keyInputFocusLostEventHandler == null)
145                 {
146                     keyInputFocusLostCallback = OnKeyInputFocusLost;
147                     Interop.ViewSignal.KeyInputFocusLostConnect(SwigCPtr, keyInputFocusLostCallback.ToHandleRef(this));
148                     NDalicPINVOKE.ThrowExceptionIfExists();
149                 }
150                 keyInputFocusLostEventHandler += value;
151             }
152
153             remove
154             {
155                 keyInputFocusLostEventHandler -= value;
156                 if (keyInputFocusLostEventHandler == null && keyInputFocusLostCallback != null)
157                 {
158                     Interop.ViewSignal.KeyInputFocusLostDisconnect(SwigCPtr, keyInputFocusLostCallback.ToHandleRef(this));
159                     NDalicPINVOKE.ThrowExceptionIfExists();
160                     keyInputFocusLostCallback = null;
161                 }
162             }
163         }
164
165         /// <summary>
166         /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
167         /// The KeyPressed signal is emitted when the key event is received.<br />
168         /// </summary>
169         /// <since_tizen> 3 </since_tizen>
170         public event EventHandlerWithReturnType<object, KeyEventArgs, bool> KeyEvent
171         {
172             add
173             {
174                 if (keyEventHandler == null)
175                 {
176                     keyCallback = OnKeyEvent;
177                     Interop.ViewSignal.KeyEventConnect(SwigCPtr, keyCallback.ToHandleRef(this));
178                     NDalicPINVOKE.ThrowExceptionIfExists();
179                 }
180                 keyEventHandler += value;
181             }
182
183             remove
184             {
185                 keyEventHandler -= value;
186                 if (keyEventHandler == null && keyCallback != null)
187                 {
188                     Interop.ViewSignal.KeyEventDisconnect(SwigCPtr, keyCallback.ToHandleRef(this));
189                     NDalicPINVOKE.ThrowExceptionIfExists();
190                     keyCallback = null;
191                 }
192             }
193         }
194
195         /// <summary>
196         /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.<br />
197         /// The OnRelayout signal is emitted after the size has been set on the view during relayout.<br />
198         /// </summary>
199         /// <since_tizen> 3 </since_tizen>
200         public event EventHandler Relayout
201         {
202             add
203             {
204                 if (onRelayoutEventHandler == null)
205                 {
206                     onRelayoutEventCallback = OnRelayout;
207                     Interop.ActorSignal.OnRelayoutConnect(SwigCPtr, onRelayoutEventCallback.ToHandleRef(this));
208                     NDalicPINVOKE.ThrowExceptionIfExists();
209                 }
210                 onRelayoutEventHandler += value;
211             }
212
213             remove
214             {
215                 onRelayoutEventHandler -= value;
216                 if (onRelayoutEventHandler == null && onRelayoutEventCallback != null)
217                 {
218                     Interop.ActorSignal.OnRelayoutDisconnect(SwigCPtr, onRelayoutEventCallback.ToHandleRef(this));
219                     NDalicPINVOKE.ThrowExceptionIfExists();
220                     onRelayoutEventCallback = null;
221                 }
222             }
223         }
224
225         /// <summary>
226         /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
227         /// The touched signal is emitted when the touch input is received.<br />
228         /// This can receive touch events before child. <br />
229         /// If it returns false, the child can receive the touch event. If it returns true, the touch event is intercepted. So child cannot receive touch event.<br />
230         /// </summary>
231         [EditorBrowsable(EditorBrowsableState.Never)]
232         public event EventHandlerWithReturnType<object, TouchEventArgs, bool> InterceptTouchEvent
233         {
234             add
235             {
236                 if (interceptTouchDataEventHandler == null)
237                 {
238                     interceptTouchDataCallback = OnInterceptTouch;
239                     Interop.ActorSignal.InterceptTouchConnect(SwigCPtr, interceptTouchDataCallback.ToHandleRef(this));
240                     NDalicPINVOKE.ThrowExceptionIfExists();
241                 }
242                 interceptTouchDataEventHandler += value;
243             }
244
245             remove
246             {
247                 interceptTouchDataEventHandler -= value;
248                 if (interceptTouchDataEventHandler == null && interceptTouchDataCallback != null)
249                 {
250                     Interop.ActorSignal.InterceptTouchDisconnect(SwigCPtr, interceptTouchDataCallback.ToHandleRef(this));
251                     NDalicPINVOKE.ThrowExceptionIfExists();
252                     interceptTouchDataCallback = null;
253                 }
254             }
255         }
256
257         /// <summary>
258         /// If child view doesn't want the parent's view to intercept the touch, you can set it to true.
259         /// for example :
260         ///    parent.Add(child);
261         ///    parent.InterceptTouchEvent += OnInterceptTouchEvent;
262         ///    View view = child.GetParent() as View;
263         ///    view.DisallowInterceptTouchEvent = true;
264         ///  This prevents the parent from intercepting touch.
265         /// </summary>
266         [EditorBrowsable(EditorBrowsableState.Never)]
267         public bool DisallowInterceptTouchEvent { get; set; }
268
269
270         /// <summary>
271         /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
272         /// The touched signal is emitted when the touch input is received.<br />
273         /// </summary>
274         /// <since_tizen> 3 </since_tizen>
275         public event EventHandlerWithReturnType<object, TouchEventArgs, bool> TouchEvent
276         {
277             add
278             {
279                 if (touchDataEventHandler == null)
280                 {
281                     touchDataCallback = OnTouch;
282                     Interop.ActorSignal.TouchConnect(SwigCPtr, touchDataCallback.ToHandleRef(this));
283                     NDalicPINVOKE.ThrowExceptionIfExists();
284                 }
285                 touchDataEventHandler += value;
286             }
287
288             remove
289             {
290                 touchDataEventHandler -= value;
291                 if (touchDataEventHandler == null && touchDataCallback != null)
292                 {
293                     Interop.ActorSignal.TouchDisconnect(SwigCPtr, touchDataCallback.ToHandleRef(this));
294                     NDalicPINVOKE.ThrowExceptionIfExists();
295                     touchDataCallback = null;
296                 }
297             }
298         }
299
300         /// <summary>
301         /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
302         /// The hovered signal is emitted when the hover input is received.<br />
303         /// </summary>
304         /// <since_tizen> 3 </since_tizen>
305         public event EventHandlerWithReturnType<object, HoverEventArgs, bool> HoverEvent
306         {
307             add
308             {
309                 if (hoverEventHandler == null)
310                 {
311                     hoverEventCallback = OnHoverEvent;
312                     Interop.ActorSignal.HoveredConnect(SwigCPtr, hoverEventCallback.ToHandleRef(this));
313                     NDalicPINVOKE.ThrowExceptionIfExists();
314                 }
315                 hoverEventHandler += value;
316             }
317
318             remove
319             {
320                 hoverEventHandler -= value;
321                 if (hoverEventHandler == null && hoverEventCallback != null)
322                 {
323                     Interop.ActorSignal.HoveredDisconnect(SwigCPtr, hoverEventCallback.ToHandleRef(this));
324                     NDalicPINVOKE.ThrowExceptionIfExists();
325                     hoverEventCallback = null;
326                 }
327             }
328         }
329
330         /// <summary>
331         /// An event for the wheel which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
332         /// The wheel event is emitted when the wheel input is received.<br />
333         /// This can receive wheel events before child. <br />
334         /// If it returns false, the child can receive the wheel event. If it returns true, the wheel event is intercepted. So child cannot receive wheel event.<br />
335         /// </summary>
336         [EditorBrowsable(EditorBrowsableState.Never)]
337         public event EventHandlerWithReturnType<object, WheelEventArgs, bool> InterceptWheelEvent
338         {
339             add
340             {
341                 if (interceptWheelHandler == null)
342                 {
343                     interceptWheelCallback = OnInterceptWheel;
344                     Interop.ActorSignal.InterceptWheelConnect(SwigCPtr, interceptWheelCallback.ToHandleRef(this));
345                     NDalicPINVOKE.ThrowExceptionIfExists();
346                 }
347                 interceptWheelHandler += value;
348             }
349
350             remove
351             {
352                 interceptWheelHandler -= value;
353                 if (interceptWheelHandler == null && interceptWheelCallback != null)
354                 {
355                     Interop.ActorSignal.InterceptWheelDisconnect(SwigCPtr, interceptWheelCallback.ToHandleRef(this));
356                     NDalicPINVOKE.ThrowExceptionIfExists();
357                     interceptWheelCallback = null;
358                 }
359             }
360         }
361
362         /// <summary>
363         /// If child view doesn't want the parent's view to intercept the wheel event, you can set it to true.
364         /// for example :
365         ///    parent.Add(child);
366         ///    parent.InterceptWheelEvent += OnInterceptWheelEvent;
367         ///    View view = child.GetParent() as View;
368         ///    view.DisallowInterceptWheelEvent = true;
369         ///  This prevents the parent from intercepting wheel event.
370         /// </summary>
371         [EditorBrowsable(EditorBrowsableState.Never)]
372         public bool DisallowInterceptWheelEvent { get; set; }
373
374         /// <summary>
375         /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
376         /// The WheelMoved signal is emitted when the wheel event is received.<br />
377         /// </summary>
378         /// <since_tizen> 3 </since_tizen>
379         public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelEvent
380         {
381             add
382             {
383                 if (wheelEventHandler == null)
384                 {
385                     wheelEventCallback = OnWheelEvent;
386                     Interop.ActorSignal.WheelEventConnect(SwigCPtr, wheelEventCallback.ToHandleRef(this));
387                     NDalicPINVOKE.ThrowExceptionIfExists();
388                 }
389                 wheelEventHandler += value;
390             }
391
392             remove
393             {
394                 wheelEventHandler -= value;
395                 if (wheelEventHandler == null && wheelEventCallback != null)
396                 {
397                     Interop.ActorSignal.WheelEventDisconnect(SwigCPtr, wheelEventCallback.ToHandleRef(this));
398                     NDalicPINVOKE.ThrowExceptionIfExists();
399                     wheelEventCallback = null;
400                 }
401             }
402         }
403
404         /// <summary>
405         /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.<br />
406         /// The OnWindow signal is emitted after the view has been connected to the window.<br />
407         /// </summary>
408         /// <since_tizen> 3 </since_tizen>
409         public event EventHandler AddedToWindow
410         {
411             add
412             {
413                 if (onWindowEventHandler == null)
414                 {
415                     onWindowEventCallback = OnWindow;
416                     Interop.ActorSignal.OnSceneConnect(SwigCPtr, onWindowEventCallback.ToHandleRef(this));
417                     NDalicPINVOKE.ThrowExceptionIfExists();
418                 }
419                 onWindowEventHandler += value;
420             }
421
422             remove
423             {
424                 onWindowEventHandler -= value;
425                 if (onWindowEventHandler == null && onWindowEventCallback != null)
426                 {
427                     Interop.ActorSignal.OnSceneDisconnect(SwigCPtr, onWindowEventCallback.ToHandleRef(this));
428                     NDalicPINVOKE.ThrowExceptionIfExists();
429                     onWindowEventCallback = null;
430                 }
431             }
432         }
433
434         /// <summary>
435         /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.<br />
436         /// OffWindow signal is emitted after the view has been disconnected from the window.<br />
437         /// </summary>
438         /// <since_tizen> 3 </since_tizen>
439         public event EventHandler RemovedFromWindow
440         {
441             add
442             {
443                 if (offWindowEventHandler == null)
444                 {
445                     offWindowEventCallback = OffWindow;
446                     Interop.ActorSignal.OffSceneConnect(SwigCPtr, offWindowEventCallback.ToHandleRef(this));
447                     NDalicPINVOKE.ThrowExceptionIfExists();
448                 }
449                 offWindowEventHandler += value;
450             }
451
452             remove
453             {
454                 offWindowEventHandler -= value;
455                 if (offWindowEventHandler == null && offWindowEventCallback != null)
456                 {
457                     Interop.ActorSignal.OffSceneDisconnect(SwigCPtr, offWindowEventCallback.ToHandleRef(this));
458                     NDalicPINVOKE.ThrowExceptionIfExists();
459                     offWindowEventCallback = null;
460                 }
461             }
462         }
463         /// <summary>
464         /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.<br />
465         /// This event is sent when the visibility of this or a parent view is changed.<br />
466         /// </summary>
467         /// <remarks>
468         /// <para>
469         /// When VisibilityChangedEventArgs.Type is SELF, VisibilityChangedEventArgs.Visibility is true means this View's Visibility property is true.
470         /// When VisibilityChangedEventArgs.Type is PARENT, VisibilityChangedEventArgs.Visibility is true means a parent's Visibility property has changed to true.
471         /// </para>
472         /// <para>
473         /// This event is NOT sent if the view becomes transparent (or the reverse), it's ONLY linked with View.Show() and View.Hide().
474         /// For reference, a view is only shown if the view and its parents (up to the root view) are also visible, they are not transparent, and the view has a non-zero size.
475         /// So if its parent is not visible, the view is not shown even though VisibilityChangedEventArgs.Type is SELF and VisibilityChangedEventArgs.Visibility is true.
476         /// </para>
477         /// </remarks>
478         /// <since_tizen> 3 </since_tizen>
479         public event EventHandler<VisibilityChangedEventArgs> VisibilityChanged
480         {
481             add
482             {
483                 if (visibilityChangedEventHandler == null)
484                 {
485                     visibilityChangedEventCallback = OnVisibilityChanged;
486                     Interop.ActorSignal.VisibilityChangedConnect(SwigCPtr, visibilityChangedEventCallback.ToHandleRef(this));
487                     NDalicPINVOKE.ThrowExceptionIfExists();
488                 }
489                 visibilityChangedEventHandler += value;
490             }
491
492             remove
493             {
494                 visibilityChangedEventHandler -= value;
495                 if (visibilityChangedEventHandler == null && visibilityChangedEventCallback != null)
496                 {
497                     Interop.ActorSignal.VisibilityChangedDisconnect(SwigCPtr, visibilityChangedEventCallback.ToHandleRef(this));
498                     NDalicPINVOKE.ThrowExceptionIfExists();
499                     visibilityChangedEventCallback = null;
500                 }
501             }
502         }
503
504         /// <summary>
505         /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.<br />
506         /// This signal is emitted when the layout direction property of this or a parent view is changed.<br />
507         /// </summary>
508         /// <since_tizen> 4 </since_tizen>
509         public event EventHandler<LayoutDirectionChangedEventArgs> LayoutDirectionChanged
510         {
511             add
512             {
513                 if (layoutDirectionChangedEventHandler == null)
514                 {
515                     layoutDirectionChangedEventCallback = OnLayoutDirectionChanged;
516                     Interop.ActorSignal.LayoutDirectionChangedConnect(SwigCPtr, layoutDirectionChangedEventCallback.ToHandleRef(this));
517                     NDalicPINVOKE.ThrowExceptionIfExists();
518                 }
519
520                 layoutDirectionChangedEventHandler += value;
521             }
522
523             remove
524             {
525                 layoutDirectionChangedEventHandler -= value;
526
527                 if (layoutDirectionChangedEventHandler == null && layoutDirectionChangedEventCallback != null)
528                 {
529                     Interop.ActorSignal.LayoutDirectionChangedDisconnect(SwigCPtr, layoutDirectionChangedEventCallback.ToHandleRef(this));
530                     NDalicPINVOKE.ThrowExceptionIfExists();
531                     layoutDirectionChangedEventCallback = null;
532                 }
533             }
534         }
535
536         /// <summary>
537         /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
538         /// This signal is emitted after all resources required by a view are loaded and ready.<br />
539         /// </summary>
540         /// <since_tizen> 3 </since_tizen>
541         public event EventHandler ResourcesLoaded
542         {
543             add
544             {
545                 if (resourcesLoadedEventHandler == null)
546                 {
547                     resourcesLoadedCallback = OnResourcesLoaded;
548                     Interop.ViewSignal.ResourceReadyConnect(SwigCPtr, resourcesLoadedCallback.ToHandleRef(this));
549                     NDalicPINVOKE.ThrowExceptionIfExists();
550                 }
551                 resourcesLoadedEventHandler += value;
552             }
553
554             remove
555             {
556                 resourcesLoadedEventHandler -= value;
557                 if (resourcesLoadedEventHandler == null && resourcesLoadedCallback != null)
558                 {
559                     Interop.ViewSignal.ResourceReadyDisconnect(SwigCPtr, resourcesLoadedCallback.ToHandleRef(this));
560                     NDalicPINVOKE.ThrowExceptionIfExists();
561                     resourcesLoadedCallback = null;
562                 }
563             }
564         }
565
566         private EventHandler _backKeyPressed;
567
568         /// <summary>
569         /// An event for getting notice when physical back key is pressed.<br />
570         /// This event is emitted BackKey is up.<br />
571         /// </summary>
572         [EditorBrowsable(EditorBrowsableState.Never)]
573         public event EventHandler BackKeyPressed
574         {
575             add
576             {
577                 _backKeyPressed += value;
578                 BackKeyManager.Instance.Subscriber.Add(this);
579             }
580
581             remove
582             {
583                 BackKeyManager.Instance.Subscriber.Remove(this);
584                 _backKeyPressed -= value;
585             }
586         }
587
588         /// <summary>
589         /// Function for emitting BackKeyPressed event outside of View instance
590         /// </summary>
591         [EditorBrowsable(EditorBrowsableState.Never)]
592         internal void EmitBackKeyPressed()
593         {
594             _backKeyPressed.Invoke(this, null);
595         }
596
597
598         internal event EventHandler<BackgroundResourceLoadedEventArgs> BackgroundResourceLoaded
599         {
600             add
601             {
602                 if (backgroundResourceLoadedEventHandler == null)
603                 {
604                     backgroundResourceLoadedCallback = OnBackgroundResourceLoaded;
605                     Interop.ViewSignal.ResourceReadyConnect(SwigCPtr, backgroundResourceLoadedCallback.ToHandleRef(this));
606                     NDalicPINVOKE.ThrowExceptionIfExists();
607                 }
608                 backgroundResourceLoadedEventHandler += value;
609             }
610
611             remove
612             {
613                 backgroundResourceLoadedEventHandler -= value;
614                 if (backgroundResourceLoadedEventHandler == null && backgroundResourceLoadedCallback != null)
615                 {
616                     Interop.ViewSignal.ResourceReadyDisconnect(SwigCPtr, backgroundResourceLoadedCallback.ToHandleRef(this));
617                     NDalicPINVOKE.ThrowExceptionIfExists();
618                     backgroundResourceLoadedCallback = null;
619                 }
620             }
621         }
622
623         private void OnColorChanged(float r, float g, float b, float a)
624         {
625             Color = new Color(r, g, b, a);
626         }
627
628         private void OnMinimumSizeChanged(int width, int height)
629         {
630             MinimumSize = new Size2D(width, height);
631         }
632
633         private void OnMaximumSizeChanged(int width, int height)
634         {
635             MaximumSize = new Size2D(width, height);
636         }
637
638         private void OnPosition2DChanged(int x, int y)
639         {
640             SetPosition((float)x, (float)y, 0);
641         }
642
643         private void OnPositionChanged(float x, float y, float z)
644         {
645             SetPosition(x, y, z);
646         }
647
648         private void OnSize2DChanged(int width, int height)
649         {
650             SetSize((float)width, (float)height, 0);
651         }
652
653         private void OnSizeChanged(float width, float height, float depth)
654         {
655             SetSize(width, height, depth);
656         }
657
658         private void OnParentOriginChanged(float x, float y, float z)
659         {
660             ParentOrigin = new Position(x, y, z);
661         }
662
663         private void OnPivotPointChanged(float x, float y, float z)
664         {
665             PivotPoint = new Position(x, y, z);
666         }
667
668         private void OnImageShadowChanged(ShadowBase instance)
669         {
670             ImageShadow = (ImageShadow)instance;
671         }
672
673         private void OnBoxShadowChanged(ShadowBase instance)
674         {
675             BoxShadow = (Shadow)instance;
676         }
677
678         private void OnBackgroundImageBorderChanged(int left, int right, int bottom, int top)
679         {
680             BackgroundImageBorder = new Rectangle(left, right, bottom, top);
681         }
682
683         private void OnKeyInputFocusGained(IntPtr view)
684         {
685             if (IsNativeHandleInvalid())
686             {
687                 if (this.Disposed)
688                 {
689                     if (keyInputFocusGainedEventHandler != null)
690                     {
691                         var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
692                         var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
693                         var me = this.GetType().FullName;
694
695                         throw new ObjectDisposedException(nameof(SwigCPtr), $"Error! NUI's native dali object is already disposed. " +
696                             $"OR the native dali object handle of NUI becomes null! \n" +
697                             $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
698                     }
699                 }
700                 else
701                 {
702                     if (this.IsDisposeQueued)
703                     {
704                         var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
705                         var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
706                         var me = this.GetType().FullName;
707
708                         //in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
709                         Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
710                             $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
711                         return;
712                     }
713                 }
714             }
715
716             keyInputFocusGainedEventHandler?.Invoke(this, null);
717         }
718
719         private void OnKeyInputFocusLost(IntPtr view)
720         {
721             if (IsNativeHandleInvalid())
722             {
723                 if (this.Disposed)
724                 {
725                     if (keyInputFocusLostEventHandler != null)
726                     {
727                         var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
728                         var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
729                         var me = this.GetType().FullName;
730
731                         throw new ObjectDisposedException(nameof(SwigCPtr), $"Error! NUI's native dali object is already disposed. " +
732                             $"OR the native dali object handle of NUI becomes null! \n" +
733                             $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
734                     }
735                 }
736                 else
737                 {
738                     if (this.IsDisposeQueued)
739                     {
740                         var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
741                         var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
742                         var me = this.GetType().FullName;
743
744                         //in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
745                         Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
746                             $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
747                         return;
748                     }
749                 }
750             }
751
752             keyInputFocusLostEventHandler?.Invoke(this, null);
753         }
754
755         private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
756         {
757             if (keyEvent == global::System.IntPtr.Zero)
758             {
759                 NUILog.Error("keyEvent should not be null!");
760                 return true;
761             }
762
763             KeyEventArgs e = new KeyEventArgs();
764
765             bool result = false;
766
767             e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
768
769             if (keyEventHandler != null)
770             {
771                 Delegate[] delegateList = keyEventHandler.GetInvocationList();
772
773                 // Oring the result of each callback.
774                 foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
775                 {
776                     result |= del(this, e);
777                 }
778             }
779
780             return result;
781         }
782
783         // Callback for View OnRelayout signal
784         private void OnRelayout(IntPtr data)
785         {
786             if (onRelayoutEventHandler != null)
787             {
788                 onRelayoutEventHandler(this, null);
789             }
790         }
791
792         // Callback for View HitTestResultSignal
793         private bool OnHitTestResult(IntPtr view, IntPtr touchData)
794         {
795             if (touchData == global::System.IntPtr.Zero)
796             {
797                 NUILog.Error("touchData should not be null!");
798                 return true;
799             }
800
801             TouchEventArgs e = new TouchEventArgs();
802             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
803             return HitTest(e.Touch);
804         }
805
806         // Callback for View TouchSignal
807         private bool OnInterceptTouch(IntPtr view, IntPtr touchData)
808         {
809             if (touchData == global::System.IntPtr.Zero)
810             {
811                 NUILog.Error("touchData should not be null!");
812                 return true;
813             }
814
815             // DisallowInterceptTouchEvent prevents the parent from intercepting touch.
816             if (DisallowInterceptTouchEvent)
817             {
818                 return false;
819             }
820
821             TouchEventArgs e = new TouchEventArgs();
822
823             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
824
825             bool consumed = false;
826
827             if (interceptTouchDataEventHandler != null)
828             {
829                 consumed = interceptTouchDataEventHandler(this, e);
830             }
831
832             return consumed;
833         }
834
835         // Callback for View TouchSignal
836         private bool OnTouch(IntPtr view, IntPtr touchData)
837         {
838             if (touchData == global::System.IntPtr.Zero)
839             {
840                 NUILog.Error("touchData should not be null!");
841                 return true;
842             }
843
844             if (DispatchTouchEvents == false)
845             {
846                 NUILog.Debug("If DispatchTouchEvents is false, it can not dispatch.");
847                 return true;
848             }
849
850             TouchEventArgs e = new TouchEventArgs();
851
852             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
853
854             bool consumed = false;
855
856             if (touchDataEventHandler != null)
857             {
858                 consumed = touchDataEventHandler(this, e);
859             }
860
861             if (enableControlState && !consumed)
862             {
863                 consumed = HandleControlStateOnTouch(e.Touch);
864             }
865
866             if (DispatchParentTouchEvents == false)
867             {
868                 NUILog.Debug("If DispatchParentTouchEvents is false, it can not dispatch to parent.");
869                 return true;
870             }
871
872             return consumed;
873         }
874
875         // Callback for View Hover signal
876         private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
877         {
878             if (hoverEvent == global::System.IntPtr.Zero)
879             {
880                 NUILog.Error("hoverEvent should not be null!");
881                 return true;
882             }
883
884             if (DispatchHoverEvents == false)
885             {
886                 NUILog.Debug("If DispatchHoverEvents is false, it can not dispatch.");
887                 return true;
888             }
889
890             HoverEventArgs e = new HoverEventArgs();
891
892             e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
893
894             bool consumed = false;
895
896             if (hoverEventHandler != null)
897             {
898                 consumed = hoverEventHandler(this, e);
899             }
900
901             if (DispatchParentHoverEvents == false && consumed == false)
902             {
903                 NUILog.Debug("If DispatchParentHoverEvents is false, it can not dispatch to parent.");
904                 return true;
905             }
906
907             return consumed;
908         }
909
910         // Callback for View InterceptWheel signal
911         private bool OnInterceptWheel(IntPtr view, IntPtr wheelEvent)
912         {
913             if (wheelEvent == global::System.IntPtr.Zero)
914             {
915                 NUILog.Error("wheelEvent should not be null!");
916                 return true;
917             }
918
919             // DisallowInterceptWheelEvent prevents the parent from intercepting wheel.
920             if (DisallowInterceptWheelEvent)
921             {
922                 return false;
923             }
924
925             WheelEventArgs e = new WheelEventArgs();
926
927             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
928
929             bool consumed = false;
930
931             if (interceptWheelHandler != null)
932             {
933                 consumed = interceptWheelHandler(this, e);
934             }
935
936             return consumed;
937         }
938
939         // Callback for View Wheel signal
940         private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
941         {
942             if (wheelEvent == global::System.IntPtr.Zero)
943             {
944                 NUILog.Error("wheelEvent should not be null!");
945                 return true;
946             }
947
948             WheelEventArgs e = new WheelEventArgs();
949
950             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
951
952             if (wheelEventHandler != null)
953             {
954                 return wheelEventHandler(this, e);
955             }
956             return false;
957         }
958
959         // Callback for View OnWindow signal
960         private void OnWindow(IntPtr data)
961         {
962             if (onWindowEventHandler != null)
963             {
964                 onWindowEventHandler(this, null);
965             }
966         }
967
968         // Callback for View OffWindow signal
969         private void OffWindow(IntPtr data)
970         {
971             if (offWindowEventHandler != null)
972             {
973                 offWindowEventHandler(this, null);
974             }
975         }
976
977         // Callback for View visibility change signal
978         private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type)
979         {
980             VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
981             if (data != null)
982             {
983                 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
984             }
985             e.Visibility = visibility;
986             e.Type = type;
987
988             if (visibilityChangedEventHandler != null)
989             {
990                 visibilityChangedEventHandler(this, e);
991             }
992         }
993
994         // Callback for View layout direction change signal
995         private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type)
996         {
997             LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs();
998             if (data != null)
999             {
1000                 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
1001             }
1002             e.Type = type;
1003
1004             if (layoutDirectionChangedEventHandler != null)
1005             {
1006                 layoutDirectionChangedEventHandler(this, e);
1007             }
1008         }
1009
1010         private void OnResourcesLoaded(IntPtr view)
1011         {
1012             if(!CheckResourceReady())
1013             {
1014                 return;
1015             }
1016
1017             if (resourcesLoadedEventHandler != null)
1018             {
1019                 resourcesLoadedEventHandler(this, null);
1020             }
1021         }
1022
1023         private void OnBackgroundResourceLoaded(IntPtr view)
1024         {
1025             BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs();
1026             e.Status = (ResourceLoadingStatusType)Interop.View.GetVisualResourceStatus(this.SwigCPtr, Property.BACKGROUND);
1027
1028             if (backgroundResourceLoadedEventHandler != null)
1029             {
1030                 backgroundResourceLoadedEventHandler(this, e);
1031             }
1032         }
1033
1034         /// <summary>
1035         /// Event argument passed through the ChildAdded event.
1036         /// </summary>
1037         /// <since_tizen> 5 </since_tizen>
1038         public class ChildAddedEventArgs : EventArgs
1039         {
1040             /// <summary>
1041             /// Added child view at moment.
1042             /// </summary>
1043             /// <since_tizen> 5 </since_tizen>
1044             public View Added { get; set; }
1045         }
1046
1047         /// <summary>
1048         /// Event argument passed through the ChildRemoved event.
1049         /// </summary>
1050         /// <since_tizen> 5 </since_tizen>
1051         public class ChildRemovedEventArgs : EventArgs
1052         {
1053             /// <summary>
1054             /// Removed child view at moment.
1055             /// </summary>
1056             /// <since_tizen> 5 </since_tizen>
1057             public View Removed { get; set; }
1058         }
1059
1060         /// <summary>
1061         /// Event arguments that passed via the KeyEvent signal.
1062         /// </summary>
1063         /// <since_tizen> 3 </since_tizen>
1064         public class KeyEventArgs : EventArgs
1065         {
1066             private Key _key;
1067
1068             /// <summary>
1069             /// Key - is the key sent to the view.
1070             /// </summary>
1071             /// <since_tizen> 3 </since_tizen>
1072             public Key Key
1073             {
1074                 get
1075                 {
1076                     return _key;
1077                 }
1078                 set
1079                 {
1080                     _key = value;
1081                 }
1082             }
1083         }
1084
1085         /// <summary>
1086         /// Event arguments that passed via the touch signal.
1087         /// </summary>
1088         /// <since_tizen> 3 </since_tizen>
1089         public class TouchEventArgs : EventArgs
1090         {
1091             private Touch _touch;
1092
1093             /// <summary>
1094             /// Touch - contains the information of touch points.
1095             /// </summary>
1096             /// <since_tizen> 3 </since_tizen>
1097             public Touch Touch
1098             {
1099                 get
1100                 {
1101                     return _touch;
1102                 }
1103                 set
1104                 {
1105                     _touch = value;
1106                 }
1107             }
1108         }
1109
1110         /// <summary>
1111         /// Event arguments that passed via the hover signal.
1112         /// </summary>
1113         /// <since_tizen> 3 </since_tizen>
1114         public class HoverEventArgs : EventArgs
1115         {
1116             private Hover _hover;
1117
1118             /// <summary>
1119             /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped.
1120             /// </summary>
1121             /// <since_tizen> 3 </since_tizen>
1122             public Hover Hover
1123             {
1124                 get
1125                 {
1126                     return _hover;
1127                 }
1128                 set
1129                 {
1130                     _hover = value;
1131                 }
1132             }
1133         }
1134
1135         /// <summary>
1136         /// Event arguments that passed via the wheel signal.
1137         /// </summary>
1138         /// <since_tizen> 3 </since_tizen>
1139         public class WheelEventArgs : EventArgs
1140         {
1141             private Wheel _wheel;
1142
1143             /// <summary>
1144             /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL.
1145             /// </summary>
1146             /// <since_tizen> 3 </since_tizen>
1147             public Wheel Wheel
1148             {
1149                 get
1150                 {
1151                     return _wheel;
1152                 }
1153                 set
1154                 {
1155                     _wheel = value;
1156                 }
1157             }
1158         }
1159
1160         /// <summary>
1161         /// Event arguments of visibility changed.
1162         /// </summary>
1163         /// <since_tizen> 3 </since_tizen>
1164         public class VisibilityChangedEventArgs : EventArgs
1165         {
1166             private View _view;
1167             private bool _visibility;
1168             private VisibilityChangeType _type;
1169
1170             /// <summary>
1171             /// The view, or child of view, whose visibility has changed.
1172             /// </summary>
1173             /// <since_tizen> 3 </since_tizen>
1174             public View View
1175             {
1176                 get
1177                 {
1178                     return _view;
1179                 }
1180                 set
1181                 {
1182                     _view = value;
1183                 }
1184             }
1185
1186             /// <summary>
1187             /// Whether the view is now visible or not.
1188             /// </summary>
1189             /// <since_tizen> 3 </since_tizen>
1190             public bool Visibility
1191             {
1192                 get
1193                 {
1194                     return _visibility;
1195                 }
1196                 set
1197                 {
1198                     _visibility = value;
1199                 }
1200             }
1201
1202             /// <summary>
1203             /// Whether the view's visible property has changed or a parent's.
1204             /// </summary>
1205             /// <since_tizen> 3 </since_tizen>
1206             public VisibilityChangeType Type
1207             {
1208                 get
1209                 {
1210                     return _type;
1211                 }
1212                 set
1213                 {
1214                     _type = value;
1215                 }
1216             }
1217         }
1218
1219         /// <summary>
1220         /// Event arguments of layout direction changed.
1221         /// </summary>
1222         /// <since_tizen> 4 </since_tizen>
1223         public class LayoutDirectionChangedEventArgs : EventArgs
1224         {
1225             private View _view;
1226             private ViewLayoutDirectionType _type;
1227
1228             /// <summary>
1229             /// The view, or child of view, whose layout direction has changed.
1230             /// </summary>
1231             /// <since_tizen> 4 </since_tizen>
1232             public View View
1233             {
1234                 get
1235                 {
1236                     return _view;
1237                 }
1238                 set
1239                 {
1240                     _view = value;
1241                 }
1242             }
1243
1244             /// <summary>
1245             /// Whether the view's layout direction property has changed or a parent's.
1246             /// </summary>
1247             /// <since_tizen> 4 </since_tizen>
1248             public ViewLayoutDirectionType Type
1249             {
1250                 get
1251                 {
1252                     return _type;
1253                 }
1254                 set
1255                 {
1256                     _type = value;
1257                 }
1258             }
1259         }
1260
1261         internal class BackgroundResourceLoadedEventArgs : EventArgs
1262         {
1263             private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
1264             public ResourceLoadingStatusType Status
1265             {
1266                 get
1267                 {
1268                     return status;
1269                 }
1270                 set
1271                 {
1272                     status = value;
1273                 }
1274             }
1275         }
1276
1277         /// <summary>
1278         /// The class represents the information of the situation where the View's control state changes.
1279         /// </summary>
1280         [EditorBrowsable(EditorBrowsableState.Never)]
1281         public class ControlStateChangedEventArgs : EventArgs
1282         {
1283             /// <summary>
1284             /// Create an instance with mandatory fields.
1285             /// </summary>
1286             /// <param name="previousState">The previous control state.</param>
1287             /// <param name="currentState">The current control state.</param>
1288             [EditorBrowsable(EditorBrowsableState.Never)]
1289             public ControlStateChangedEventArgs(ControlState previousState, ControlState currentState)
1290             {
1291                 PreviousState = previousState;
1292                 CurrentState = currentState;
1293             }
1294
1295             /// <summary>
1296             /// The previous control state.
1297             /// </summary>
1298             [EditorBrowsable(EditorBrowsableState.Never)]
1299             public ControlState PreviousState { get; }
1300
1301             /// <summary>
1302             /// The current control state.
1303             /// </summary>
1304             [EditorBrowsable(EditorBrowsableState.Never)]
1305             public ControlState CurrentState { get; }
1306         }
1307
1308         /// <summary>
1309         /// The expanded touch area.
1310         /// TouchArea can expand the view's touchable area.<br/>
1311         /// If you set the TouchAreaOffset on an view, when you touch the view, the touch area is used rather than the size of the view.<br/>
1312         /// </summary>
1313         /// <remarks>
1314         /// This is based on the top left x, y coordinates.<br/>
1315         /// For example) <br/>
1316         /// <code>
1317         ///  view.Size = new Size(100, 100);
1318         ///  view.TouchAreaOffset = new Offset(-10, 20, 30, -40); // left, right, bottom, top
1319         /// </code>
1320         /// Then, touch area is 130x170.<br/>
1321         /// This is view.width + TouchAreaOffset.right - TouchAreaOffset.left and view.height + TouchAreaOffset.bottom - TouchAreaOffset.top <br/>
1322         /// +---------------------+ <br/>
1323         /// |         ^           | <br/>
1324         /// |         |           | <br/>
1325         /// |         | -40       | <br/>
1326         /// |         |           | <br/>
1327         /// |         |           | <br/>
1328         /// |    +----+----+      | <br/>
1329         /// |    |         |      | <br/>
1330         /// | -10|         | 20   | <br/>
1331         /// |&lt;---+         +-----&gt;| <br/>
1332         /// |    |         |      | <br/>
1333         /// |    |         |      | <br/>
1334         /// |    +----+----+      | <br/>
1335         /// |         |           | <br/>
1336         /// |         | 30        | <br/>
1337         /// |         |           | <br/>
1338         /// |         v           | <br/>
1339         /// +---------------------+ <br/>
1340         /// </remarks>
1341         [EditorBrowsable(EditorBrowsableState.Never)]
1342         public Offset TouchAreaOffset
1343         {
1344             get
1345             {
1346                 return (Offset)GetValue(TouchAreaOffsetProperty);
1347             }
1348             set
1349             {
1350                 SetValue(TouchAreaOffsetProperty, value);
1351                 NotifyPropertyChanged();
1352             }
1353         }
1354
1355         private Offset InternalTouchAreaOffset
1356         {
1357             get
1358             {
1359                 Interop.ActorInternal.GetTouchAreaOffset(SwigCPtr, out int left, out int right, out int bottom, out int top);
1360                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1361                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1362                 return new Offset(left, right, bottom, top);
1363             }
1364             set
1365             {
1366                 Interop.ActorInternal.SetTouchAreaOffset(SwigCPtr, value.Left, value.Right, value.Bottom, value.Top);
1367                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1368                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369             }
1370         }
1371
1372     }
1373 }