[NUI] Setting since_tizen 3/4 on Tizen.NUI API
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PropertyCondition.cs
1 /*
2  * Copyright(c) 2017 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     /// <summary>
21     /// A condition that can be evaluated on a Property Value
22     /// </summary>
23     /// <since_tizen> 4 </since_tizen>
24     public class PropertyCondition : BaseHandle
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         internal PropertyCondition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyCondition_SWIGUpcast(cPtr), cMemoryOwn)
29         {
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyCondition obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         /// <summary>
39         /// Dispose.
40         /// </summary>
41         /// <since_tizen> 4 </since_tizen>
42         protected override void Dispose(DisposeTypes type)
43         {
44             if (disposed)
45             {
46                 return;
47             }
48
49             if (type == DisposeTypes.Explicit)
50             {
51                 //Called by User
52                 //Release your own managed resources here.
53                 //You should release all of your own disposable objects here.
54
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61             if (swigCPtr.Handle != global::System.IntPtr.Zero)
62             {
63                 if (swigCMemOwn)
64                 {
65                     swigCMemOwn = false;
66                     NDalicPINVOKE.delete_PropertyCondition(swigCPtr);
67                 }
68                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69             }
70
71             base.Dispose(type);
72         }
73
74         /// <summary>
75         /// Create a property condition instance.
76         /// </summary>
77         /// <since_tizen> 4 </since_tizen>
78         public PropertyCondition() : this(NDalicPINVOKE.new_PropertyCondition__SWIG_0(), true)
79         {
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         /// <summary>
84         /// Retrieves the arguments that this condition uses.
85         /// </summary>
86         /// <returns>The arguments used for this condition.</returns>
87         /// <since_tizen> 4 </since_tizen>
88         public uint GetArgumentCount()
89         {
90             uint ret = NDalicPINVOKE.PropertyCondition_GetArgumentCount(swigCPtr);
91             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92             return ret;
93         }
94         /// <summary>
95         /// Retrieves the arguments that this condition uses
96         /// </summary>
97         /// <param name="index">The condition index to get the argument.</param>
98         /// <returns>The arguments used for this condition.</returns>
99         /// <since_tizen> 4 </since_tizen>
100         public float GetArgument(uint index)
101         {
102             float ret = NDalicPINVOKE.PropertyCondition_GetArgument(swigCPtr, index);
103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104             return ret;
105         }
106
107         /// <summary>
108         /// LessThan condition compares whether property is less than arg.
109         /// </summary>
110         /// <param name="arg">The argument for the condition.</param>
111         /// <returns>A property condition function object.</returns>
112         /// <since_tizen> 4 </since_tizen>
113         public static PropertyCondition LessThan(float arg)
114         {
115             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.LessThanCondition(arg), true);
116             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117             return ret;
118         }
119
120         /// <summary>
121         /// GreaterThan condition compares whether property is greater than arg.
122         /// </summary>
123         /// <param name="arg">The argument for the condition.</param>
124         /// <returns>A property condition function object.</returns>
125         /// <since_tizen> 4 </since_tizen>
126         public static PropertyCondition GreaterThan(float arg)
127         {
128             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.GreaterThanCondition(arg), true);
129             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130             return ret;
131         }
132
133         /// <summary>
134         /// Inside condition compares whether property is greater than arg0 and less than arg1.
135         /// </summary>
136         /// <param name="arg0">The first argument for the condition.</param>
137         /// <param name="arg1">The second argument for the condition.</param>
138         /// <returns>A property condition function object.</returns>
139         /// <since_tizen> 4 </since_tizen>
140         public static PropertyCondition Inside(float arg0, float arg1)
141         {
142             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.InsideCondition(arg0, arg1), true);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144             return ret;
145         }
146
147         /// <summary>
148         /// Outside condition compares whether property is less than arg0 or greater than arg1
149         /// </summary>
150         /// <param name="arg0">The first argument for the condition.</param>
151         /// <param name="arg1">The second argument for the condition.</param>
152         /// <returns>A property condition function object.</returns>
153         /// <since_tizen> 4 </since_tizen>
154         public static PropertyCondition Outside(float arg0, float arg1)
155         {
156             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.OutsideCondition(arg0, arg1), true);
157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158             return ret;
159         }
160
161         /// <summary>
162         /// Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
163         /// </summary>
164         /// <param name="stepAmount">The step size required to trigger condition.</param>
165         /// <param name="initialValue">The initial value to step from.</param>
166         /// <returns>A property condition function object.</returns>
167         /// <since_tizen> 4 </since_tizen>
168         public static PropertyCondition Step(float stepAmount, float initialValue)
169         {
170             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_0(stepAmount, initialValue), true);
171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172             return ret;
173         }
174
175         /// <summary>
176         /// Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
177         /// </summary>
178         /// <param name="stepAmount">List of values to receive notifications for as a property crosses them.</param>
179         /// <returns>A property condition function object.</returns>
180         /// <since_tizen> 4 </since_tizen>
181         public static PropertyCondition Step(float stepAmount)
182         {
183             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_1(stepAmount), true);
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185             return ret;
186         }
187
188     }
189
190 }