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 /// FadeTransitionItem is an object to set Fade transition of a View that will appear or disappear.
27 /// FadeTransitionItem object is required to be added to the TransitionSet to play.
29 internal class FadeTransitionItem : TransitionItemBase
32 /// Creates an initialized fade.<br />
34 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
35 public FadeTransitionItem(View view, float opacity, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.FadeTransitionItem.New(view.SwigCPtr, opacity, timePeriod.SwigCPtr), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38 AppearingTransition = appearingTransition;
39 AlphaFunction = alphaFunction;
42 internal FadeTransitionItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
46 internal FadeTransitionItem(FadeTransitionItem handle) : this(Interop.FadeTransitionItem.NewFadeTransitionItem(FadeTransitionItem.getCPtr(handle)), true)
48 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51 internal FadeTransitionItem Assign(FadeTransitionItem rhs)
53 FadeTransitionItem ret = new FadeTransitionItem(Interop.FadeTransitionItem.Assign(SwigCPtr, FadeTransitionItem.getCPtr(rhs)), false);
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 /// To make fade instance be disposed.
61 protected override void Dispose(DisposeTypes type)
70 /// This will not be public opened.
71 [EditorBrowsable(EditorBrowsableState.Never)]
72 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
74 if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
76 Tizen.Log.Fatal("NUI", $"[ERROR] FadeTransitionItem ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
79 Interop.FadeTransitionItem.Delete(swigCPtr);