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.
19 using System.ComponentModel;
20 using Tizen.NUI.BaseComponents;
25 /// SlideTransitionItem is an object to set slide transition of a View that will appear or disappear.
26 /// SlideTransitionItem object is required to be added to the TransitionSet to play.
28 internal class SlideTransitionItem : TransitionItemBase
31 /// Creates an initialized SlideTransition.<br />
33 /// <remarks>Delay and duration of timePeriod must be greater than zero.</remarks>
34 public SlideTransitionItem(View view, Vector2 direction, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.SlideTransitionItem.New(view.SwigCPtr, direction.SwigCPtr, timePeriod.SwigCPtr), true)
36 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37 AppearingTransition = appearingTransition;
38 AlphaFunction = alphaFunction;
41 internal SlideTransitionItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
45 internal SlideTransitionItem(SlideTransitionItem handle) : this(Interop.SlideTransitionItem.NewSlideTransitionItem(SlideTransitionItem.getCPtr(handle)), true)
47 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50 internal SlideTransitionItem Assign(SlideTransitionItem rhs)
52 SlideTransitionItem ret = new SlideTransitionItem(Interop.SlideTransitionItem.Assign(SwigCPtr, SlideTransitionItem.getCPtr(rhs)), false);
53 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// To make SlideTransition instance be disposed.
60 protected override void Dispose(DisposeTypes type)
69 /// This will not be public opened.
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
73 if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
75 Tizen.Log.Fatal("NUI", $"[ERROR] SlideTransitionItem ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
78 Interop.SlideTransitionItem.Delete(swigCPtr);