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