Release 4.0.0-preview1-00235
[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
69         public PropertyCondition() : this(NDalicPINVOKE.new_PropertyCondition__SWIG_0(), true)
70         {
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72         }
73
74         /// <summary>
75         /// Retrieves the arguments that this condition uses.
76         /// </summary>
77         public uint GetArgumentCount()
78         {
79             uint ret = NDalicPINVOKE.PropertyCondition_GetArgumentCount(swigCPtr);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81             return ret;
82         }
83         ///<summary>
84         /// Retrieves the arguments that this condition uses
85         ///</summary>
86         public float GetArgument(uint index)
87         {
88             float ret = NDalicPINVOKE.PropertyCondition_GetArgument(swigCPtr, index);
89             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90             return ret;
91         }
92
93         ///<summary>
94         /// LessThan condition compares whether property is less than arg.
95         ///</summary>
96         public static PropertyCondition LessThan(float arg)
97         {
98             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.LessThanCondition(arg), true);
99             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100             return ret;
101         }
102
103         ///<summary>
104         /// GreaterThan condition compares whether property is greater than arg.
105         ///</summary>
106         public static PropertyCondition GreaterThan(float arg)
107         {
108             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.GreaterThanCondition(arg), true);
109             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110             return ret;
111         }
112
113         ///<summary>
114         /// Inside condition compares whether property is greater than arg0 and less than arg1.
115         ///</summary>
116         public static PropertyCondition Inside(float arg0, float arg1)
117         {
118             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.InsideCondition(arg0, arg1), true);
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120             return ret;
121         }
122
123         ///<summary>
124         /// Outside condition compares whether property is less than arg0 or greater than arg1
125         ///</summary>
126         public static PropertyCondition Outside(float arg0, float arg1)
127         {
128             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.OutsideCondition(arg0, arg1), true);
129             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130             return ret;
131         }
132
133         ///<summary>
134         /// Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
135         ///</summary>
136         public static PropertyCondition Step(float stepAmount, float initialValue)
137         {
138             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_0(stepAmount, initialValue), true);
139             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140             return ret;
141         }
142
143         ///<summary>
144         /// Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
145         ///</summary>
146         public static PropertyCondition Step(float stepAmount)
147         {
148             PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_1(stepAmount), true);
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150             return ret;
151         }
152
153     }
154
155 }