[NUI] Remove unused property of Transition
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Transition / TransitionItemBase.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     using System;
21     using System.ComponentModel;
22     using Tizen.NUI.BaseComponents;
23
24     internal class TransitionItemBase : BaseHandle
25     {
26         /// <summary>
27         /// Creates an initialized TransitionItemBase.<br />
28         /// </summary>
29         public TransitionItemBase(View target, bool isEntering, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.TransitionItemBase.New(/*target.SwigCPtr, isEntering, timePeriod.SwigCPtr*/), true)
30         {
31             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
32             AlphaFunction = alphaFunction;
33         }
34
35         internal TransitionItemBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
36         {
37         }
38
39         /// <summary>
40         /// Gets or sets the TimePeriod
41         /// </summary>
42         public TimePeriod TimePeriod
43         {
44             set
45             {
46                 Interop.TransitionItemBase.SetTimePeriod(SwigCPtr, value.SwigCPtr);
47                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48             }
49             get
50             {
51                 TimePeriod ret = new TimePeriod(Interop.TransitionItemBase.GetTimePeriod(SwigCPtr), true);
52                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53                 return ret;
54             }
55         }
56
57         /// <summary>
58         /// Gets or sets the AlphaFunction
59         /// </summary>
60         public AlphaFunction AlphaFunction
61         {
62             set
63             {
64                 Interop.TransitionItemBase.SetAlphaFunction(SwigCPtr, value.SwigCPtr);
65                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66             }
67             get
68             {
69                 AlphaFunction ret = new AlphaFunction(Interop.TransitionItemBase.GetAlphaFunction(SwigCPtr), true);
70                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71                 return ret;
72             }
73         }
74
75         /// <summary>
76         /// Gets or sets whether the View moves with child or not.
77         /// </summary>
78         public bool TransitionWithChild
79         {
80             set
81             {
82                 Interop.TransitionItemBase.TransitionWithChild(SwigCPtr, value);
83                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84             }
85         }
86
87         /// <summary>
88         /// Downcasts a handle to TransitionItemBase handle.<br />
89         /// If handle points to an TransitionItemBase object, the downcast produces a valid handle.<br />
90         /// If not, the returned handle is left uninitialized.<br />
91         /// </summary>
92         /// <param name="handle">Handle to an object.</param>
93         /// <returns>Handle to an TransitionItemBase object or an uninitialized handle.</returns>
94         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
95         public static TransitionItemBase DownCast(BaseHandle handle)
96         {
97             if (handle == null)
98             {
99                 throw new ArgumentNullException(nameof(handle));
100             }
101             TransitionItemBase ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TransitionItemBase;
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103             return ret;
104         }
105
106         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransitionItemBase obj)
107         {
108             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
109         }
110
111         internal TransitionItemBase(TransitionItemBase handle) : this(Interop.TransitionItemBase.NewTransitionItemBase(TransitionItemBase.getCPtr(handle)), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114         }
115
116         internal TransitionItemBase Assign(TransitionItemBase rhs)
117         {
118             TransitionItemBase ret = new TransitionItemBase(Interop.TransitionItemBase.Assign(SwigCPtr, TransitionItemBase.getCPtr(rhs)), false);
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120             return ret;
121         }
122
123         /// <summary>
124         /// To make TransitionItemBase instance be disposed.
125         /// </summary>
126         protected override void Dispose(DisposeTypes type)
127         {
128             if (disposed)
129             {
130                 return;
131             }
132             base.Dispose(type);
133         }
134
135         /// This will not be public opened.
136         [EditorBrowsable(EditorBrowsableState.Never)]
137         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
138         {
139             if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
140             {
141                 Tizen.Log.Fatal("NUI", $"[ERROR] TransitionItemBase ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
142                 return;
143             }
144             Interop.TransitionItemBase.Delete(swigCPtr);
145         }
146
147         private float MilliSecondsToSeconds(int millisec)
148         {
149             return (float)millisec / 1000.0f;
150         }
151
152         private int SecondsToMilliSeconds(float sec)
153         {
154             return (int)(sec * 1000);
155         }
156     }
157 }