Follow formatting NUI
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PropertyNotifySignal.cs
1 /*
2  * Copyright(c) 2019 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 using System;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     ///<summary>
24     /// Signal connection class for PropertyNotification
25     ///</summary>
26     /// <since_tizen> 4 </since_tizen>
27     [Obsolete("Deprecated in API6, Will be removed in API9, " +
28         "Please use PropertyNotification.Notified event instead!")]
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     public class PropertyNotifySignal : Disposable
31     {
32
33         /// <summary>
34         /// The constructor.
35         /// </summary>
36         /// <since_tizen> 4 </since_tizen>
37         [Obsolete("Deprecated in API6, Will be removed in API9, " +
38             "Please use PropertyNotification.Notified event instead!")]
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         public PropertyNotifySignal() : this(Interop.PropertyNotifySignal.new_PropertyNotifySignal(), true)
41         {
42             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43         }
44
45         internal PropertyNotifySignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
46         {
47         }
48
49         /// <summary>
50         /// Queries whether there are any connected slots.
51         /// </summary>
52         /// <returns>True if there are any slots connected to the signal.</returns>
53         /// <since_tizen> 4 </since_tizen>
54         [Obsolete("Deprecated in API6, Will be removed in API9, " +
55             "Please use PropertyNotification.Notified event instead!")]
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public bool Empty()
58         {
59             bool ret = Interop.PropertyNotifySignal.PropertyNotifySignal_Empty(swigCPtr);
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61             return ret;
62         }
63
64         /// <summary>
65         /// Queries the number of slots.
66         /// </summary>
67         /// <returns>The number of slots connected to this signal</returns>
68         /// <since_tizen> 4 </since_tizen>
69         [Obsolete("Deprecated in API6, Will be removed in API9, " +
70             "Please use PropertyNotification.Notified event instead!")]
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         public uint GetConnectionCount()
73         {
74             uint ret = Interop.PropertyNotifySignal.PropertyNotifySignal_GetConnectionCount(swigCPtr);
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76             return ret;
77         }
78
79         /// <summary>
80         /// Connects a function.
81         /// </summary>
82         /// <param name="func">The function to connect</param>
83         /// <since_tizen> 4 </since_tizen>
84         [Obsolete("Deprecated in API6, Will be removed in API9, " +
85             "Please use PropertyNotification.Notified event instead!")]
86         [EditorBrowsable(EditorBrowsableState.Never)]
87         public void Connect(System.Delegate func)
88         {
89             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
90             {
91                 Interop.PropertyNotifySignal.PropertyNotifySignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
92                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93             }
94         }
95
96         /// <summary>
97         /// Disconnects a function.
98         /// </summary>
99         /// <param name="func">The function to disconnect.</param>
100         /// <since_tizen> 4 </since_tizen>
101         [Obsolete("Deprecated in API6, Will be removed in API9, " +
102             "Please use PropertyNotification.Notified event instead!")]
103         [EditorBrowsable(EditorBrowsableState.Never)]
104         public void Disconnect(System.Delegate func)
105         {
106             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
107             {
108                 Interop.PropertyNotifySignal.PropertyNotifySignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
109                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110             }
111         }
112
113         /// <summary>
114         /// Emits a signal with 1 parameter.
115         /// </summary>
116         /// <param name="arg">The first value to pass to callbacks.</param>
117         /// <since_tizen> 4 </since_tizen>
118         [Obsolete("Deprecated in API6, Will be removed in API9, " +
119             "Please use PropertyNotification.Notified event instead!")]
120         [EditorBrowsable(EditorBrowsableState.Never)]
121         public void Emit(PropertyNotification arg)
122         {
123             Interop.PropertyNotifySignal.PropertyNotifySignal_Emit(swigCPtr, PropertyNotification.getCPtr(arg));
124             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125         }
126
127
128         /// This will not be public opened.
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
131         {
132             Interop.PropertyNotifySignal.delete_PropertyNotifySignal(swigCPtr);
133         }
134     }
135 }