Merge "This patch is for refining dali application to support tizen c# application...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / View.cs
1 /** Copyright (c) 2016 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 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class View : CustomActor {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36   internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
37     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38   }
39
40   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
41     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42   }
43
44   ~View() {
45     Dispose();
46   }
47
48   public override void Dispose() {
49     lock(this) {
50       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
51         if (swigCMemOwn) {
52           swigCMemOwn = false;
53           NDalicPINVOKE.delete_View(swigCPtr);
54         }
55         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56       }
57       global::System.GC.SuppressFinalize(this);
58       base.Dispose();
59     }
60   }
61
62
63
64 /**
65   * @brief Event arguments that passed via KeyInputFocusGained signal
66   *
67   */
68 public class KeyInputFocusGainedEventArgs : EventArgs
69 {
70    private View _view;
71
72    /**
73      * @brief View - is the view that gets Key Input Focus
74      *
75      */
76    public View View
77    {
78       get
79       {
80          return _view;
81       }
82       set
83       {
84          _view = value;
85       }
86    }
87 }
88
89 /**
90   * @brief Event arguments that passed via KeyInputFocusLost signal
91   *
92   */
93 public class KeyInputFocusLostEventArgs : EventArgs
94 {
95    private View _view;
96
97    /**
98      * @brief View - is the view that loses Key Input Focus
99      *
100      */
101    public View View
102    {
103       get
104       {
105          return _view;
106       }
107       set
108       {
109          _view = value;
110       }
111    }
112 }
113
114 /**
115   * @brief Event arguments that passed via KeyEvent signal
116   *
117   */
118 public class KeyEventArgs : EventArgs
119 {
120    private View _view;
121    private KeyEvent _keyEvent;
122
123    /**
124      * @brief View - is the view that recieves the keyevent.
125      *
126      */
127    public View View
128    {
129       get
130       {
131          return _view;
132       }
133       set
134       {
135          _view = value;
136       }
137    }
138
139    /**
140      * @brief KeyEvent - is the keyevent sent to the View.
141      *
142      */
143    public KeyEvent KeyEvent
144    {
145       get
146       {
147          return _keyEvent;
148       }
149       set
150       {
151          _keyEvent = value;
152       }
153    }
154 }
155
156   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
157   private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
158   private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
159   private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
160
161   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
162   private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
163   private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
164   private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
165
166   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
167   private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr keyEvent);
168   private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyEventHandler;
169   private KeyCallbackDelegate _KeyCallbackDelegate;
170
171   /**
172     * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
173     * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>) 
174     * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
175     */
176   public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
177   {
178      add
179      {
180         lock(this)
181         {
182            // Restricted to only one listener
183            if (_KeyInputFocusGainedEventHandler == null)
184            {
185               _KeyInputFocusGainedEventHandler += value;
186
187               _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
188               this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
189            }
190         }
191      }
192
193      remove
194      {
195         lock(this)
196         {
197            if (_KeyInputFocusGainedEventHandler != null)
198            {
199               this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
200            }
201
202            _KeyInputFocusGainedEventHandler -= value;
203         }
204      }
205   }
206
207  private void OnKeyInputFocusGained(IntPtr view)
208   {
209    KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
210
211    // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
212    e.View = Dali.View.GetViewFromPtr(view);
213
214    if (_KeyInputFocusGainedEventHandler != null)
215    {
216       //here we send all data to user event handlers
217       _KeyInputFocusGainedEventHandler(this, e);
218    }
219
220   }
221
222   /**
223     * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
224     * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>) 
225     * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
226     */
227   public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
228   {
229      add
230      {
231         lock(this)
232         {
233            // Restricted to only one listener
234            if (_KeyInputFocusLostEventHandler == null)
235            {
236               _KeyInputFocusLostEventHandler += value;
237
238               _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
239               this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
240            }
241         }
242      }
243
244      remove
245      {
246         lock(this)
247         {
248            if (_KeyInputFocusLostEventHandler != null)
249            {
250               this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
251            }
252
253            _KeyInputFocusLostEventHandler -= value;
254         }
255      }
256   }
257
258  private void OnKeyInputFocusLost(IntPtr view)
259   {
260    KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
261
262    // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
263    e.View = Dali.View.GetViewFromPtr(view);
264
265    if (_KeyInputFocusLostEventHandler != null)
266    {
267       //here we send all data to user event handlers
268       _KeyInputFocusLostEventHandler(this, e);
269    }
270   }
271
272   /**
273     * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
274     * (in the type of KeyEventEventHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>) 
275     * provided by the user. KeyPressed signal is emitted when key event is received.
276     */
277   public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
278   {
279      add
280      {
281         lock(this)
282         {
283            // Restricted to only one listener
284            if (_KeyEventHandler == null)
285            {
286               _KeyEventHandler += value;
287
288               _KeyCallbackDelegate = new KeyCallbackDelegate(OnKeyEvent);
289               this.KeyEventSignal().Connect(_KeyCallbackDelegate);
290            }
291         }
292      }
293
294      remove
295      {
296         lock(this)
297         {
298            if (_KeyEventHandler != null)
299            {
300               this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
301            }
302
303            _KeyEventHandler -= value;
304         }
305      }
306   }
307
308  private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
309   {
310    KeyEventArgs e = new KeyEventArgs();
311
312    // Populate all members of "e" (KeyEventArgs) with real data
313    e.View = Dali.View.GetViewFromPtr(view);
314    e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent);
315
316    if (_KeyEventHandler != null)
317    {
318       //here we send all data to user event handlers
319       return _KeyEventHandler(this, e, true);
320    }
321    return false;
322
323   }
324
325  public static View GetViewFromPtr(global::System.IntPtr cPtr) {
326     View ret = new View(cPtr, false);
327    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328     return ret;
329   }
330
331
332   public class Property : global::System.IDisposable {
333     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
334     protected bool swigCMemOwn;
335   
336     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
337       swigCMemOwn = cMemoryOwn;
338       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
339     }
340   
341     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
342       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
343     }
344   
345     ~Property() {
346       Dispose();
347     }
348   
349     public virtual void Dispose() {
350       lock(this) {
351         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
352           if (swigCMemOwn) {
353             swigCMemOwn = false;
354             NDalicPINVOKE.delete_View_Property(swigCPtr);
355           }
356           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
357         }
358         global::System.GC.SuppressFinalize(this);
359       }
360     }
361   
362     public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
363       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364     }
365   
366     public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
367     public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
368     public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
369     public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
370     public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
371   
372   }
373
374   public class KeyboardFocus : global::System.IDisposable {
375     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
376     protected bool swigCMemOwn;
377   
378     internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
379       swigCMemOwn = cMemoryOwn;
380       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
381     }
382   
383     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
384       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
385     }
386   
387     ~KeyboardFocus() {
388       Dispose();
389     }
390   
391     public virtual void Dispose() {
392       lock(this) {
393         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
394           if (swigCMemOwn) {
395             swigCMemOwn = false;
396             NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
397           }
398           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
399         }
400         global::System.GC.SuppressFinalize(this);
401       }
402     }
403   
404     public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
405       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406     }
407   
408     public enum Direction {
409       LEFT,
410       RIGHT,
411       UP,
412       DOWN
413     }
414   
415   }
416
417   public View () : this (NDalicPINVOKE.View_New(), true) {
418       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419
420   }
421   public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
422     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
423   }
424
425   public View Assign(View handle) {
426     View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
427     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428     return ret;
429   }
430
431   public new static View DownCast(BaseHandle handle) {
432     View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
433     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434     return ret;
435   }
436
437   public void SetKeyInputFocus() {
438     NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
439     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440   }
441
442   public bool HasKeyInputFocus() {
443     bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
444     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445     return ret;
446   }
447
448   public void ClearKeyInputFocus() {
449     NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
450     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451   }
452
453   public PinchGestureDetector GetPinchGestureDetector() {
454     PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
455     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
456     return ret;
457   }
458
459   public PanGestureDetector GetPanGestureDetector() {
460     PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
461     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462     return ret;
463   }
464
465   public TapGestureDetector GetTapGestureDetector() {
466     TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
467     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468     return ret;
469   }
470
471   public LongPressGestureDetector GetLongPressGestureDetector() {
472     LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
473     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474     return ret;
475   }
476
477   public void SetStyleName(string styleName) {
478     NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
479     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480   }
481
482   public string GetStyleName() {
483     string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
484     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485     return ret;
486   }
487
488   public void SetBackgroundColor(Vector4 color) {
489     NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
490     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491   }
492
493   public Vector4 GetBackgroundColor() {
494     Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
495     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
496     return ret;
497   }
498
499   public void SetBackgroundImage(Image image) {
500     NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
501     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502   }
503
504   public void ClearBackground() {
505     NDalicPINVOKE.View_ClearBackground(swigCPtr);
506     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507   }
508
509   public ControlKeyEventSignal KeyEventSignal() {
510     ControlKeyEventSignal ret = new ControlKeyEventSignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
511     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512     return ret;
513   }
514
515   public KeyInputFocusSignal KeyInputFocusGainedSignal() {
516     KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
517     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518     return ret;
519   }
520
521   public KeyInputFocusSignal KeyInputFocusLostSignal() {
522     KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
523     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
524     return ret;
525   }
526
527   public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
528     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529   }
530
531   public enum PropertyRange {
532     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
533     CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
534     CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
535   }
536
537 }
538
539 }