[NUI] Fixing the emtpy finalizers(CA1821)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / CubeTransitionEffect.cs
1 /*
2  * Copyright(c) 2019 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 using System;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using System.ComponentModel;
22
23 namespace Tizen.NUI
24 {
25     /// <summary>
26     /// Cube Transition Effect base class, used to apply custom effects to a
27     /// Cube Transition instance.
28     /// </summary>
29     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
30     [EditorBrowsable(EditorBrowsableState.Never)]
31     public class CubeTransitionEffect : View
32     {
33         private EventHandler<TransitionCompletedEventArgs> _transitionCompletedEventHandler;
34         private TransitionCompletedCallbackDelegate _transitionCompletedCallbackDelegate;
35
36         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
37         private delegate void TransitionCompletedCallbackDelegate(IntPtr cubeTransition, IntPtr cubeTexture);
38
39         /// <summary>
40         /// The constructor.
41         /// </summary>
42         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public CubeTransitionEffect() : this(Interop.CubeTransitionEffect.NewCubeTransitionEffect(), true)
45         {
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47         }
48
49         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionEffect obj)
50         {
51             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
52         }
53
54         internal CubeTransitionEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionEffect.Upcast(cPtr), cMemoryOwn)
55         {
56         }
57
58         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public void SetTransitionDuration(float duration)
61         {
62             Interop.CubeTransitionEffect.SetTransitionDuration(SwigCPtr, duration);
63             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64         }
65
66         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         public float GetTransitionDuration()
69         {
70             float result = Interop.CubeTransitionEffect.GetTransitionDuration(SwigCPtr);
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72             return result;
73         }
74
75         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
76         [EditorBrowsable(EditorBrowsableState.Never)]
77         public void SetCubeDisplacement(float displacement)
78         {
79             Interop.CubeTransitionEffect.SetCubeDisplacement(SwigCPtr, displacement);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         public float GetCubeDisplacement()
86         {
87             float result = Interop.CubeTransitionEffect.GetCubeDisplacement(SwigCPtr);
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89             return result;
90         }
91
92         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public bool IsTransitioning()
95         {
96             bool result = Interop.CubeTransitionEffect.IsTransitioning(SwigCPtr);
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             return result;
99         }
100
101         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
102         [EditorBrowsable(EditorBrowsableState.Never)]
103         public void SetCurrentTexture(Texture texture)
104         {
105             Interop.CubeTransitionEffect.SetCurrentTexture(SwigCPtr, Texture.getCPtr(texture));
106             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107         }
108
109         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
110         [EditorBrowsable(EditorBrowsableState.Never)]
111         public void SetTargetTexture(Texture texture)
112         {
113             Interop.CubeTransitionEffect.SetTargetTexture(SwigCPtr, Texture.getCPtr(texture));
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115         }
116
117         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
118         [EditorBrowsable(EditorBrowsableState.Never)]
119         public void StartTransition(bool toNextImage = true)
120         {
121             Interop.CubeTransitionEffect.StartTransitionSwig1(SwigCPtr, toNextImage);
122             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123         }
124
125         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
126         [EditorBrowsable(EditorBrowsableState.Never)]
127         public void StartTransition(Vector2 panPosition, Vector2 panDisplacement)
128         {
129             Interop.CubeTransitionEffect.StartTransitionSwig2(SwigCPtr, Vector2.getCPtr(panPosition), Vector2.getCPtr(panDisplacement));
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131         }
132
133         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
134         [EditorBrowsable(EditorBrowsableState.Never)]
135         public void PauseTransition()
136         {
137             Interop.CubeTransitionEffect.PauseTransition(SwigCPtr);
138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139         }
140
141         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
142         [EditorBrowsable(EditorBrowsableState.Never)]
143         public void ResumeTransition()
144         {
145             Interop.CubeTransitionEffect.ResumeTransition(SwigCPtr);
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147         }
148
149         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
150         [EditorBrowsable(EditorBrowsableState.Never)]
151         public void StopTransition()
152         {
153             Interop.CubeTransitionEffect.StopTransition(SwigCPtr);
154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155         }
156
157         CubeTransitionEffectSignal TransitionCompletedSignal()
158         {
159             CubeTransitionEffectSignal ret = new CubeTransitionEffectSignal(Interop.CubeTransitionEffect.TransitionCompletedSignal(SwigCPtr), false);
160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161             return ret;
162         }
163
164         /// <summary>
165         /// The TransitionCompleted event.
166         /// </summary>
167         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
168         [EditorBrowsable(EditorBrowsableState.Never)]
169         public event EventHandler<TransitionCompletedEventArgs> TransitionCompleted
170         {
171             add
172             {
173                 if (_transitionCompletedEventHandler == null)
174                 {
175                     _transitionCompletedCallbackDelegate = (OnTransitionCompleted);
176                     TransitionCompletedSignal().Connect(_transitionCompletedCallbackDelegate);
177                 }
178                 _transitionCompletedEventHandler += value;
179             }
180             remove
181             {
182                 _transitionCompletedEventHandler -= value;
183                 if (_transitionCompletedEventHandler == null && TransitionCompletedSignal().Empty() == false)
184                 {
185                     TransitionCompletedSignal().Disconnect(_transitionCompletedCallbackDelegate);
186                 }
187             }
188         }
189
190         private void OnTransitionCompleted(IntPtr cubeTransition, IntPtr cubeTexture)
191         {
192             TransitionCompletedEventArgs e = new TransitionCompletedEventArgs();
193
194             // Populate all members of "e" (TransitionCompletedEventArgs) with real data
195             //e.CubeTransitionEffect = Registry.GetManagedBaseHandleFromNativePtr(cubeTransition) as CubeTransitionEffect;
196
197             if (_transitionCompletedEventHandler != null)
198             {
199                 //here we send all data to user event handlers
200                 _transitionCompletedEventHandler(this, e);
201             }
202         }
203
204         /// This will not be public opened.
205         [EditorBrowsable(EditorBrowsableState.Never)]
206         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
207         {
208             Interop.CubeTransitionEffect.DeleteCubeTransitionEffect(swigCPtr);
209         }
210
211         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
212         [EditorBrowsable(EditorBrowsableState.Never)]
213         public class TransitionCompletedEventArgs : EventArgs
214         {
215             private CubeTransitionEffect _cubeTransitionEffect;
216             private Texture _cubeTransitonTexture;
217
218             /// <summary>
219             /// CubeTransitionEffect.
220             /// </summary>
221             /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
222             [EditorBrowsable(EditorBrowsableState.Never)]
223             public CubeTransitionEffect CubeTransitionEffect
224             {
225                 get
226                 {
227                     return _cubeTransitionEffect;
228                 }
229                 set
230                 {
231                     _cubeTransitionEffect = value;
232                 }
233             }
234
235             /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
236             [EditorBrowsable(EditorBrowsableState.Never)]
237             public Texture CubeTransitonTexture
238             {
239                 get
240                 {
241                     return _cubeTransitonTexture;
242                 }
243                 set
244                 {
245                     _cubeTransitonTexture = value;
246                 }
247             }
248         }
249     }
250
251     internal class CubeTransitionEffectSignal : Disposable
252     {
253
254         internal CubeTransitionEffectSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
255         {
256         }
257
258
259         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
260         [EditorBrowsable(EditorBrowsableState.Never)]
261         public bool Empty()
262         {
263             bool ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignalEmpty(SwigCPtr);
264             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265             return ret;
266         }
267
268         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public uint GetConnectionCount()
271         {
272             uint ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignalGetConnectionCount(SwigCPtr);
273             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274             return ret;
275         }
276
277         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
278         [EditorBrowsable(EditorBrowsableState.Never)]
279         public void Connect(System.Delegate func)
280         {
281             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
282             {
283                 Interop.CubeTransitionEffect.CubeTransitionEffectSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
284                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285             }
286         }
287
288         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
289         [EditorBrowsable(EditorBrowsableState.Never)]
290         public void Disconnect(System.Delegate func)
291         {
292             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
293             {
294                 Interop.CubeTransitionEffect.CubeTransitionEffectSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
295                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296             }
297         }
298
299         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
300         [EditorBrowsable(EditorBrowsableState.Never)]
301         public void Emit(CubeTransitionEffect arg)
302         {
303             Interop.TextField.TextFieldSignalEmit(SwigCPtr, CubeTransitionEffect.getCPtr(arg));
304             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305         }
306
307         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
308         [EditorBrowsable(EditorBrowsableState.Never)]
309         public CubeTransitionEffectSignal() : this(Interop.CubeTransitionEffect.NewCubeTransitionEffectSignal(), true)
310         {
311             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312         }
313
314         /// This will be public opened.
315         [EditorBrowsable(EditorBrowsableState.Never)]
316         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
317         {
318             Interop.CubeTransitionEffect.DeleteCubeTransitionEffectSignal(swigCPtr);
319         }
320     }
321
322     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
323     [EditorBrowsable(EditorBrowsableState.Never)]
324     public class CubeTransitionWaveEffect : CubeTransitionEffect
325     {
326
327         /// <summary>
328         /// The constructor.
329         /// </summary>
330         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
331         [EditorBrowsable(EditorBrowsableState.Never)]
332         public CubeTransitionWaveEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionWaveEffect.New(numRows, numColumns), true)
333         {
334             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335         }
336
337
338         internal CubeTransitionWaveEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.Upcast(cPtr), cMemoryOwn)
339         {
340         }
341
342         /// This will be public opened.
343         [EditorBrowsable(EditorBrowsableState.Never)]
344         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
345         {
346             Interop.CubeTransitionWaveEffect.DeleteCubeTransitionWaveEffect(swigCPtr);
347         }
348     }
349
350     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
351     [EditorBrowsable(EditorBrowsableState.Never)]
352     public class CubeTransitionCrossEffect : CubeTransitionEffect
353     {
354
355         /// <summary>
356         /// The constructor.
357         /// </summary>
358         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
359         [EditorBrowsable(EditorBrowsableState.Never)]
360         public CubeTransitionCrossEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionCrossEffect.New(numRows, numColumns), true)
361         {
362             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363         }
364
365
366         internal CubeTransitionCrossEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionCrossEffect.Upcast(cPtr), cMemoryOwn)
367         {
368         }
369
370         /// This will not be public opened.
371         [EditorBrowsable(EditorBrowsableState.Never)]
372         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
373         {
374             Interop.CubeTransitionCrossEffect.DeleteCubeTransitionCrossEffect(swigCPtr);
375         }
376     }
377
378     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
379     [EditorBrowsable(EditorBrowsableState.Never)]
380     public class CubeTransitionFoldEffect : CubeTransitionEffect
381     {
382
383         /// <summary>
384         /// The constructor.
385         /// </summary>
386         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
387         [EditorBrowsable(EditorBrowsableState.Never)]
388         public CubeTransitionFoldEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionFoldEffect.New(numRows, numColumns), true)
389         {
390             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391         }
392
393
394         internal CubeTransitionFoldEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.Upcast(cPtr), cMemoryOwn)
395         {
396         }
397
398         /// This will not be public opened.
399         [EditorBrowsable(EditorBrowsableState.Never)]
400         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
401         {
402             Interop.CubeTransitionFoldEffect.DeleteCubeTransitionFoldEffect(swigCPtr);
403         }
404     }
405 }