2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
22 /// A condition that can be evaluated on a Property Value
24 /// <since_tizen> 4 </since_tizen>
25 public class PropertyCondition : BaseHandle
29 /// Create a property condition instance.
31 /// <since_tizen> 4 </since_tizen>
32 public PropertyCondition() : this(Interop.PropertyCondition.NewPropertyCondition(), true)
34 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37 internal PropertyCondition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.PropertyCondition.Upcast(cPtr), cMemoryOwn)
42 /// Retrieves the arguments that this condition uses.
44 /// <returns>The arguments used for this condition.</returns>
45 /// <since_tizen> 4 </since_tizen>
46 public uint GetArgumentCount()
48 uint ret = Interop.PropertyCondition.GetArgumentCount(swigCPtr);
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54 /// Retrieves the arguments that this condition uses
56 /// <param name="index">The condition index to get the argument.</param>
57 /// <returns>The arguments used for this condition.</returns>
58 /// <since_tizen> 4 </since_tizen>
59 public float GetArgument(uint index)
61 float ret = Interop.PropertyCondition.GetArgument(swigCPtr, index);
62 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67 /// LessThan condition compares whether property is less than arg.
69 /// <param name="arg">The argument for the condition.</param>
70 /// <returns>A property condition function object.</returns>
71 /// <since_tizen> 4 </since_tizen>
72 public static PropertyCondition LessThan(float arg)
74 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.LessThanCondition(arg), true);
75 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 /// GreaterThan condition compares whether property is greater than arg.
82 /// <param name="arg">The argument for the condition.</param>
83 /// <returns>A property condition function object.</returns>
84 /// <since_tizen> 4 </since_tizen>
85 public static PropertyCondition GreaterThan(float arg)
87 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.GreaterThanCondition(arg), true);
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 /// Inside condition compares whether property is greater than arg0 and less than arg1.
95 /// <param name="arg0">The first argument for the condition.</param>
96 /// <param name="arg1">The second argument for the condition.</param>
97 /// <returns>A property condition function object.</returns>
98 /// <since_tizen> 4 </since_tizen>
99 public static PropertyCondition Inside(float arg0, float arg1)
101 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.InsideCondition(arg0, arg1), true);
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 /// Outside condition compares whether property is less than arg0 or greater than arg1
109 /// <param name="arg0">The first argument for the condition.</param>
110 /// <param name="arg1">The second argument for the condition.</param>
111 /// <returns>A property condition function object.</returns>
112 /// <since_tizen> 4 </since_tizen>
113 public static PropertyCondition Outside(float arg0, float arg1)
115 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.OutsideCondition(arg0, arg1), true);
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 /// Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
123 /// <param name="stepAmount">The step size required to trigger condition.</param>
124 /// <param name="initialValue">The initial value to step from.</param>
125 /// <returns>A property condition function object.</returns>
126 /// <since_tizen> 4 </since_tizen>
127 public static PropertyCondition Step(float stepAmount, float initialValue)
129 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.StepCondition(stepAmount, initialValue), true);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
137 /// <param name="stepAmount">List of values to receive notifications for as a property crosses them.</param>
138 /// <returns>A property condition function object.</returns>
139 /// <since_tizen> 4 </since_tizen>
140 public static PropertyCondition Step(float stepAmount)
142 PropertyCondition ret = new PropertyCondition(Interop.PropertyCondition.StepCondition(stepAmount), true);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyCondition obj)
149 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
152 /// This will not be public opened.
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
156 Interop.PropertyCondition.DeletePropertyCondition(swigCPtr);