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