a9f221359c98fe876e6815cf1cac115fe744e75e
[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 = null;
714             if (width != null)
715             {
716                 temp = new PropertyValue((float)width);
717                 Object.SetProperty(SwigCPtr, Property.SizeWidth, temp);
718             }
719             if (height != null)
720             {
721                 temp = new PropertyValue((float)height);
722                 Object.SetProperty(SwigCPtr, Property.SizeHeight, temp);
723             }
724             temp?.Dispose();
725         }
726
727         private void OnMinimumSizeChanged(int? width, int? height)
728         {
729             if (width != null && height != null)
730             {
731                 MinimumSize = new Size2D((int)width, (int)height);
732             }
733             else if (width != null && height == null)
734             {
735                 MinimumSize = new Size2D((int)width, (int)this.GetMinimumSize().Height);
736             }
737             else if (width == null && height != null)
738             {
739                 MinimumSize = new Size2D((int)this.GetMinimumSize().Width, (int)height);
740             }
741             else
742             {
743                 //both are null, do nothing.
744             }
745         }
746
747         private void OnMaximumSizeChanged(int? width, int? height)
748         {
749             if (width != null && height != null)
750             {
751                 MaximumSize = new Size2D((int)width, (int)height);
752             }
753             else if (width != null && height == null)
754             {
755                 MaximumSize = new Size2D((int)width, (int)this.GetMaximumSize().Height);
756             }
757             else if (width == null && height != null)
758             {
759                 MaximumSize = new Size2D((int)this.GetMaximumSize().Width, (int)height);
760             }
761             else
762             {
763                 //both are null, do nothing.
764             }
765         }
766
767         private void OnPosition2DChanged(int x, int y)
768         {
769             Position2D = new Position2D(x, y);
770         }
771
772         private void OnSizeChanged(float? width, float? height, float? depth)
773         {
774             PropertyValue temp;
775             if (width != null)
776             {
777                 temp = new Tizen.NUI.PropertyValue((float)width);
778                 Tizen.NUI.Object.SetProperty(this.SwigCPtr, View.Property.SizeWidth, temp);
779                 temp.Dispose();
780             }
781             if (height != null)
782             {
783                 temp = new Tizen.NUI.PropertyValue((float)height);
784                 Tizen.NUI.Object.SetProperty(this.SwigCPtr, View.Property.SizeHeight, temp);
785                 temp.Dispose();
786             }
787             if (depth != null)
788             {
789                 temp = new Tizen.NUI.PropertyValue((float)depth);
790                 Tizen.NUI.Object.SetProperty(this.SwigCPtr, View.Property.SizeDepth, temp);
791                 temp.Dispose();
792             }
793         }
794
795         private void OnPositionChanged(float x, float y, float z)
796         {
797             Position = new Position(x, y, z);
798         }
799
800         private void OnParentOriginChanged(float x, float y, float z)
801         {
802             ParentOrigin = new Position(x, y, z);
803         }
804
805         private void OnPivotPointChanged(float x, float y, float z)
806         {
807             PivotPoint = new Position(x, y, z);
808         }
809
810         private void OnImageShadowChanged(ShadowBase instance)
811         {
812             ImageShadow = (ImageShadow)instance;
813         }
814
815         private void OnBoxShadowChanged(ShadowBase instance)
816         {
817             BoxShadow = (Shadow)instance;
818         }
819
820         private void OnBackgroundImageBorderChanged(int left, int right, int bottom, int top)
821         {
822             BackgroundImageBorder = new Rectangle(left, right, bottom, top);
823         }
824
825         private void OnKeyInputFocusGained(IntPtr view)
826         {
827             if (keyInputFocusGainedEventHandler != null)
828             {
829                 keyInputFocusGainedEventHandler(this, null);
830             }
831         }
832
833         private void OnKeyInputFocusLost(IntPtr view)
834         {
835             if (keyInputFocusLostEventHandler != null)
836             {
837                 keyInputFocusLostEventHandler(this, null);
838             }
839         }
840
841         private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
842         {
843             if (keyEvent == global::System.IntPtr.Zero)
844             {
845                 NUILog.Error("keyEvent should not be null!");
846                 return true;
847             }
848
849             KeyEventArgs e = new KeyEventArgs();
850
851             bool result = false;
852
853             e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
854
855             if (keyEventHandler != null)
856             {
857                 Delegate[] delegateList = keyEventHandler.GetInvocationList();
858
859                 // Oring the result of each callback.
860                 foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
861                 {
862                     result |= del(this, e);
863                 }
864             }
865
866             return result;
867         }
868
869         // Callback for View OnRelayout signal
870         private void OnRelayout(IntPtr data)
871         {
872             if (onRelayoutEventHandler != null)
873             {
874                 onRelayoutEventHandler(this, null);
875             }
876         }
877
878         // Callback for View TouchSignal
879         private bool OnInterceptTouch(IntPtr view, IntPtr touchData)
880         {
881             if (touchData == global::System.IntPtr.Zero)
882             {
883                 NUILog.Error("touchData should not be null!");
884                 return true;
885             }
886
887             // DisallowInterceptTouchEvent prevents the parent from intercepting touch.
888             if (DisallowInterceptTouchEvent)
889             {
890                 return false;
891             }
892
893             TouchEventArgs e = new TouchEventArgs();
894
895             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
896
897             bool consumed = false;
898
899             if (interceptTouchDataEventHandler != null)
900             {
901                 consumed = interceptTouchDataEventHandler(this, e);
902             }
903
904             return consumed;
905         }
906
907         // Callback for View TouchSignal
908         private bool OnTouch(IntPtr view, IntPtr touchData)
909         {
910             if (touchData == global::System.IntPtr.Zero)
911             {
912                 NUILog.Error("touchData should not be null!");
913                 return true;
914             }
915
916             TouchEventArgs e = new TouchEventArgs();
917
918             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
919
920             bool consumed = false;
921
922             if (touchDataEventHandler != null)
923             {
924                 consumed = touchDataEventHandler(this, e);
925             }
926
927             if (enableControlState && !consumed)
928             {
929                 consumed = HandleControlStateOnTouch(e.Touch);
930             }
931
932             return consumed;
933         }
934
935         // Callback for View Hover signal
936         private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
937         {
938             if (hoverEvent == global::System.IntPtr.Zero)
939             {
940                 NUILog.Error("hoverEvent should not be null!");
941                 return true;
942             }
943
944             HoverEventArgs e = new HoverEventArgs();
945
946             e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
947
948             if (hoverEventHandler != null)
949             {
950                 return hoverEventHandler(this, e);
951             }
952             return false;
953         }
954
955         // Callback for View Wheel signal
956         private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
957         {
958             if (wheelEvent == global::System.IntPtr.Zero)
959             {
960                 NUILog.Error("wheelEvent should not be null!");
961                 return true;
962             }
963
964             WheelEventArgs e = new WheelEventArgs();
965
966             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
967
968             if (wheelEventHandler != null)
969             {
970                 return wheelEventHandler(this, e);
971             }
972             return false;
973         }
974
975         // Callback for View OnWindow signal
976         private void OnWindow(IntPtr data)
977         {
978             if (onWindowEventHandler != null)
979             {
980                 onWindowEventHandler(this, null);
981             }
982         }
983
984         // Callback for View OffWindow signal
985         private void OffWindow(IntPtr data)
986         {
987             if (offWindowEventHandler != null)
988             {
989                 offWindowEventHandler(this, null);
990             }
991         }
992
993         // Callback for View visibility change signal
994         private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type)
995         {
996             VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
997             if (data != null)
998             {
999                 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
1000             }
1001             e.Visibility = visibility;
1002             e.Type = type;
1003
1004             if (visibilityChangedEventHandler != null)
1005             {
1006                 visibilityChangedEventHandler(this, e);
1007             }
1008         }
1009
1010         // Callback for View layout direction change signal
1011         private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type)
1012         {
1013             LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs();
1014             if (data != null)
1015             {
1016                 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
1017             }
1018             e.Type = type;
1019
1020             if (layoutDirectionChangedEventHandler != null)
1021             {
1022                 layoutDirectionChangedEventHandler(this, e);
1023             }
1024         }
1025
1026         private void OnResourcesLoaded(IntPtr view)
1027         {
1028             if (resourcesLoadedEventHandler != null)
1029             {
1030                 resourcesLoadedEventHandler(this, null);
1031             }
1032         }
1033
1034         private void OnBackgroundResourceLoaded(IntPtr view)
1035         {
1036             BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs();
1037             e.Status = (ResourceLoadingStatusType)Interop.View.GetVisualResourceStatus(this.SwigCPtr, Property.BACKGROUND);
1038
1039             if (backgroundResourceLoadedEventHandler != null)
1040             {
1041                 backgroundResourceLoadedEventHandler(this, e);
1042             }
1043         }
1044
1045         /// <summary>
1046         /// Event argument passed through the ChildAdded event.
1047         /// </summary>
1048         /// <since_tizen> 5 </since_tizen>
1049         public class ChildAddedEventArgs : EventArgs
1050         {
1051             /// <summary>
1052             /// Added child view at moment.
1053             /// </summary>
1054             /// <since_tizen> 5 </since_tizen>
1055             public View Added { get; set; }
1056         }
1057
1058         /// <summary>
1059         /// Event argument passed through the ChildRemoved event.
1060         /// </summary>
1061         /// <since_tizen> 5 </since_tizen>
1062         public class ChildRemovedEventArgs : EventArgs
1063         {
1064             /// <summary>
1065             /// Removed child view at moment.
1066             /// </summary>
1067             /// <since_tizen> 5 </since_tizen>
1068             public View Removed { get; set; }
1069         }
1070
1071         /// <summary>
1072         /// Event arguments that passed via the KeyEvent signal.
1073         /// </summary>
1074         /// <since_tizen> 3 </since_tizen>
1075         public class KeyEventArgs : EventArgs
1076         {
1077             private Key _key;
1078
1079             /// <summary>
1080             /// Key - is the key sent to the view.
1081             /// </summary>
1082             /// <since_tizen> 3 </since_tizen>
1083             public Key Key
1084             {
1085                 get
1086                 {
1087                     return _key;
1088                 }
1089                 set
1090                 {
1091                     _key = value;
1092                 }
1093             }
1094         }
1095
1096         /// <summary>
1097         /// Event arguments that passed via the touch signal.
1098         /// </summary>
1099         /// <since_tizen> 3 </since_tizen>
1100         public class TouchEventArgs : EventArgs
1101         {
1102             private Touch _touch;
1103
1104             /// <summary>
1105             /// Touch - contains the information of touch points.
1106             /// </summary>
1107             /// <since_tizen> 3 </since_tizen>
1108             public Touch Touch
1109             {
1110                 get
1111                 {
1112                     return _touch;
1113                 }
1114                 set
1115                 {
1116                     _touch = value;
1117                 }
1118             }
1119         }
1120
1121         /// <summary>
1122         /// Event arguments that passed via the hover signal.
1123         /// </summary>
1124         /// <since_tizen> 3 </since_tizen>
1125         public class HoverEventArgs : EventArgs
1126         {
1127             private Hover _hover;
1128
1129             /// <summary>
1130             /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped.
1131             /// </summary>
1132             /// <since_tizen> 3 </since_tizen>
1133             public Hover Hover
1134             {
1135                 get
1136                 {
1137                     return _hover;
1138                 }
1139                 set
1140                 {
1141                     _hover = value;
1142                 }
1143             }
1144         }
1145
1146         /// <summary>
1147         /// Event arguments that passed via the wheel signal.
1148         /// </summary>
1149         /// <since_tizen> 3 </since_tizen>
1150         public class WheelEventArgs : EventArgs
1151         {
1152             private Wheel _wheel;
1153
1154             /// <summary>
1155             /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL.
1156             /// </summary>
1157             /// <since_tizen> 3 </since_tizen>
1158             public Wheel Wheel
1159             {
1160                 get
1161                 {
1162                     return _wheel;
1163                 }
1164                 set
1165                 {
1166                     _wheel = value;
1167                 }
1168             }
1169         }
1170
1171         /// <summary>
1172         /// Event arguments of visibility changed.
1173         /// </summary>
1174         /// <since_tizen> 3 </since_tizen>
1175         public class VisibilityChangedEventArgs : EventArgs
1176         {
1177             private View _view;
1178             private bool _visibility;
1179             private VisibilityChangeType _type;
1180
1181             /// <summary>
1182             /// The view, or child of view, whose visibility has changed.
1183             /// </summary>
1184             /// <since_tizen> 3 </since_tizen>
1185             public View View
1186             {
1187                 get
1188                 {
1189                     return _view;
1190                 }
1191                 set
1192                 {
1193                     _view = value;
1194                 }
1195             }
1196
1197             /// <summary>
1198             /// Whether the view is now visible or not.
1199             /// </summary>
1200             /// <since_tizen> 3 </since_tizen>
1201             public bool Visibility
1202             {
1203                 get
1204                 {
1205                     return _visibility;
1206                 }
1207                 set
1208                 {
1209                     _visibility = value;
1210                 }
1211             }
1212
1213             /// <summary>
1214             /// Whether the view's visible property has changed or a parent's.
1215             /// </summary>
1216             /// <since_tizen> 3 </since_tizen>
1217             public VisibilityChangeType Type
1218             {
1219                 get
1220                 {
1221                     return _type;
1222                 }
1223                 set
1224                 {
1225                     _type = value;
1226                 }
1227             }
1228         }
1229
1230         /// <summary>
1231         /// Event arguments of layout direction changed.
1232         /// </summary>
1233         /// <since_tizen> 4 </since_tizen>
1234         public class LayoutDirectionChangedEventArgs : EventArgs
1235         {
1236             private View _view;
1237             private ViewLayoutDirectionType _type;
1238
1239             /// <summary>
1240             /// The view, or child of view, whose layout direction has changed.
1241             /// </summary>
1242             /// <since_tizen> 4 </since_tizen>
1243             public View View
1244             {
1245                 get
1246                 {
1247                     return _view;
1248                 }
1249                 set
1250                 {
1251                     _view = value;
1252                 }
1253             }
1254
1255             /// <summary>
1256             /// Whether the view's layout direction property has changed or a parent's.
1257             /// </summary>
1258             /// <since_tizen> 4 </since_tizen>
1259             public ViewLayoutDirectionType Type
1260             {
1261                 get
1262                 {
1263                     return _type;
1264                 }
1265                 set
1266                 {
1267                     _type = value;
1268                 }
1269             }
1270         }
1271
1272         internal class BackgroundResourceLoadedEventArgs : EventArgs
1273         {
1274             private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
1275             public ResourceLoadingStatusType Status
1276             {
1277                 get
1278                 {
1279                     return status;
1280                 }
1281                 set
1282                 {
1283                     status = value;
1284                 }
1285             }
1286         }
1287
1288         /// <summary>
1289         /// The class represents the information of the situation where the View's control state changes.
1290         /// </summary>
1291         [EditorBrowsable(EditorBrowsableState.Never)]
1292         public class ControlStateChangedEventArgs : EventArgs
1293         {
1294             /// <summary>
1295             /// Create an instance with mandatory fields.
1296             /// </summary>
1297             /// <param name="previousState">The previous control state.</param>
1298             /// <param name="currentState">The current control state.</param>
1299             [EditorBrowsable(EditorBrowsableState.Never)]
1300             public ControlStateChangedEventArgs(ControlState previousState, ControlState currentState)
1301             {
1302                 PreviousState = previousState;
1303                 CurrentState = currentState;
1304             }
1305
1306             /// <summary>
1307             /// The previous control state.
1308             /// </summary>
1309             [EditorBrowsable(EditorBrowsableState.Never)]
1310             public ControlState PreviousState { get; }
1311
1312             /// <summary>
1313             /// The current control state.
1314             /// </summary>
1315             [EditorBrowsable(EditorBrowsableState.Never)]
1316             public ControlState CurrentState { get; }
1317         }
1318
1319         private EventHandlerWithReturnType<object, WheelEventArgs, bool> WindowWheelEventHandler;
1320         private void OnWindowWheelEvent(object sender, Window.WheelEventArgs e)
1321         {
1322             if (e != null)
1323             {
1324                 if (e.Wheel.Type == Wheel.WheelType.CustomWheel)
1325                 {
1326                     var arg = new WheelEventArgs()
1327                     {
1328                         Wheel = e.Wheel,
1329                     };
1330                     WindowWheelEventHandler?.Invoke(this, arg);
1331                 }
1332             }
1333         }
1334
1335         /// <summary>
1336         /// The expanded touch area.
1337         /// TouchArea can expand the view's touchable area.<br/>
1338         /// 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/>
1339         /// </summary>
1340         /// <remarks>
1341         /// This is based on the top left x, y coordinates.<br/>
1342         /// For example) <br/>
1343         /// <code>
1344         ///  view.Size = new Size(100, 100);
1345         ///  view.TouchAreaOffset = new Offset(-10, 20, 30, -40); // left, right, bottom, top
1346         /// </code>
1347         /// Then, touch area is 130x170.<br/>
1348         /// This is view.width + TouchAreaOffset.right - TouchAreaOffset.left and view.height + TouchAreaOffset.bottom - TouchAreaOffset.top <br/>
1349         /// +---------------------+ <br/>
1350         /// |         ^           | <br/>
1351         /// |         |           | <br/>
1352         /// |         | -40       | <br/>
1353         /// |         |           | <br/>
1354         /// |         |           | <br/>
1355         /// |    +----+----+      | <br/>
1356         /// |    |         |      | <br/>
1357         /// | -10|         | 20   | <br/>
1358         /// |&lt;---+         +-----&gt;| <br/>
1359         /// |    |         |      | <br/>
1360         /// |    |         |      | <br/>
1361         /// |    +----+----+      | <br/>
1362         /// |         |           | <br/>
1363         /// |         | 30        | <br/>
1364         /// |         |           | <br/>
1365         /// |         v           | <br/>
1366         /// +---------------------+ <br/>
1367         /// </remarks>
1368         [EditorBrowsable(EditorBrowsableState.Never)]
1369         public Offset TouchAreaOffset
1370         {
1371             get
1372             {
1373                 return (Offset)GetValue(TouchAreaOffsetProperty);
1374             }
1375             set
1376             {
1377                 SetValue(TouchAreaOffsetProperty, value);
1378                 NotifyPropertyChanged();
1379             }
1380         }
1381
1382         private Offset InternalTouchAreaOffset
1383         {
1384             get
1385             {
1386                 Interop.ActorInternal.GetTouchAreaOffset(SwigCPtr, out int left, out int right, out int bottom, out int top);
1387                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1388                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1389                 return new Offset(left, right, bottom, top);
1390             }
1391             set
1392             {
1393                 Interop.ActorInternal.SetTouchAreaOffset(SwigCPtr, value.Left, value.Right, value.Bottom, value.Top);
1394                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1395                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1396             }
1397         }
1398
1399     }
1400 }