[NUI] Fix Svace issue (#949)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / CustomActorImpl.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     using Tizen.NUI.BaseComponents;
21
22     internal class CustomActorImpl : RefObject
23     {
24         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25
26         internal CustomActorImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CustomActorImpl.CustomActorImpl_SWIGUpcast(cPtr), cMemoryOwn)
27         {
28             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29         }
30
31         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CustomActorImpl obj)
32         {
33             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34         }
35
36         protected override void Dispose(DisposeTypes type)
37         {
38             if (disposed)
39             {
40                 return;
41             }
42
43             if (type == DisposeTypes.Explicit)
44             {
45                 //Called by User
46                 //Release your own managed resources here.
47                 //You should release all of your own disposable objects here.
48
49             }
50
51             //Release your own unmanaged resources here.
52             //You should not access any managed member here except static instance.
53             //because the execution order of Finalizes is non-deterministic.
54
55             if (swigCPtr.Handle != global::System.IntPtr.Zero)
56             {
57                 if (swigCMemOwn)
58                 {
59                     swigCMemOwn = false;
60                     throw new global::System.MethodAccessException("C++ destructor does not have public access");
61                 }
62                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
63             }
64
65             base.Dispose(type);
66         }
67
68         internal CustomActor Self()
69         {
70             CustomActor ret = new CustomActor(Interop.CustomActorImpl.CustomActorImpl_Self(swigCPtr), true);
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72             return ret;
73         }
74
75         public virtual void OnStageConnection(int depth)
76         {
77             Interop.CustomActorImpl.CustomActorImpl_OnStageConnection(swigCPtr, depth);
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79         }
80
81         public virtual void OnStageDisconnection()
82         {
83             Interop.CustomActorImpl.CustomActorImpl_OnStageDisconnection(swigCPtr);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85         }
86
87         public virtual void OnChildAdd(View child)
88         {
89             Interop.CustomActorImpl.CustomActorImpl_OnChildAdd(swigCPtr, View.getCPtr(child));
90             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91         }
92
93         public virtual void OnChildRemove(View child)
94         {
95             Interop.CustomActorImpl.CustomActorImpl_OnChildRemove(swigCPtr, View.getCPtr(child));
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         public virtual void OnPropertySet(int index, PropertyValue propertyValue)
100         {
101             Interop.CustomActorImpl.CustomActorImpl_OnPropertySet(swigCPtr, index, PropertyValue.getCPtr(propertyValue));
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103         }
104
105         public virtual void OnSizeSet(Vector3 targetSize)
106         {
107             Interop.CustomActorImpl.CustomActorImpl_OnSizeSet(swigCPtr, Vector3.getCPtr(targetSize));
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109         }
110
111         public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
112         {
113             Interop.CustomActorImpl.CustomActorImpl_OnSizeAnimation(swigCPtr, Animation.getCPtr(animation), Vector3.getCPtr(targetSize));
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115         }
116
117         internal virtual bool OnTouchEvent(SWIGTYPE_p_Dali__TouchEvent arg0)
118         {
119             bool ret = Interop.CustomActorImpl.CustomActorImpl_OnTouchEvent(swigCPtr, SWIGTYPE_p_Dali__TouchEvent.getCPtr(arg0));
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121             return ret;
122         }
123
124         public virtual bool OnHoverEvent(Hover arg0)
125         {
126             bool ret = Interop.CustomActorImpl.CustomActorImpl_OnHoverEvent(swigCPtr, Hover.getCPtr(arg0));
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         public virtual bool OnKeyEvent(Key arg0)
132         {
133             bool ret = Interop.CustomActorImpl.CustomActorImpl_OnKeyEvent(swigCPtr, Key.getCPtr(arg0));
134             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135             return ret;
136         }
137
138         public virtual bool OnWheelEvent(Wheel arg0)
139         {
140             bool ret = Interop.CustomActorImpl.CustomActorImpl_OnWheelEvent(swigCPtr, Wheel.getCPtr(arg0));
141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142             return ret;
143         }
144
145         public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
146         {
147             Interop.CustomActorImpl.CustomActorImpl_OnRelayout(swigCPtr, Vector2.getCPtr(size), RelayoutContainer.getCPtr(container));
148             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149         }
150
151         public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
152         {
153             Interop.CustomActorImpl.CustomActorImpl_OnSetResizePolicy(swigCPtr, (int)policy, (int)dimension);
154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155         }
156
157         public virtual Vector3 GetNaturalSize()
158         {
159             Vector3 ret = new Vector3(Interop.CustomActorImpl.CustomActorImpl_GetNaturalSize(swigCPtr), true);
160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161             return ret;
162         }
163
164         public virtual float CalculateChildSize(View child, DimensionType dimension)
165         {
166             float ret = Interop.CustomActorImpl.CustomActorImpl_CalculateChildSize(swigCPtr, View.getCPtr(child), (int)dimension);
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168             return ret;
169         }
170
171         public virtual float GetHeightForWidth(float width)
172         {
173             float ret = Interop.CustomActorImpl.CustomActorImpl_GetHeightForWidth(swigCPtr, width);
174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175             return ret;
176         }
177
178         public virtual float GetWidthForHeight(float height)
179         {
180             float ret = Interop.CustomActorImpl.CustomActorImpl_GetWidthForHeight(swigCPtr, height);
181             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182             return ret;
183         }
184
185         public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
186         {
187             bool ret = Interop.CustomActorImpl.CustomActorImpl_RelayoutDependentOnChildren__SWIG_0(swigCPtr, (int)dimension);
188             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189             return ret;
190         }
191
192         public virtual bool RelayoutDependentOnChildren()
193         {
194             bool ret = Interop.CustomActorImpl.CustomActorImpl_RelayoutDependentOnChildren__SWIG_1(swigCPtr);
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196             return ret;
197         }
198
199         public virtual void OnCalculateRelayoutSize(DimensionType dimension)
200         {
201             Interop.CustomActorImpl.CustomActorImpl_OnCalculateRelayoutSize(swigCPtr, (int)dimension);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203         }
204
205         public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
206         {
207             Interop.CustomActorImpl.CustomActorImpl_OnLayoutNegotiated(swigCPtr, size, (int)dimension);
208             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209         }
210
211         public bool RequiresTouchEvents()
212         {
213             bool ret = Interop.CustomActorImpl.CustomActorImpl_RequiresTouchEvents(swigCPtr);
214             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215             return ret;
216         }
217
218         public bool RequiresHoverEvents()
219         {
220             bool ret = Interop.CustomActorImpl.CustomActorImpl_RequiresHoverEvents(swigCPtr);
221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222             return ret;
223         }
224
225         public bool RequiresWheelEvents()
226         {
227             bool ret = Interop.CustomActorImpl.CustomActorImpl_RequiresWheelEvents(swigCPtr);
228             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229             return ret;
230         }
231
232         public bool IsRelayoutEnabled()
233         {
234             bool ret = Interop.CustomActorImpl.CustomActorImpl_IsRelayoutEnabled(swigCPtr);
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236             return ret;
237         }
238
239     }
240
241 }