2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using System.ComponentModel;
26 /// Cube Transition Effect base class, used to apply custom effects to a
27 /// Cube Transition instance.
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
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34 private EventHandler<TransitionCompletedEventArgs> _transitionCompletedEventHandler;
35 private TransitionCompletedCallbackDelegate _transitionCompletedCallbackDelegate;
37 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
38 private delegate void TransitionCompletedCallbackDelegate(IntPtr cubeTransition, IntPtr cubeTexture);
43 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
44 [EditorBrowsable(EditorBrowsableState.Never)]
45 public CubeTransitionEffect() : this(Interop.CubeTransitionEffect.new_CubeTransitionEffect(), true)
47 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionEffect obj)
52 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
55 internal CubeTransitionEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionEffect.CubeTransitionEffect_SWIGUpcast(cPtr), cMemoryOwn)
57 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
60 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
61 [EditorBrowsable(EditorBrowsableState.Never)]
62 public void SetTransitionDuration(float duration)
64 Interop.CubeTransitionEffect.CubeTransitionEffect_SetTransitionDuration(swigCPtr, duration);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
68 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 public float GetTransitionDuration()
72 float result = Interop.CubeTransitionEffect.CubeTransitionEffect_GetTransitionDuration(swigCPtr);
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public void SetCubeDisplacement(float displacement)
81 Interop.CubeTransitionEffect.CubeTransitionEffect_SetCubeDisplacement(swigCPtr, displacement);
82 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 public float GetCubeDisplacement()
89 float result = Interop.CubeTransitionEffect.CubeTransitionEffect_GetCubeDisplacement(swigCPtr);
90 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public bool IsTransitioning()
98 bool result = Interop.CubeTransitionEffect.CubeTransitionEffect_IsTransitioning(swigCPtr);
99 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public void SetCurrentTexture(Texture texture)
107 Interop.CubeTransitionEffect.CubeTransitionEffect_SetCurrentTexture(swigCPtr, Texture.getCPtr(texture));
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
112 [EditorBrowsable(EditorBrowsableState.Never)]
113 public void SetTargetTexture(Texture texture)
115 Interop.CubeTransitionEffect.CubeTransitionEffect_SetTargetTexture(swigCPtr, Texture.getCPtr(texture));
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
120 [EditorBrowsable(EditorBrowsableState.Never)]
121 public void StartTransition(bool toNextImage = true)
123 Interop.CubeTransitionEffect.CubeTransitionEffect_StartTransition__SWIG1(swigCPtr, toNextImage);
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
128 [EditorBrowsable(EditorBrowsableState.Never)]
129 public void StartTransition(Vector2 panPosition, Vector2 panDisplacement)
131 Interop.CubeTransitionEffect.CubeTransitionEffect_StartTransition__SWIG2(swigCPtr, Vector2.getCPtr(panPosition), Vector2.getCPtr(panDisplacement));
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public void PauseTransition()
139 Interop.CubeTransitionEffect.CubeTransitionEffect_PauseTransition(swigCPtr);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public void ResumeTransition()
147 Interop.CubeTransitionEffect.CubeTransitionEffect_ResumeTransition(swigCPtr);
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 public void StopTransition()
155 Interop.CubeTransitionEffect.CubeTransitionEffect_StopTransition(swigCPtr);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 CubeTransitionEffectSignal TransitionCompletedSignal()
161 CubeTransitionEffectSignal ret = new CubeTransitionEffectSignal(Interop.CubeTransitionEffect.CubeTransitionEffect_TransitionCompletedSignal(swigCPtr), false);
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 /// The TransitionCompleted event.
169 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
170 [EditorBrowsable(EditorBrowsableState.Never)]
171 public event EventHandler<TransitionCompletedEventArgs> TransitionCompleted
175 if (_transitionCompletedEventHandler == null)
177 _transitionCompletedCallbackDelegate = (OnTransitionCompleted);
178 TransitionCompletedSignal().Connect(_transitionCompletedCallbackDelegate);
180 _transitionCompletedEventHandler += value;
184 _transitionCompletedEventHandler -= value;
185 if (_transitionCompletedEventHandler == null && TransitionCompletedSignal().Empty() == false)
187 TransitionCompletedSignal().Disconnect(_transitionCompletedCallbackDelegate);
192 private void OnTransitionCompleted(IntPtr cubeTransition, IntPtr cubeTexture)
194 TransitionCompletedEventArgs e = new TransitionCompletedEventArgs();
196 // Populate all members of "e" (TransitionCompletedEventArgs) with real data
197 //e.CubeTransitionEffect = Registry.GetManagedBaseHandleFromNativePtr(cubeTransition) as CubeTransitionEffect;
199 if (_transitionCompletedEventHandler != null)
201 //here we send all data to user event handlers
202 _transitionCompletedEventHandler(this, e);
209 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
210 [EditorBrowsable(EditorBrowsableState.Never)]
211 protected override void Dispose(DisposeTypes type)
218 //Release your own unmanaged resources here.
219 //You should not access any managed member here except static instance.
220 //because the execution order of Finalizes is non-deterministic.
222 if (swigCPtr.Handle != global::System.IntPtr.Zero)
227 Interop.CubeTransitionEffect.delete_CubeTransitionEffect(swigCPtr);
229 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
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 class TransitionCompletedEventArgs : EventArgs
239 private CubeTransitionEffect _cubeTransitionEffect;
240 private Texture _cubeTransitonTexture;
243 /// CubeTransitionEffect.
245 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
246 [EditorBrowsable(EditorBrowsableState.Never)]
247 public CubeTransitionEffect CubeTransitionEffect
251 return _cubeTransitionEffect;
255 _cubeTransitionEffect = value;
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 Texture CubeTransitonTexture
265 return _cubeTransitonTexture;
269 _cubeTransitonTexture = value;
275 internal class CubeTransitionEffectSignal : Disposable
277 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
278 protected bool swigCMemOwn;
280 internal CubeTransitionEffectSignal(global::System.IntPtr cPtr, bool cMemoryOwn)
282 swigCMemOwn = cMemoryOwn;
283 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
286 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionEffectSignal obj)
288 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
291 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
292 [EditorBrowsable(EditorBrowsableState.Never)]
295 bool ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Empty(swigCPtr);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
301 [EditorBrowsable(EditorBrowsableState.Never)]
302 public uint GetConnectionCount()
304 uint ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_GetConnectionCount(swigCPtr);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 public void Connect(System.Delegate func)
313 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
315 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
321 [EditorBrowsable(EditorBrowsableState.Never)]
322 public void Disconnect(System.Delegate func)
324 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
326 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
332 [EditorBrowsable(EditorBrowsableState.Never)]
333 public void Emit(CubeTransitionEffect arg)
335 Interop.TextField.TextFieldSignal_Emit(swigCPtr, CubeTransitionEffect.getCPtr(arg));
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
340 [EditorBrowsable(EditorBrowsableState.Never)]
341 public CubeTransitionEffectSignal() : this(Interop.CubeTransitionEffect.new_CubeTransitionEffectSignal(), true)
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 protected override void Dispose(DisposeTypes type)
355 //Release your own unmanaged resources here.
356 //You should not access any managed member here except static instance.
357 //because the execution order of Finalizes is non-deterministic.
359 if (swigCPtr.Handle != global::System.IntPtr.Zero)
364 Interop.CubeTransitionEffect.delete_CubeTransitionEffectSignal(swigCPtr);
366 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
373 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
374 [EditorBrowsable(EditorBrowsableState.Never)]
375 public class CubeTransitionWaveEffect : CubeTransitionEffect
377 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
382 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
383 [EditorBrowsable(EditorBrowsableState.Never)]
384 public CubeTransitionWaveEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_New(numRows, numColumns), true)
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionWaveEffect obj)
391 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
394 internal CubeTransitionWaveEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
396 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
402 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
403 [EditorBrowsable(EditorBrowsableState.Never)]
404 protected override void Dispose(DisposeTypes type)
411 //Release your own unmanaged resources here.
412 //You should not access any managed member here except static instance.
413 //because the execution order of Finalizes is non-deterministic.
415 if (swigCPtr.Handle != global::System.IntPtr.Zero)
420 Interop.CubeTransitionWaveEffect.delete_CubeTransitionWaveEffect(swigCPtr);
422 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
429 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
430 [EditorBrowsable(EditorBrowsableState.Never)]
431 public class CubeTransitionCrossEffect : CubeTransitionEffect
433 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
438 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
439 [EditorBrowsable(EditorBrowsableState.Never)]
440 public CubeTransitionCrossEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionCrossEffect.CubeTransitionCrossEffect_New(numRows, numColumns), true)
442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionCrossEffect obj)
447 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
450 internal CubeTransitionCrossEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionCrossEffect.CubeTransitionCrossEffect_SWIGUpcast(cPtr), cMemoryOwn)
452 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
458 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
459 [EditorBrowsable(EditorBrowsableState.Never)]
460 protected override void Dispose(DisposeTypes type)
467 //Release your own unmanaged resources here.
468 //You should not access any managed member here except static instance.
469 //because the execution order of Finalizes is non-deterministic.
471 if (swigCPtr.Handle != global::System.IntPtr.Zero)
476 Interop.CubeTransitionCrossEffect.delete_CubeTransitionCrossEffect(swigCPtr);
478 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
485 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
486 [EditorBrowsable(EditorBrowsableState.Never)]
487 public class CubeTransitionFoldEffect : CubeTransitionEffect
489 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
494 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
495 [EditorBrowsable(EditorBrowsableState.Never)]
496 public CubeTransitionFoldEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionFoldEffect.CubeTransitionFoldEffect_New(numRows, numColumns), true)
498 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
501 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionFoldEffect obj)
503 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
506 internal CubeTransitionFoldEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
508 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
514 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
515 [EditorBrowsable(EditorBrowsableState.Never)]
516 protected override void Dispose(DisposeTypes type)
523 //Release your own unmanaged resources here.
524 //You should not access any managed member here except static instance.
525 //because the execution order of Finalizes is non-deterministic.
527 if (swigCPtr.Handle != global::System.IntPtr.Zero)
532 Interop.CubeTransitionFoldEffect.delete_CubeTransitionFoldEffect(swigCPtr);
534 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);