Add C# bindings for Actor's POSITION_USES_ANCHOR_POINT property
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / View.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Dali {
18
19     using System;
20     using System.Runtime.InteropServices;
21
22
23 public class View : CustomActor {
24   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25
26   internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
27     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28
29     // Register this instance of view in the view registry.
30     ViewRegistry.RegisterView(this);
31
32     // By default, we do not want the position to use the anchor point
33     this.PositionUsesAnchorPoint = false;
34   }
35
36   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
37     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38   }
39
40   ~View() {
41     DisposeQueue.Instance.Add(this);
42
43     // Unregister this instance of view from the view registry.
44     ViewRegistry.UnregisterView(this);
45   }
46
47   public override void Dispose() {
48     if (!Stage.IsInstalled()) {
49       DisposeQueue.Instance.Add(this);
50       return;
51     }
52
53     lock(this) {
54       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
55         if (swigCMemOwn) {
56           swigCMemOwn = false;
57           NDalicPINVOKE.delete_View(swigCPtr);
58         }
59         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
60       }
61       global::System.GC.SuppressFinalize(this);
62       base.Dispose();
63     }
64   }
65
66   /**
67    * @brief Event arguments that passed via KeyInputFocusGained signal
68    *
69    */
70   public class KeyInputFocusGainedEventArgs : EventArgs
71   {
72     private View _view;
73
74     /**
75      * @brief View - is the view that gets Key Input Focus
76      *
77      */
78     public View View
79     {
80       get
81       {
82         return _view;
83       }
84       set
85       {
86         _view = value;
87       }
88     }
89   }
90
91   /**
92    * @brief Event arguments that passed via KeyInputFocusLost signal
93    *
94    */
95   public class KeyInputFocusLostEventArgs : EventArgs
96   {
97     private View _view;
98
99     /**
100      * @brief View - is the view that loses Key Input Focus
101      *
102      */
103     public View View
104     {
105       get
106       {
107         return _view;
108       }
109       set
110       {
111         _view = value;
112       }
113     }
114   }
115
116   /**
117    * @brief Event arguments that passed via Key signal
118    *
119    */
120   public class KeyEventArgs : EventArgs
121   {
122     private View _view;
123     private Key _key;
124
125     /**
126      * @brief View - is the view that recieves the key.
127      *
128      */
129     public View View
130     {
131       get
132       {
133         return _view;
134       }
135       set
136       {
137         _view = value;
138       }
139     }
140
141     /**
142      * @brief Key - is the key sent to the View.
143      *
144      */
145     public Key Key
146     {
147       get
148       {
149         return _key;
150       }
151       set
152       {
153         _key = value;
154       }
155     }
156   }
157
158   /**
159    * @brief Event arguments that passed via OnRelayout signal
160    *
161    */
162   public class OnRelayoutEventArgs : EventArgs
163   {
164     private View _view;
165
166     /**
167      * @brief View - is the view that is being resized upon relayout
168      *
169      */
170     public View View
171     {
172       get
173       {
174         return _view;
175       }
176       set
177       {
178         _view = value;
179       }
180     }
181   }
182
183
184   /**
185    * @brief Event arguments that passed via Touch signal
186    *
187    */
188   public class TouchEventArgs : EventArgs
189   {
190      private View _view;
191      private Touch _touch;
192
193     /**
194      * @brief View - is the view that is being touched
195      *
196      */
197     public View View
198     {
199       get
200       {
201         return _view;
202       }
203       set
204       {
205         _view = value;
206       }
207     }
208
209     /**
210      * @brief Touch - contains the information of touch points
211      *
212      */
213     public Touch Touch
214     {
215       get
216       {
217         return _touch;
218       }
219       set
220       {
221         _touch = value;
222       }
223     }
224   }
225
226   /**
227    * @brief Event arguments that passed via Hover signal
228    *
229    */
230   public class HoverEventArgs : EventArgs
231   {
232      private View _view;
233      private Hover _hover;
234
235     /**
236      * @brief View - is the view that is being hovered
237      *
238      */
239     public View View
240     {
241       get
242       {
243         return _view;
244       }
245       set
246       {
247         _view = value;
248       }
249     }
250
251     /**
252      * @brief Hover - contains touch points that represent the points
253      * that are currently being hovered or the points where a hover has stopped
254      *
255      */
256     public Hover Hover
257     {
258       get
259       {
260         return _hover;
261       }
262       set
263       {
264         _hover = value;
265       }
266     }
267   }
268
269   /**
270    * @brief Event arguments that passed via Wheel signal
271    *
272    */
273   public class WheelEventArgs : EventArgs
274   {
275     private View _view;
276     private Wheel _wheel;
277
278     /**
279      * @brief View - is the view that is being wheeled
280      *
281      */
282     public View View
283     {
284       get
285       {
286         return _view;
287       }
288       set
289       {
290         _view = value;
291       }
292     }
293
294     /**
295      * @brief Wheel - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL
296      *
297      */
298     public Wheel Wheel
299     {
300       get
301       {
302         return _wheel;
303       }
304       set
305       {
306         _wheel = value;
307       }
308     }
309   }
310
311   /**
312    * @brief Event arguments that passed via OnStage signal
313    *
314    */
315   public class OnStageEventArgs : EventArgs
316   {
317   private View _view;
318
319     /**
320      * @brief View - is the view that is being connected to the stage
321      *
322      */
323     public View View
324     {
325       get
326       {
327         return _view;
328       }
329       set
330       {
331         _view = value;
332       }
333     }
334   }
335
336   /**
337    * @brief Event arguments that passed via OffStage signal
338    *
339    */
340   public class OffStageEventArgs : EventArgs
341   {
342   private View _view;
343
344     /**
345      * @brief View - is the view that is being disconnected from the stage
346      *
347      */
348     public View View
349     {
350       get
351       {
352         return _view;
353       }
354       set
355       {
356         _view = value;
357       }
358     }
359   }
360
361   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
362   private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
363   private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
364   private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
365
366   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
367   private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
368   private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
369   private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
370
371   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
372   private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr key);
373   private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyHandler;
374   private KeyCallbackDelegate _KeyCallbackDelegate;
375
376   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
377   private delegate void OnRelayoutEventCallbackDelegate(IntPtr control);
378   private DaliEventHandler<object,OnRelayoutEventArgs> _viewOnRelayoutEventHandler;
379   private OnRelayoutEventCallbackDelegate _viewOnRelayoutEventCallbackDelegate;
380
381   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
382   private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touch);
383   private DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> _viewTouchHandler;
384   private TouchCallbackDelegate _viewTouchCallbackDelegate;
385
386   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
387   private delegate bool HoverCallbackDelegate(IntPtr view, IntPtr hover);
388   private DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> _viewHoverHandler;
389   private HoverCallbackDelegate _viewHoverCallbackDelegate;
390
391   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
392   private delegate bool WheelCallbackDelegate(IntPtr view, IntPtr wheel);
393   private DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> _viewWheelHandler;
394   private WheelCallbackDelegate _viewWheelCallbackDelegate;
395
396   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
397   private delegate void OnStageEventCallbackDelegate(IntPtr control);
398   private DaliEventHandler<object,OnStageEventArgs> _viewOnStageEventHandler;
399   private OnStageEventCallbackDelegate _viewOnStageEventCallbackDelegate;
400
401   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
402   private delegate void OffStageEventCallbackDelegate(IntPtr control);
403   private DaliEventHandler<object,OffStageEventArgs> _viewOffStageEventHandler;
404   private OffStageEventCallbackDelegate _viewOffStageEventCallbackDelegate;
405
406   /**
407    * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
408    * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>)
409    * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
410    */
411   public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
412   {
413     add
414     {
415       lock(this)
416       {
417         // Restricted to only one listener
418         if (_KeyInputFocusGainedEventHandler == null)
419         {
420           _KeyInputFocusGainedEventHandler += value;
421           Console.WriteLine("View Key EVENT Locked....");
422           _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
423           this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
424         }
425       }
426     }
427
428     remove
429     {
430       lock(this)
431       {
432         if (_KeyInputFocusGainedEventHandler != null)
433         {
434           this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
435         }
436
437         _KeyInputFocusGainedEventHandler -= value;
438       }
439     }
440   }
441
442   private void OnKeyInputFocusGained(IntPtr view)
443   {
444     KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
445     Console.WriteLine("View Key ....");
446     // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
447     e.View = Dali.View.GetViewFromPtr(view);
448
449     if (_KeyInputFocusGainedEventHandler != null)
450     {
451       //here we send all data to user event handlers
452       _KeyInputFocusGainedEventHandler(this, e);
453     }
454
455   }
456
457   /**
458    * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
459    * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>)
460    * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
461    */
462   public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
463   {
464     add
465     {
466       lock(this)
467       {
468         // Restricted to only one listener
469         if (_KeyInputFocusLostEventHandler == null)
470         {
471           _KeyInputFocusLostEventHandler += value;
472
473           _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
474           this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
475         }
476       }
477     }
478
479     remove
480     {
481       lock(this)
482       {
483         if (_KeyInputFocusLostEventHandler != null)
484         {
485           this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
486         }
487
488         _KeyInputFocusLostEventHandler -= value;
489       }
490     }
491   }
492
493   private void OnKeyInputFocusLost(IntPtr view)
494   {
495     KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
496
497     // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
498     e.View = Dali.View.GetViewFromPtr(view);
499
500     if (_KeyInputFocusLostEventHandler != null)
501     {
502       //here we send all data to user event handlers
503       _KeyInputFocusLostEventHandler(this, e);
504     }
505   }
506
507   /**
508    * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
509    * (in the type of KeyHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>)
510    * provided by the user. KeyPressed signal is emitted when key event is received.
511    */
512   public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
513   {
514     add
515     {
516       lock(this)
517       {
518         // Restricted to only one listener
519         if (_KeyHandler == null)
520         {
521           _KeyHandler += value;
522
523           _KeyCallbackDelegate = new KeyCallbackDelegate(OnKey);
524           this.KeyEventSignal().Connect(_KeyCallbackDelegate);
525         }
526       }
527     }
528
529     remove
530     {
531       lock(this)
532       {
533         if (_KeyHandler != null)
534         {
535           this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
536         }
537
538         _KeyHandler -= value;
539       }
540     }
541   }
542
543   private bool OnKey(IntPtr view, IntPtr key)
544   {
545     KeyEventArgs e = new KeyEventArgs();
546
547     // Populate all members of "e" (KeyEventArgs) with real data
548     e.View = Dali.View.GetViewFromPtr(view);
549     e.Key = Dali.Key.GetKeyFromPtr(key);
550
551     if (_KeyHandler != null)
552     {
553       //here we send all data to user event handlers
554       return _KeyHandler(this, e);
555     }
556     return false;
557
558   }
559
560   /**
561    * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler
562    * (in the type of OnRelayoutEventHandler) provided by the user.
563    * OnRelayout signal is emitted after the size has been set on the view during relayout.
564    */
565   public event DaliEventHandler<object,OnRelayoutEventArgs> OnRelayoutEvent
566   {
567     add
568     {
569       lock(this)
570       {
571         // Restricted to only one listener
572         if (_viewOnRelayoutEventHandler == null)
573         {
574           _viewOnRelayoutEventHandler += value;
575           Console.WriteLine("View OnRelayoutEventArgs Locked....");
576           _viewOnRelayoutEventCallbackDelegate = new OnRelayoutEventCallbackDelegate(OnRelayout);
577           this.OnRelayoutSignal().Connect(_viewOnRelayoutEventCallbackDelegate);
578         }
579       }
580     }
581
582     remove
583     {
584       lock(this)
585       {
586         if (_viewOnRelayoutEventHandler != null)
587         {
588           this.OnRelayoutSignal().Disconnect(_viewOnRelayoutEventCallbackDelegate);
589         }
590
591         _viewOnRelayoutEventHandler -= value;
592       }
593     }
594   }
595
596   // Callback for View OnRelayout signal
597   private void OnRelayout(IntPtr data)
598   {
599     OnRelayoutEventArgs e = new OnRelayoutEventArgs();
600     Console.WriteLine("View OnRelayoutEventArgs....");
601     // Populate all members of "e" (OnRelayoutEventArgs) with real data
602     e.View = View.GetViewFromPtr(data);
603
604     if (_viewOnRelayoutEventHandler != null)
605     {
606       //here we send all data to user event handlers
607       _viewOnRelayoutEventHandler(this, e);
608     }
609   }
610
611   /**
612    * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
613    * (in the type of TouchHandler-DaliEventHandlerWithReturnType<object,TouchEventArgs,bool>)
614    * provided by the user. Touched signal is emitted when touch input is received.
615    */
616   public event DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> Touched
617   {
618     add
619     {
620       lock(this)
621       {
622         // Restricted to only one listener
623         if (_viewTouchHandler == null)
624         {
625           _viewTouchHandler += value;
626           Console.WriteLine("View Touch EVENT LOCKED....");
627           _viewTouchCallbackDelegate = new TouchCallbackDelegate(OnTouch);
628           this.TouchSignal().Connect(_viewTouchCallbackDelegate);
629         }
630       }
631     }
632
633     remove
634     {
635       lock(this)
636       {
637         if (_viewTouchHandler != null)
638         {
639           this.TouchSignal().Disconnect(_viewTouchCallbackDelegate);
640         }
641
642         _viewTouchHandler -= value;
643       }
644     }
645   }
646
647   // Callback for View TouchSignal
648   private bool OnTouch(IntPtr view, IntPtr touch)
649   {
650     TouchEventArgs e = new TouchEventArgs();
651     Console.WriteLine("View Touch EVENT....");
652     // Populate all members of "e" (TouchEventArgs) with real data
653     e.View = View.GetViewFromPtr(view);
654     e.Touch = Dali.Touch.GetTouchFromPtr(touch);
655
656     if (_viewTouchHandler != null)
657     {
658       //here we send all data to user event handlers
659       return _viewTouchHandler(this, e);
660     }
661
662     return false;
663   }
664
665   /**
666    * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler
667    * (in the type of HoverHandler-DaliEventHandlerWithReturnType<object,HoverEventArgs,bool>)
668    * provided by the user. Hovered signal is emitted when hover input is received.
669    */
670   public event DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> Hovered
671   {
672     add
673     {
674       lock(this)
675       {
676         // Restricted to only one listener
677         if (_viewHoverHandler == null)
678         {
679           _viewHoverHandler += value;
680
681           _viewHoverCallbackDelegate = new HoverCallbackDelegate(OnHover);
682           this.HoveredSignal().Connect(_viewHoverCallbackDelegate);
683         }
684       }
685     }
686
687     remove
688     {
689       lock(this)
690       {
691         if (_viewHoverHandler != null)
692         {
693           this.HoveredSignal().Disconnect(_viewHoverCallbackDelegate);
694         }
695
696         _viewHoverHandler -= value;
697       }
698     }
699   }
700
701   // Callback for View Hover signal
702   private bool OnHover(IntPtr view, IntPtr hover)
703   {
704     HoverEventArgs e = new HoverEventArgs();
705
706     // Populate all members of "e" (HoverEventArgs) with real data
707     e.View = View.GetViewFromPtr(view);
708     e.Hover = Dali.Hover.GetHoverFromPtr(hover);
709
710     if (_viewHoverHandler != null)
711     {
712       //here we send all data to user event handlers
713       return _viewHoverHandler(this, e);
714     }
715
716     return false;
717   }
718
719   /**
720    * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
721    * (in the type of WheelHandler-DaliEventHandlerWithReturnType<object,WheelEventArgs,bool>)
722    * provided by the user. WheelMoved signal is emitted when wheel event is received.
723    */
724   public event DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> WheelMoved
725   {
726     add
727     {
728       lock(this)
729       {
730         // Restricted to only one listener
731         if (_viewWheelHandler == null)
732         {
733           _viewWheelHandler += value;
734           Console.WriteLine("View Wheel EVENT LOCKED....");
735           _viewWheelCallbackDelegate = new WheelCallbackDelegate(OnWheel);
736           this.WheelEventSignal().Connect(_viewWheelCallbackDelegate);
737         }
738       }
739     }
740
741     remove
742     {
743       lock(this)
744       {
745         if (_viewWheelHandler != null)
746         {
747           this.WheelEventSignal().Disconnect(_viewWheelCallbackDelegate);
748         }
749
750         _viewWheelHandler -= value;
751       }
752     }
753   }
754
755   // Callback for View Wheel signal
756   private bool OnWheel(IntPtr view, IntPtr wheel)
757   {
758     WheelEventArgs e = new WheelEventArgs();
759     Console.WriteLine("View Wheel EVENT ....");
760     // Populate all members of "e" (WheelEventArgs) with real data
761     e.View = View.GetViewFromPtr(view);
762     e.Wheel = Dali.Wheel.GetWheelFromPtr(wheel);
763
764     if (_viewWheelHandler != null)
765     {
766       //here we send all data to user event handlers
767       return _viewWheelHandler(this, e);
768     }
769
770     return false;
771   }
772
773   /**
774    * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler
775    * (in the type of OnStageEventHandler) provided by the user.
776    * OnStage signal is emitted after the view has been connected to the stage.
777    */
778   public event DaliEventHandler<object,OnStageEventArgs> OnStageEvent
779   {
780     add
781     {
782       lock(this)
783       {
784         // Restricted to only one listener
785         if (_viewOnStageEventHandler == null)
786         {
787           _viewOnStageEventHandler += value;
788
789           _viewOnStageEventCallbackDelegate = new OnStageEventCallbackDelegate(OnStage);
790           this.OnStageSignal().Connect(_viewOnStageEventCallbackDelegate);
791         }
792       }
793     }
794
795     remove
796     {
797       lock(this)
798       {
799         if (_viewOnStageEventHandler != null)
800         {
801           this.OnStageSignal().Disconnect(_viewOnStageEventCallbackDelegate);
802         }
803
804         _viewOnStageEventHandler -= value;
805       }
806     }
807   }
808
809   // Callback for View OnStage signal
810   private void OnStage(IntPtr data)
811   {
812     OnStageEventArgs e = new OnStageEventArgs();
813
814     // Populate all members of "e" (OnStageEventArgs) with real data
815     e.View = View.GetViewFromPtr(data);
816
817     //Console.WriteLine("############# OnStage()! e.View.Name=" + e.View.Name);
818
819     if (_viewOnStageEventHandler != null)
820     {
821       //here we send all data to user event handlers
822       _viewOnStageEventHandler(this, e);
823     }
824   }
825
826   /**
827    * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler
828    * (in the type of OffStageEventHandler) provided by the user.
829    * OffStage signal is emitted after the view has been disconnected from the stage.
830    */
831   public event DaliEventHandler<object,OffStageEventArgs> OffStageEvent
832   {
833     add
834     {
835       lock(this)
836       {
837         // Restricted to only one listener
838         if (_viewOffStageEventHandler == null)
839         {
840           _viewOffStageEventHandler += value;
841
842           _viewOffStageEventCallbackDelegate = new OffStageEventCallbackDelegate(OffStage);
843           this.OnStageSignal().Connect(_viewOffStageEventCallbackDelegate);
844         }
845       }
846     }
847
848     remove
849     {
850       lock(this)
851       {
852         if (_viewOffStageEventHandler != null)
853         {
854           this.OnStageSignal().Disconnect(_viewOffStageEventCallbackDelegate);
855         }
856
857         _viewOffStageEventHandler -= value;
858       }
859     }
860   }
861
862   // Callback for View OffStage signal
863   private void OffStage(IntPtr data)
864   {
865     OffStageEventArgs e = new OffStageEventArgs();
866
867     // Populate all members of "e" (OffStageEventArgs) with real data
868     e.View = View.GetViewFromPtr(data);
869
870     if (_viewOffStageEventHandler != null)
871     {
872       //here we send all data to user event handlers
873       _viewOffStageEventHandler(this, e);
874     }
875   }
876
877   public static View GetViewFromPtr(global::System.IntPtr cPtr) {
878     View ret = new View(cPtr, false);
879     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
880     return ret;
881   }
882
883   public class Property : global::System.IDisposable {
884     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
885     protected bool swigCMemOwn;
886
887     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
888       swigCMemOwn = cMemoryOwn;
889       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
890     }
891
892     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
893       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
894     }
895
896     ~Property() {
897       Dispose();
898     }
899
900     public virtual void Dispose() {
901       lock(this) {
902         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
903           if (swigCMemOwn) {
904             swigCMemOwn = false;
905             NDalicPINVOKE.delete_View_Property(swigCPtr);
906           }
907           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
908         }
909         global::System.GC.SuppressFinalize(this);
910       }
911     }
912
913     public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
914     public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
915     public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
916     public static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
917     public static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
918     public static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
919     public static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
920
921     public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
922       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
923     }
924
925     public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
926     public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
927     public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
928     public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
929     public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
930
931   }
932
933   public class KeyboardFocus : global::System.IDisposable {
934     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
935     protected bool swigCMemOwn;
936
937     internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
938       swigCMemOwn = cMemoryOwn;
939       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
940     }
941
942     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
943       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
944     }
945
946     ~KeyboardFocus() {
947       Dispose();
948     }
949
950     public virtual void Dispose() {
951       lock(this) {
952         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
953           if (swigCMemOwn) {
954             swigCMemOwn = false;
955             NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
956           }
957           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
958         }
959         global::System.GC.SuppressFinalize(this);
960       }
961     }
962
963     public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
964       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
965     }
966
967     public enum Direction {
968       LEFT,
969       RIGHT,
970       UP,
971       DOWN,
972       PAGE_UP,
973       PAGE_DOWN
974     }
975   }
976
977   public View () : this (NDalicPINVOKE.View_New(), true) {
978       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
979
980   }
981   public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
982     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
983   }
984
985   public View Assign(View handle) {
986     View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
987     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988     return ret;
989   }
990
991   private new static View DownCast(BaseHandle handle) {
992     View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
993     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994     return ret;
995   }
996
997   public static T DownCast<T>(Actor actor) where T : View
998   {
999       return (T)( ViewRegistry.GetViewFromActor( actor ) );
1000   }
1001
1002   private View ConvertIdToView(uint id)
1003   {
1004     Actor actor = null;
1005
1006     if (Parent)
1007     {
1008       actor = Parent.FindChildById(id);
1009     }
1010
1011     if (!actor)
1012     {
1013       actor = Stage.Instance.GetRootLayer().FindChildById(id);
1014     }
1015
1016     return View.DownCast<View>(actor);
1017   }
1018
1019   public void SetKeyInputFocus() {
1020     NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
1021     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1022   }
1023
1024   public bool HasKeyInputFocus() {
1025     bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
1026     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1027     return ret;
1028   }
1029
1030   public void ClearKeyInputFocus() {
1031     NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
1032     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1033   }
1034
1035   public PinchGestureDetector GetPinchGestureDetector() {
1036     PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
1037     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038     return ret;
1039   }
1040
1041   public PanGestureDetector GetPanGestureDetector() {
1042     PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
1043     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044     return ret;
1045   }
1046
1047   public TapGestureDetector GetTapGestureDetector() {
1048     TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
1049     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1050     return ret;
1051   }
1052
1053   public LongPressGestureDetector GetLongPressGestureDetector() {
1054     LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
1055     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056     return ret;
1057   }
1058
1059   public void SetStyleName(string styleName) {
1060     NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
1061     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062   }
1063
1064   public string GetStyleName() {
1065     string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
1066     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067     return ret;
1068   }
1069
1070   public void SetBackgroundColor(Vector4 color) {
1071     NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1072     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1073   }
1074
1075   public Vector4 GetBackgroundColor() {
1076     Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
1077     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078     return ret;
1079   }
1080
1081   public void SetBackgroundImage(Image image) {
1082     NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
1083     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1084   }
1085
1086   public void ClearBackground() {
1087     NDalicPINVOKE.View_ClearBackground(swigCPtr);
1088     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1089   }
1090
1091   public ControlKeySignal KeyEventSignal() {
1092     ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
1093     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094     return ret;
1095   }
1096
1097   public KeyInputFocusSignal KeyInputFocusGainedSignal() {
1098     KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
1099     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100     return ret;
1101   }
1102
1103   public KeyInputFocusSignal KeyInputFocusLostSignal() {
1104     KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
1105     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1106     return ret;
1107   }
1108
1109   public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
1110     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1111   }
1112
1113   public enum PropertyRange {
1114     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
1115     CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
1116     CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
1117   }
1118
1119   public string StyleName
1120   {
1121     get
1122     {
1123       string temp;
1124       GetProperty( View.Property.STYLE_NAME).Get( out temp );
1125       return temp;
1126     }
1127     set
1128     {
1129       SetProperty( View.Property.STYLE_NAME, new Dali.Property.Value( value ) );
1130     }
1131   }
1132
1133   public Vector4 BackgroundColor
1134   {
1135     get
1136     {
1137       Vector4 backgroundColor = new Vector4(0.0f,0.0f,0.0f,0.0f);
1138
1139       Dali.Property.Map background = Background;
1140       int visualType = 0;
1141       background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1142       if(visualType == (int)Dali.Constants.Visual.Type.Color)
1143       {
1144         background.Find( Dali.Constants.ColorVisualProperty.MixColor ).Get( backgroundColor );
1145       }
1146
1147       return backgroundColor;
1148     }
1149     set
1150     {
1151       SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1152     }
1153   }
1154
1155   public string BackgroundImage
1156   {
1157     get
1158     {
1159       string backgroundImage = "";
1160
1161       Dali.Property.Map background = Background;
1162       int visualType = 0;
1163       background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1164       if(visualType == (int)Dali.Constants.Visual.Type.Image)
1165       {
1166         background.Find( Dali.Constants.ImageVisualProperty.URL ).Get( out backgroundImage );
1167       }
1168
1169       return backgroundImage;
1170     }
1171     set
1172     {
1173       SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1174     }
1175   }
1176
1177   public bool KeyInputFocus
1178   {
1179     get
1180     {
1181       bool temp = false;
1182       GetProperty( View.Property.KEY_INPUT_FOCUS).Get( ref temp );
1183       return temp;
1184     }
1185     set
1186     {
1187       SetProperty( View.Property.KEY_INPUT_FOCUS, new Dali.Property.Value( value ) );
1188     }
1189   }
1190
1191   public Dali.Property.Map Background
1192   {
1193     get
1194     {
1195       Dali.Property.Map temp = new Dali.Property.Map();
1196       GetProperty( View.Property.BACKGROUND).Get(  temp );
1197       return temp;
1198     }
1199     set
1200     {
1201       SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1202     }
1203   }
1204
1205   public string State
1206   {
1207     get
1208     {
1209       string temp;
1210       GetProperty( View.Property.STATE).Get( out temp );
1211       return temp;
1212     }
1213     set
1214     {
1215       SetProperty( View.Property.STATE, new Dali.Property.Value( value ) );
1216     }
1217   }
1218
1219   public string SubState
1220   {
1221     get
1222     {
1223       string temp;
1224       GetProperty( View.Property.SUB_STATE).Get( out temp );
1225       return temp;
1226     }
1227     set
1228     {
1229       SetProperty( View.Property.SUB_STATE, new Dali.Property.Value( value ) );
1230     }
1231   }
1232
1233   public Dali.Property.Map Tooltip
1234   {
1235     get
1236     {
1237       Dali.Property.Map temp = new Dali.Property.Map();
1238       GetProperty( View.Property.TOOLTIP).Get(  temp );
1239       return temp;
1240     }
1241     set
1242     {
1243       SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1244     }
1245   }
1246
1247   public string TooltipText
1248   {
1249     set
1250     {
1251       SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1252     }
1253   }
1254
1255   private int LeftFocusableActorId
1256   {
1257     get
1258     {
1259       int temp = 0;
1260       GetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1261       return temp;
1262     }
1263     set
1264     {
1265       SetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1266     }
1267   }
1268
1269   private int RightFocusableActorId
1270   {
1271     get
1272     {
1273       int temp = 0;
1274       GetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1275       return temp;
1276     }
1277     set
1278     {
1279       SetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1280     }
1281   }
1282
1283   private int UpFocusableActorId
1284   {
1285     get
1286     {
1287       int temp = 0;
1288       GetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID).Get( ref temp );
1289       return temp;
1290     }
1291     set
1292     {
1293       SetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1294     }
1295   }
1296
1297   private int DownFocusableActorId
1298   {
1299     get
1300     {
1301       int temp = 0;
1302       GetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get( ref temp );
1303       return temp;
1304     }
1305     set
1306     {
1307       SetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1308     }
1309   }
1310
1311   public float Flex
1312   {
1313     get
1314     {
1315       float temp = 0.0f;
1316       GetProperty( FlexContainer.ChildProperty.FLEX).Get( ref temp );
1317       return temp;
1318     }
1319     set
1320     {
1321       SetProperty( FlexContainer.ChildProperty.FLEX, new Dali.Property.Value( value ) );
1322     }
1323   }
1324
1325   public int AlignSelf
1326   {
1327     get
1328     {
1329       int temp = 0;
1330       GetProperty( FlexContainer.ChildProperty.ALIGN_SELF).Get( ref temp );
1331       return temp;
1332     }
1333     set
1334     {
1335       SetProperty( FlexContainer.ChildProperty.ALIGN_SELF, new Dali.Property.Value( value ) );
1336     }
1337   }
1338
1339   public Vector4 FlexMargin
1340   {
1341     get
1342     {
1343       Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
1344       GetProperty( FlexContainer.ChildProperty.FLEX_MARGIN).Get(  temp );
1345       return temp;
1346     }
1347     set
1348     {
1349       SetProperty( FlexContainer.ChildProperty.FLEX_MARGIN, new Dali.Property.Value( value ) );
1350     }
1351   }
1352
1353   public Vector2 CellIndex
1354   {
1355     get
1356     {
1357       Vector2 temp = new Vector2(0.0f,0.0f);
1358       GetProperty( TableView.ChildProperty.CELL_INDEX).Get(  temp );
1359       return temp;
1360     }
1361     set
1362     {
1363       SetProperty( TableView.ChildProperty.CELL_INDEX, new Dali.Property.Value( value ) );
1364     }
1365   }
1366
1367   public float RowSpan
1368   {
1369     get
1370     {
1371       float temp = 0.0f;
1372       GetProperty( TableView.ChildProperty.ROW_SPAN).Get( ref temp );
1373       return temp;
1374     }
1375     set
1376     {
1377       SetProperty( TableView.ChildProperty.ROW_SPAN, new Dali.Property.Value( value ) );
1378     }
1379   }
1380
1381   public float ColumnSpan
1382   {
1383     get
1384     {
1385       float temp = 0.0f;
1386       GetProperty( TableView.ChildProperty.COLUMN_SPAN).Get( ref temp );
1387       return temp;
1388     }
1389     set
1390     {
1391       SetProperty( TableView.ChildProperty.COLUMN_SPAN, new Dali.Property.Value( value ) );
1392     }
1393   }
1394
1395   public string CellHorizontalAlignment
1396   {
1397     get
1398     {
1399       string temp;
1400       GetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get( out temp );
1401       return temp;
1402     }
1403     set
1404     {
1405       SetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Dali.Property.Value( value ) );
1406     }
1407   }
1408
1409   public string CellVerticalAlignment
1410   {
1411     get
1412     {
1413       string temp;
1414       GetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get( out temp );
1415       return temp;
1416     }
1417     set
1418     {
1419       SetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Dali.Property.Value( value ) );
1420     }
1421   }
1422
1423   /**
1424    * @brief The left focusable view.
1425    * @note This will return NULL if not set.
1426    * This will also return NULL if the specified left focusable view is not on stage.
1427    *
1428    */
1429   public View LeftFocusableView
1430   {
1431     // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1432     get
1433     {
1434       if (LeftFocusableActorId >= 0)
1435       {
1436         return ConvertIdToView((uint)LeftFocusableActorId);
1437       }
1438       return null;
1439     }
1440     set
1441     {
1442       LeftFocusableActorId = (int)value.GetId();
1443     }
1444   }
1445
1446   /**
1447    * @brief The right focusable view.
1448    * @note This will return NULL if not set.
1449    * This will also return NULL if the specified right focusable view is not on stage.
1450    *
1451    */
1452   public View RightFocusableView
1453   {
1454     // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1455     get
1456     {
1457       if (RightFocusableActorId >= 0)
1458       {
1459         return ConvertIdToView((uint)RightFocusableActorId);
1460       }
1461       return null;
1462     }
1463     set
1464     {
1465       RightFocusableActorId = (int)value.GetId();
1466     }
1467   }
1468
1469   /**
1470    * @brief The up focusable view.
1471    * @note This will return NULL if not set.
1472    * This will also return NULL if the specified up focusable view is not on stage.
1473    *
1474    */
1475   public View UpFocusableView
1476   {
1477     // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1478     get
1479     {
1480       if (UpFocusableActorId >= 0)
1481       {
1482         return ConvertIdToView((uint)UpFocusableActorId);
1483       }
1484       return null;
1485     }
1486     set
1487     {
1488       UpFocusableActorId = (int)value.GetId();
1489     }
1490   }
1491
1492   /**
1493    * @brief The down focusable view.
1494    * @note This will return NULL if not set.
1495    * This will also return NULL if the specified down focusable view is not on stage.
1496    *
1497    */
1498   public View DownFocusableView
1499   {
1500     // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1501     get
1502     {
1503       if (DownFocusableActorId >= 0)
1504       {
1505         return ConvertIdToView((uint)DownFocusableActorId);
1506       }
1507       return null;
1508     }
1509     set
1510     {
1511       DownFocusableActorId = (int)value.GetId();
1512     }
1513   }
1514 }
1515
1516 }