Note that some Text propeties in devel api can't be changed
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / 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
17 namespace Dali
18 {
19
20     public class Layer : Animatable
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23
24         internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn)
25         {
26             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         ~Layer()
35         {
36             DisposeQueue.Instance.Add(this);
37         }
38
39         public virtual void Dispose()
40         {
41             if (!Window.IsInstalled())
42             {
43                 DisposeQueue.Instance.Add(this);
44                 return;
45             }
46
47             lock (this)
48             {
49                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
50                 {
51                     if (swigCMemOwn)
52                     {
53                         swigCMemOwn = false;
54                         NDalicPINVOKE.delete_Layer(swigCPtr);
55                     }
56                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57                 }
58                 global::System.GC.SuppressFinalize(this);
59             }
60         }
61
62         public class Property
63         {
64             public static readonly int CLIPPING_ENABLE = NDalicPINVOKE.Layer_Property_CLIPPING_ENABLE_get();
65             public static readonly int CLIPPING_BOX = NDalicPINVOKE.Layer_Property_CLIPPING_BOX_get();
66             public static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get();
67         }
68
69         public Layer() : this(NDalicPINVOKE.Layer_New(), true)
70         {
71             if (NDalicPINVOKE.SWIGPendingException.Pending)
72                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73
74         }
75
76         internal new static Layer DownCast(BaseHandle handle)
77         {
78             Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
79             if (NDalicPINVOKE.SWIGPendingException.Pending)
80                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81             return ret;
82         }
83
84         public View FindChildById(uint id)
85         {
86             View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
87             if (NDalicPINVOKE.SWIGPendingException.Pending)
88                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89             return ret;
90         }
91
92         public void Add(View child)
93         {
94             NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
95             if (NDalicPINVOKE.SWIGPendingException.Pending)
96                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         public void Remove(View child)
100         {
101             NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
102             if (NDalicPINVOKE.SWIGPendingException.Pending)
103                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104         }
105
106         public uint GetDepth()
107         {
108             uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr);
109             if (NDalicPINVOKE.SWIGPendingException.Pending)
110                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111             return ret;
112         }
113
114         public void Raise()
115         {
116             NDalicPINVOKE.Layer_Raise(swigCPtr);
117             if (NDalicPINVOKE.SWIGPendingException.Pending)
118                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119         }
120
121         public void Lower()
122         {
123             NDalicPINVOKE.Layer_Lower(swigCPtr);
124             if (NDalicPINVOKE.SWIGPendingException.Pending)
125                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126         }
127
128         public void RaiseAbove(Layer target)
129         {
130             NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
131             if (NDalicPINVOKE.SWIGPendingException.Pending)
132                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133         }
134
135         public void LowerBelow(Layer target)
136         {
137             NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
138             if (NDalicPINVOKE.SWIGPendingException.Pending)
139                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140         }
141
142         public void RaiseToTop()
143         {
144             NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
145             if (NDalicPINVOKE.SWIGPendingException.Pending)
146                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147         }
148
149         public void LowerToBottom()
150         {
151             NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
152             if (NDalicPINVOKE.SWIGPendingException.Pending)
153                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154         }
155
156         public void MoveAbove(Layer target)
157         {
158             NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
159             if (NDalicPINVOKE.SWIGPendingException.Pending)
160                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161         }
162
163         public void MoveBelow(Layer target)
164         {
165             NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
166             if (NDalicPINVOKE.SWIGPendingException.Pending)
167                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168         }
169
170         private void SetBehavior(Layer.LayerBehavior behavior)
171         {
172             NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior);
173             if (NDalicPINVOKE.SWIGPendingException.Pending)
174                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175         }
176
177         private Layer.LayerBehavior GetBehavior()
178         {
179             Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr);
180             if (NDalicPINVOKE.SWIGPendingException.Pending)
181                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182             return ret;
183         }
184
185         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
186         {
187             NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
188             if (NDalicPINVOKE.SWIGPendingException.Pending)
189                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190         }
191
192         public void SetTouchConsumed(bool consume)
193         {
194             NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume);
195             if (NDalicPINVOKE.SWIGPendingException.Pending)
196                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197         }
198
199         public bool IsTouchConsumed()
200         {
201             bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr);
202             if (NDalicPINVOKE.SWIGPendingException.Pending)
203                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204             return ret;
205         }
206
207         public void SetHoverConsumed(bool consume)
208         {
209             NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume);
210             if (NDalicPINVOKE.SWIGPendingException.Pending)
211                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212         }
213
214         public bool IsHoverConsumed()
215         {
216             bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr);
217             if (NDalicPINVOKE.SWIGPendingException.Pending)
218                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219             return ret;
220         }
221
222         public enum LayerBehavior
223         {
224             LAYER_2D,
225             LAYER_UI = LAYER_2D,
226             LAYER_3D
227         }
228
229         public enum TreeDepthMultiplier
230         {
231             TREE_DEPTH_MULTIPLIER = 10000
232         }
233
234         public Layer.LayerBehavior Behavior
235         {
236             get
237             {
238                 return GetBehavior();
239             }
240             set
241             {
242                 SetBehavior(value);
243             }
244         }
245
246     }
247
248 }