Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / CustomActorImpl.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 Tizen.NUI
18 {
19     using Tizen.NUI.BaseComponents;
20     internal class CustomActorImpl : RefObject
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23
24         internal CustomActorImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.CustomActorImpl_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(CustomActorImpl obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         protected override void Dispose(DisposeTypes type)
35         {
36             if (disposed)
37             {
38                 return;
39             }
40
41             if (type == DisposeTypes.Explicit)
42             {
43                 //Called by User
44                 //Release your own managed resources here.
45                 //You should release all of your own disposable objects here.
46
47             }
48
49             //Release your own unmanaged resources here.
50             //You should not access any managed member here except static instance.
51             //because the execution order of Finalizes is non-deterministic.
52
53             if (swigCPtr.Handle != global::System.IntPtr.Zero)
54             {
55                 if (swigCMemOwn)
56                 {
57                     swigCMemOwn = false;
58                     throw new global::System.MethodAccessException("C++ destructor does not have public access");
59                 }
60                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61             }
62
63             base.Dispose(type);
64         }
65
66         internal CustomActor Self()
67         {
68             CustomActor ret = new CustomActor(NDalicPINVOKE.CustomActorImpl_Self(swigCPtr), true);
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70             return ret;
71         }
72
73         public virtual void OnStageConnection(int depth)
74         {
75             NDalicPINVOKE.CustomActorImpl_OnStageConnection(swigCPtr, depth);
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77         }
78
79         public virtual void OnStageDisconnection()
80         {
81             NDalicPINVOKE.CustomActorImpl_OnStageDisconnection(swigCPtr);
82             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83         }
84
85         public virtual void OnChildAdd(View child)
86         {
87             NDalicPINVOKE.CustomActorImpl_OnChildAdd(swigCPtr, View.getCPtr(child));
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89         }
90
91         public virtual void OnChildRemove(View child)
92         {
93             NDalicPINVOKE.CustomActorImpl_OnChildRemove(swigCPtr, View.getCPtr(child));
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95         }
96
97         public virtual void OnPropertySet(int index, PropertyValue propertyValue)
98         {
99             NDalicPINVOKE.CustomActorImpl_OnPropertySet(swigCPtr, index, PropertyValue.getCPtr(propertyValue));
100             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101         }
102
103         public virtual void OnSizeSet(Vector3 targetSize)
104         {
105             NDalicPINVOKE.CustomActorImpl_OnSizeSet(swigCPtr, Vector3.getCPtr(targetSize));
106             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107         }
108
109         public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
110         {
111             NDalicPINVOKE.CustomActorImpl_OnSizeAnimation(swigCPtr, Animation.getCPtr(animation), Vector3.getCPtr(targetSize));
112             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113         }
114
115         internal virtual bool OnTouchEvent(SWIGTYPE_p_Dali__TouchEvent arg0)
116         {
117             bool ret = NDalicPINVOKE.CustomActorImpl_OnTouchEvent(swigCPtr, SWIGTYPE_p_Dali__TouchEvent.getCPtr(arg0));
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119             return ret;
120         }
121
122         public virtual bool OnHoverEvent(Hover arg0)
123         {
124             bool ret = NDalicPINVOKE.CustomActorImpl_OnHoverEvent(swigCPtr, Hover.getCPtr(arg0));
125             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126             return ret;
127         }
128
129         public virtual bool OnKeyEvent(Key arg0)
130         {
131             bool ret = NDalicPINVOKE.CustomActorImpl_OnKeyEvent(swigCPtr, Key.getCPtr(arg0));
132             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133             return ret;
134         }
135
136         public virtual bool OnWheelEvent(Wheel arg0)
137         {
138             bool ret = NDalicPINVOKE.CustomActorImpl_OnWheelEvent(swigCPtr, Wheel.getCPtr(arg0));
139             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140             return ret;
141         }
142
143         public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
144         {
145             NDalicPINVOKE.CustomActorImpl_OnRelayout(swigCPtr, Vector2.getCPtr(size), RelayoutContainer.getCPtr(container));
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147         }
148
149         public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
150         {
151             NDalicPINVOKE.CustomActorImpl_OnSetResizePolicy(swigCPtr, (int)policy, (int)dimension);
152             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153         }
154
155         public virtual Vector3 GetNaturalSize()
156         {
157             Vector3 ret = new Vector3(NDalicPINVOKE.CustomActorImpl_GetNaturalSize(swigCPtr), true);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162         public virtual float CalculateChildSize(View child, DimensionType dimension)
163         {
164             float ret = NDalicPINVOKE.CustomActorImpl_CalculateChildSize(swigCPtr, View.getCPtr(child), (int)dimension);
165             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166             return ret;
167         }
168
169         public virtual float GetHeightForWidth(float width)
170         {
171             float ret = NDalicPINVOKE.CustomActorImpl_GetHeightForWidth(swigCPtr, width);
172             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173             return ret;
174         }
175
176         public virtual float GetWidthForHeight(float height)
177         {
178             float ret = NDalicPINVOKE.CustomActorImpl_GetWidthForHeight(swigCPtr, height);
179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180             return ret;
181         }
182
183         public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
184         {
185             bool ret = NDalicPINVOKE.CustomActorImpl_RelayoutDependentOnChildren__SWIG_0(swigCPtr, (int)dimension);
186             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187             return ret;
188         }
189
190         public virtual bool RelayoutDependentOnChildren()
191         {
192             bool ret = NDalicPINVOKE.CustomActorImpl_RelayoutDependentOnChildren__SWIG_1(swigCPtr);
193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194             return ret;
195         }
196
197         public virtual void OnCalculateRelayoutSize(DimensionType dimension)
198         {
199             NDalicPINVOKE.CustomActorImpl_OnCalculateRelayoutSize(swigCPtr, (int)dimension);
200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201         }
202
203         public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
204         {
205             NDalicPINVOKE.CustomActorImpl_OnLayoutNegotiated(swigCPtr, size, (int)dimension);
206             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207         }
208
209         public bool RequiresTouchEvents()
210         {
211             bool ret = NDalicPINVOKE.CustomActorImpl_RequiresTouchEvents(swigCPtr);
212             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213             return ret;
214         }
215
216         public bool RequiresHoverEvents()
217         {
218             bool ret = NDalicPINVOKE.CustomActorImpl_RequiresHoverEvents(swigCPtr);
219             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220             return ret;
221         }
222
223         public bool RequiresWheelEvents()
224         {
225             bool ret = NDalicPINVOKE.CustomActorImpl_RequiresWheelEvents(swigCPtr);
226             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227             return ret;
228         }
229
230         public bool IsRelayoutEnabled()
231         {
232             bool ret = NDalicPINVOKE.CustomActorImpl_IsRelayoutEnabled(swigCPtr);
233             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234             return ret;
235         }
236
237     }
238
239 }