2 * Copyright(c) 2021 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.
21 using System.ComponentModel;
23 using Tizen.NUI.BaseComponents;
26 /// TransitionItem is an object to set Transition of View pair those have same TransitionTag.
27 /// TransitionItem object is required for each View pair and this is added to the TransitionSet to play.
29 internal class TransitionItem : TransitionItemBase
32 /// Creates an initialized transition.<br />
34 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
35 public TransitionItem(View source, View destination, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.TransitionItem.New(source.SwigCPtr, destination.SwigCPtr, timePeriod.SwigCPtr), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38 AlphaFunction = alphaFunction;
41 internal TransitionItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
46 /// Sets the source View will be shown after transition finished.
48 public bool ShowSourceAfterFinished
52 Interop.TransitionItem.ShowSourceAfterFinished(SwigCPtr, value);
53 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
57 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransitionItem obj)
59 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
62 internal TransitionItem(TransitionItem handle) : this(Interop.TransitionItem.NewTransitionItem(TransitionItem.getCPtr(handle)), true)
64 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67 internal TransitionItem Assign(TransitionItem rhs)
69 TransitionItem ret = new TransitionItem(Interop.TransitionItem.Assign(SwigCPtr, TransitionItem.getCPtr(rhs)), false);
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 /// To make transition instance be disposed.
77 protected override void Dispose(DisposeTypes type)
86 /// This will not be public opened.
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
90 if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
92 Tizen.Log.Fatal("NUI", $"[ERROR] TransitionItem ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
95 Interop.TransitionItem.Delete(swigCPtr);