nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISamples / Tizen.NUI / src / public / Layer.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 // 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 Tizen.NUI
28 {
29
30     /// <summary>
31     /// Layers provide a mechanism for overlaying groups of actors on top of each other.
32     /// </summary>
33     public class Layer : Actor
34     {
35         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36
37         internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn)
38         {
39             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40         }
41
42         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
43         {
44             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45         }
46
47         ~Layer()
48         {
49             DisposeQueue.Instance.Add(this);
50         }
51
52         public override void Dispose()
53         {
54             if (!Stage.IsInstalled())
55             {
56                 DisposeQueue.Instance.Add(this);
57                 return;
58             }
59
60             lock (this)
61             {
62                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63                 {
64                     if (swigCMemOwn)
65                     {
66                         swigCMemOwn = false;
67                         NDalicPINVOKE.delete_Layer(swigCPtr);
68                     }
69                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70                 }
71                 global::System.GC.SuppressFinalize(this);
72                 base.Dispose();
73             }
74         }
75
76
77         internal class Property : global::System.IDisposable
78         {
79             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80             protected bool swigCMemOwn;
81
82             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
83             {
84                 swigCMemOwn = cMemoryOwn;
85                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
86             }
87
88             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
89             {
90                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
91             }
92
93             ~Property()
94             {
95                 Dispose();
96             }
97
98             public virtual void Dispose()
99             {
100                 lock (this)
101                 {
102                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
103                     {
104                         if (swigCMemOwn)
105                         {
106                             swigCMemOwn = false;
107                             NDalicPINVOKE.delete_Layer_Property(swigCPtr);
108                         }
109                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
110                     }
111                     global::System.GC.SuppressFinalize(this);
112                 }
113             }
114
115             internal Property() : this(NDalicPINVOKE.new_Layer_Property(), true)
116             {
117                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118             }
119
120             internal static readonly int CLIPPING_ENABLE = NDalicPINVOKE.Layer_Property_CLIPPING_ENABLE_get();
121             internal static readonly int CLIPPING_BOX = NDalicPINVOKE.Layer_Property_CLIPPING_BOX_get();
122             internal static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get();
123
124         }
125
126         /// <summary>
127         /// Creates a Layer object.
128         /// </summary>
129         public Layer() : this(NDalicPINVOKE.Layer_New(), true)
130         {
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132
133         }
134         /// <summary>
135         /// Downcasts a handle to Layer handle.
136         /// If handle points to a Layer, the downcast produces valid handle.
137         /// If not, the returned handle is left uninitialized.
138         /// </summary>
139         /// <param name="handle">Handle to an object</param>
140         /// <returns>Handle to a Layer or an uninitialized handle</returns>
141         public new static Layer DownCast(BaseHandle handle)
142         {
143             Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
144             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145             return ret;
146         }
147
148         internal Layer(Layer copy) : this(NDalicPINVOKE.new_Layer__SWIG_1(Layer.getCPtr(copy)), true)
149         {
150             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151         }
152
153         internal Layer Assign(Layer rhs)
154         {
155             Layer ret = new Layer(NDalicPINVOKE.Layer_Assign(swigCPtr, Layer.getCPtr(rhs)), false);
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157             return ret;
158         }
159
160         /// <summary>
161         /// Queries the depth of the layer.
162         /// 0 is the bottom most layer, higher number is on top.
163         /// </summary>
164         public uint Depth
165         {
166             get
167             {
168                 return GetDepth();
169             }
170         }
171
172         internal uint GetDepth()
173         {
174             uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr);
175             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176             return ret;
177         }
178
179         /// <summary>
180         /// Increments the depth of the layer.
181         /// </summary>
182         public void Raise()
183         {
184             NDalicPINVOKE.Layer_Raise(swigCPtr);
185             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186         }
187
188         /// <summary>
189         /// Decrements the depth of the layer.
190         /// </summary>
191         public void Lower()
192         {
193             NDalicPINVOKE.Layer_Lower(swigCPtr);
194             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195         }
196
197         internal void RaiseAbove(Layer target)
198         {
199             NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201         }
202
203         internal void LowerBelow(Layer target)
204         {
205             NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
206             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207         }
208
209         /// <summary>
210         /// Raises the layer to the top.
211         /// </summary>
212         public void RaiseToTop()
213         {
214             NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216         }
217
218         /// <summary>
219         /// Lowers the layer to the bottom.
220         /// </summary>
221         public void LowerToBottom()
222         {
223             NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225         }
226
227         /// <summary>
228         /// Moves the layer directly above the given layer.
229         /// After the call, this layers depth will be immediately above target.
230         /// </summary>
231         /// <param name="target">Layer to get on top of</param>
232         public void MoveAbove(Layer target)
233         {
234             NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236         }
237
238         /// <summary>
239         /// Moves the layer directly below the given layer
240         /// After the call, this layers depth will be immediately below target.
241         /// </summary>
242         /// <param name="target">Layer to get below of</param>
243         public void MoveBelow(Layer target)
244         {
245             NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
246             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247         }
248
249         internal void SetBehavior(LayerBehavior behavior)
250         {
251             NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior);
252             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253         }
254
255         internal LayerBehavior GetBehavior()
256         {
257             Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr);
258             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259             return ret;
260         }
261
262         internal void SetClipping(bool enabled)
263         {
264             NDalicPINVOKE.Layer_SetClipping(swigCPtr, enabled);
265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266         }
267
268         internal bool IsClipping()
269         {
270             bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr);
271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272             return ret;
273         }
274
275         internal void SetClippingBox(int x, int y, int width, int height)
276         {
277             NDalicPINVOKE.Layer_SetClippingBox__SWIG_0(swigCPtr, x, y, width, height);
278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279         }
280
281         /// <summary>
282         /// Sets the clipping box of a layer, in window coordinates.
283         /// The contents of the layer will not be visible outside this box, when clipping is
284         /// enabled. The default clipping box is empty (0,0,0,0) which means everything is clipped.
285         /// </summary>
286         /// <param name="box">The clipping box</param>
287         public void SetClippingBox(Rectangle box)
288         {
289             NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(box));
290             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291         }
292
293         /// <summary>
294         /// Retrieves the clipping box of a layer in window coordinates.
295         /// </summary>
296         /// <returns>The clipping box</returns>
297         public Rectangle GetClippingBox()
298         {
299             Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true);
300             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             return ret;
302         }
303
304         internal void SetDepthTestDisabled(bool disable)
305         {
306             NDalicPINVOKE.Layer_SetDepthTestDisabled(swigCPtr, disable);
307             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308         }
309
310         internal bool IsDepthTestDisabled()
311         {
312             bool ret = NDalicPINVOKE.Layer_IsDepthTestDisabled(swigCPtr);
313             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314             return ret;
315         }
316
317         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
318         {
319             NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
320             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321         }
322
323         internal void SetTouchConsumed(bool consume)
324         {
325             NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume);
326             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327         }
328
329         internal bool IsTouchConsumed()
330         {
331             bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr);
332             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333             return ret;
334         }
335
336         internal void SetHoverConsumed(bool consume)
337         {
338             NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume);
339             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340         }
341
342         internal bool IsHoverConsumed()
343         {
344             bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr);
345             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346             return ret;
347         }
348
349         /// <summary>
350         /// Enumeration for the behavior of the layer.
351         /// </summary>
352         public enum LayerBehavior
353         {
354             Layer2D,
355             LayerUI = Layer2D,
356             Layer3D
357         }
358
359         internal enum TreeDepthMultiplier
360         {
361             TREE_DEPTH_MULTIPLIER = 10000
362         }
363
364         /// <summary>
365         /// Layer ClippingEnable, type bool
366         /// </summary>
367         public bool ClippingEnable
368         {
369             get
370             {
371                 bool temp = false;
372                 GetProperty(Layer.Property.CLIPPING_ENABLE).Get(ref temp);
373                 return temp;
374             }
375             set
376             {
377                 SetProperty(Layer.Property.CLIPPING_ENABLE, new Tizen.NUI.PropertyValue(value));
378             }
379         }
380         /// <summary>
381         /// Layer ClippingBox, type Rectangle
382         /// </summary>
383         public Rectangle ClippingBox
384         {
385             get
386             {
387                 Rectangle temp = new Rectangle(0, 0, 0, 0);
388                 GetProperty(Layer.Property.CLIPPING_BOX).Get(temp);
389                 return temp;
390             }
391             set
392             {
393                 SetProperty(Layer.Property.CLIPPING_BOX, new Tizen.NUI.PropertyValue(value));
394             }
395         }
396         /// <summary>
397         /// Layer Behavior, type String(Layer.LayerBehavior)
398         /// </summary>
399         public Layer.LayerBehavior Behavior
400         {
401             get
402             {
403                 return GetBehavior();
404             }
405             set
406             {
407                 SetBehavior(value);
408             }
409         }
410
411     }
412
413 }