Merge "Add tag and document to Tizen.NUI."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PropertyCondition.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Tizen.NUI
18 {
19     /// <summary>
20     /// A condition that can be evaluated on a Property Value
21     /// </summary>
22     public class PropertyCondition : BaseHandle
23     {
24         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25
26         internal PropertyCondition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyCondition_SWIGUpcast(cPtr), cMemoryOwn)
27         {
28             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29         }
30
31         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyCondition obj)
32         {
33             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34         }
35
36         protected override void Dispose(DisposeTypes type)
37         {
38             if (disposed)
39             {
40                 return;
41             }
42
43             if (type == DisposeTypes.Explicit)
44             {
45                 //Called by User
46                 //Release your own managed resources here.
47                 //You should release all of your own disposable objects here.
48
49             }
50
51             //Release your own unmanaged resources here.
52             //You should not access any managed member here except static instance.
53             //because the execution order of Finalizes is non-deterministic.
54
55             if (swigCPtr.Handle != global::System.IntPtr.Zero)
56             {
57                 if (swigCMemOwn)
58                 {
59                     swigCMemOwn = false;
60                     NDalicPINVOKE.delete_PropertyCondition(swigCPtr);
61                 }
62                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
63             }
64
65             base.Dispose(type);
66         }
67
68         /// <summary>
69         /// Create a property condition instance.
70         /// </summary>
71         /// <since_tizen> 4 </since_tizen>
72         public PropertyCondition() : this(NDalicPINVOKE.new_PropertyCondition__SWIG_0(), true)
73         {
74             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75         }
76
77         /// <summary>
78         /// Retrieves the arguments that this condition uses.
79         /// </summary>
80         /// <since_tizen> 4 </since_tizen>
81         public uint GetArgumentCount()
82         {
83             uint ret = NDalicPINVOKE.PropertyCondition_GetArgumentCount(swigCPtr);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             return ret;
86         }
87         ///<summary>
88         /// Retrieves the arguments that this condition uses
89         ///</summary>
90         ///<since_tizen> 4 </since_tizen>
91         public float GetArgument(uint index)
92         {
93             float ret = NDalicPINVOKE.PropertyCondition_GetArgument(swigCPtr, index);
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95             return ret;
96         }
97
98         ///<summary>
99         /// LessThan condition compares whether property is less than arg.
100         ///</summary>
101         ///<since_tizen> 4 </since_tizen>
102         public static PropertyCondition LessThan(float arg)
103         {
104             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.LessThanCondition(arg), true);
105             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106             return ret;
107         }
108
109         ///<summary>
110         /// GreaterThan condition compares whether property is greater than arg.
111         ///</summary>
112         ///<since_tizen> 4 </since_tizen>
113         public static PropertyCondition GreaterThan(float arg)
114         {
115             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.GreaterThanCondition(arg), true);
116             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117             return ret;
118         }
119
120         ///<summary>
121         /// Inside condition compares whether property is greater than arg0 and less than arg1.
122         ///</summary>
123         ///<since_tizen> 4 </since_tizen>
124         public static PropertyCondition Inside(float arg0, float arg1)
125         {
126             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.InsideCondition(arg0, arg1), true);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         ///<summary>
132         /// Outside condition compares whether property is less than arg0 or greater than arg1
133         ///</summary>
134         ///<since_tizen> 4 </since_tizen>
135         public static PropertyCondition Outside(float arg0, float arg1)
136         {
137             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.OutsideCondition(arg0, arg1), true);
138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139             return ret;
140         }
141
142         ///<summary>
143         /// Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
144         ///</summary>
145         ///<since_tizen> 4 </since_tizen>
146         public static PropertyCondition Step(float stepAmount, float initialValue)
147         {
148             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_0(stepAmount, initialValue), true);
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150             return ret;
151         }
152
153         ///<summary>
154         /// Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
155         ///</summary>
156         ///<since_tizen> 4 </since_tizen>
157         public static PropertyCondition Step(float stepAmount)
158         {
159             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_1(stepAmount), true);
160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161             return ret;
162         }
163
164     }
165
166 }