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