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.NewCubeTransitionEffect(), 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(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.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.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.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.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.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.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.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.StartTransitionSwig1(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.StartTransitionSwig2(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.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.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.StopTransition(SwigCPtr);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 CubeTransitionEffectSignal TransitionCompletedSignal()
159 CubeTransitionEffectSignal ret = new CubeTransitionEffectSignal(Interop.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.DeleteCubeTransitionEffect(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.CubeTransitionEffectSignalEmpty(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.CubeTransitionEffectSignalGetConnectionCount(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.CubeTransitionEffectSignalConnect(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.CubeTransitionEffectSignalDisconnect(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.TextFieldSignalEmit(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.NewCubeTransitionEffectSignal(), 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.DeleteCubeTransitionEffectSignal(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.New(numRows, numColumns), true)
334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 internal CubeTransitionWaveEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(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.DeleteCubeTransitionWaveEffect(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.New(numRows, numColumns), true)
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 internal CubeTransitionCrossEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(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.DeleteCubeTransitionCrossEffect(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.New(numRows, numColumns), true)
390 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 internal CubeTransitionFoldEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(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.DeleteCubeTransitionFoldEffect(swigCPtr);