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)
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)]
263 bool ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Empty(swigCPtr);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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()
272 uint ret = Interop.CubeTransitionEffect.CubeTransitionEffectSignal_GetConnectionCount(swigCPtr);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
281 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
283 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
292 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
294 Interop.CubeTransitionEffect.CubeTransitionEffectSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
303 Interop.TextField.TextFieldSignal_Emit(swigCPtr, CubeTransitionEffect.getCPtr(arg));
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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.new_CubeTransitionEffectSignal(), true)
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// This will be public opened.
315 [EditorBrowsable(EditorBrowsableState.Never)]
316 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
318 Interop.CubeTransitionEffect.delete_CubeTransitionEffectSignal(swigCPtr);
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
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.CubeTransitionWaveEffect_New(numRows, numColumns), true)
334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 internal CubeTransitionWaveEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
342 /// This will be public opened.
343 [EditorBrowsable(EditorBrowsableState.Never)]
344 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
346 Interop.CubeTransitionWaveEffect.delete_CubeTransitionWaveEffect(swigCPtr);
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
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.CubeTransitionCrossEffect_New(numRows, numColumns), true)
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 internal CubeTransitionCrossEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionCrossEffect.CubeTransitionCrossEffect_SWIGUpcast(cPtr), cMemoryOwn)
370 /// This will not be public opened.
371 [EditorBrowsable(EditorBrowsableState.Never)]
372 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
374 Interop.CubeTransitionCrossEffect.delete_CubeTransitionCrossEffect(swigCPtr);
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
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.CubeTransitionFoldEffect_New(numRows, numColumns), true)
390 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 internal CubeTransitionFoldEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CubeTransitionWaveEffect.CubeTransitionWaveEffect_SWIGUpcast(cPtr), cMemoryOwn)
398 /// This will not be public opened.
399 [EditorBrowsable(EditorBrowsableState.Never)]
400 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
402 Interop.CubeTransitionFoldEffect.delete_CubeTransitionFoldEffect(swigCPtr);