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 EventHandler<TransitionCompletedEventArgs> _transitionCompletedEventHandler;
34 private TransitionCompletedCallbackDelegate _transitionCompletedCallbackDelegate;
36 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
37 private delegate void TransitionCompletedCallbackDelegate(IntPtr cubeTransition, IntPtr cubeTexture);
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.new_CubeTransitionEffect(), true)
46 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
49 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionEffect obj)
51 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
54 internal CubeTransitionEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionEffect.CubeTransitionEffect_SWIGUpcast(cPtr), cMemoryOwn)
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)
62 Interop.CubeTransitionEffect.CubeTransitionEffect_SetTransitionDuration(swigCPtr, duration);
63 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
70 float result = Interop.CubeTransitionEffect.CubeTransitionEffect_GetTransitionDuration(swigCPtr);
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
79 Interop.CubeTransitionEffect.CubeTransitionEffect_SetCubeDisplacement(swigCPtr, displacement);
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
87 float result = Interop.CubeTransitionEffect.CubeTransitionEffect_GetCubeDisplacement(swigCPtr);
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
96 bool result = Interop.CubeTransitionEffect.CubeTransitionEffect_IsTransitioning(swigCPtr);
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
105 Interop.CubeTransitionEffect.CubeTransitionEffect_SetCurrentTexture(swigCPtr, Texture.getCPtr(texture));
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
113 Interop.CubeTransitionEffect.CubeTransitionEffect_SetTargetTexture(swigCPtr, Texture.getCPtr(texture));
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
121 Interop.CubeTransitionEffect.CubeTransitionEffect_StartTransition__SWIG1(swigCPtr, toNextImage);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
129 Interop.CubeTransitionEffect.CubeTransitionEffect_StartTransition__SWIG2(swigCPtr, Vector2.getCPtr(panPosition), Vector2.getCPtr(panDisplacement));
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
137 Interop.CubeTransitionEffect.CubeTransitionEffect_PauseTransition(swigCPtr);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
145 Interop.CubeTransitionEffect.CubeTransitionEffect_ResumeTransition(swigCPtr);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
153 Interop.CubeTransitionEffect.CubeTransitionEffect_StopTransition(swigCPtr);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 CubeTransitionEffectSignal TransitionCompletedSignal()
159 CubeTransitionEffectSignal ret = new CubeTransitionEffectSignal(Interop.CubeTransitionEffect.CubeTransitionEffect_TransitionCompletedSignal(swigCPtr), false);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// The TransitionCompleted event.
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
173 if (_transitionCompletedEventHandler == null)
175 _transitionCompletedCallbackDelegate = (OnTransitionCompleted);
176 TransitionCompletedSignal().Connect(_transitionCompletedCallbackDelegate);
178 _transitionCompletedEventHandler += value;
182 _transitionCompletedEventHandler -= value;
183 if (_transitionCompletedEventHandler == null && TransitionCompletedSignal().Empty() == false)
185 TransitionCompletedSignal().Disconnect(_transitionCompletedCallbackDelegate);
190 private void OnTransitionCompleted(IntPtr cubeTransition, IntPtr cubeTexture)
192 TransitionCompletedEventArgs e = new TransitionCompletedEventArgs();
194 // Populate all members of "e" (TransitionCompletedEventArgs) with real data
195 //e.CubeTransitionEffect = Registry.GetManagedBaseHandleFromNativePtr(cubeTransition) as CubeTransitionEffect;
197 if (_transitionCompletedEventHandler != null)
199 //here we send all data to user event handlers
200 _transitionCompletedEventHandler(this, e);
204 /// This will not be public opened.
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
208 Interop.CubeTransitionEffect.delete_CubeTransitionEffect(swigCPtr);
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
215 private CubeTransitionEffect _cubeTransitionEffect;
216 private Texture _cubeTransitonTexture;
219 /// CubeTransitionEffect.
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
227 return _cubeTransitionEffect;
231 _cubeTransitionEffect = value;
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
241 return _cubeTransitonTexture;
245 _cubeTransitonTexture = value;
251 internal class CubeTransitionEffectSignal : Disposable
254 internal CubeTransitionEffectSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
258 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionEffectSignal obj)
260 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
263 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
264 [EditorBrowsable(EditorBrowsableState.Never)]
267 bool ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Empty(swigCPtr);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
273 [EditorBrowsable(EditorBrowsableState.Never)]
274 public uint GetConnectionCount()
276 uint ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_GetConnectionCount(swigCPtr);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public void Connect(System.Delegate func)
285 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
287 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 public void Disconnect(System.Delegate func)
296 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
298 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
304 [EditorBrowsable(EditorBrowsableState.Never)]
305 public void Emit(CubeTransitionEffect arg)
307 Interop.TextField.TextFieldSignal_Emit(swigCPtr, CubeTransitionEffect.getCPtr(arg));
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
312 [EditorBrowsable(EditorBrowsableState.Never)]
313 public CubeTransitionEffectSignal() : this(Interop.CubeTransitionEffect.new_CubeTransitionEffectSignal(), true)
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318 /// This will be public opened.
319 [EditorBrowsable(EditorBrowsableState.Never)]
320 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
322 Interop.CubeTransitionEffect.delete_CubeTransitionEffectSignal(swigCPtr);
326 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
327 [EditorBrowsable(EditorBrowsableState.Never)]
328 public class CubeTransitionWaveEffect : CubeTransitionEffect
334 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
335 [EditorBrowsable(EditorBrowsableState.Never)]
336 public CubeTransitionWaveEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_New(numRows, numColumns), true)
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionWaveEffect obj)
343 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
346 internal CubeTransitionWaveEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
350 /// This will be public opened.
351 [EditorBrowsable(EditorBrowsableState.Never)]
352 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
354 Interop.CubeTransitionWaveEffect.delete_CubeTransitionWaveEffect(swigCPtr);
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 class CubeTransitionCrossEffect : CubeTransitionEffect
366 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
367 [EditorBrowsable(EditorBrowsableState.Never)]
368 public CubeTransitionCrossEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionCrossEffect.CubeTransitionCrossEffect_New(numRows, numColumns), true)
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionCrossEffect obj)
375 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
378 internal CubeTransitionCrossEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionCrossEffect.CubeTransitionCrossEffect_SWIGUpcast(cPtr), cMemoryOwn)
382 /// This will not be public opened.
383 [EditorBrowsable(EditorBrowsableState.Never)]
384 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
386 Interop.CubeTransitionCrossEffect.delete_CubeTransitionCrossEffect(swigCPtr);
390 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
391 [EditorBrowsable(EditorBrowsableState.Never)]
392 public class CubeTransitionFoldEffect : CubeTransitionEffect
398 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
399 [EditorBrowsable(EditorBrowsableState.Never)]
400 public CubeTransitionFoldEffect(uint numRows, uint numColumns) : this(Interop.CubeTransitionFoldEffect.CubeTransitionFoldEffect_New(numRows, numColumns), true)
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CubeTransitionFoldEffect obj)
407 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
410 internal CubeTransitionFoldEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
414 /// This will not be public opened.
415 [EditorBrowsable(EditorBrowsableState.Never)]
416 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
418 Interop.CubeTransitionFoldEffect.delete_CubeTransitionFoldEffect(swigCPtr);