256b1d444c24d5a7a372ed5b7105a0c3c69ee8a8
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / ContentReceivedSignalType.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 using System;
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     internal class ContentReceivedSignalType : Disposable
24     {
25         /// <summary>
26         /// ContentReceivedSignalType
27         /// </summary>
28
29         internal ContentReceivedSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
30         {
31         }
32
33
34         /// <summary>
35         /// Dispose
36         /// </summary>
37         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
38         {
39             Interop.ContentReceivedSignalType.DeleteContentReceivedSignalType(swigCPtr);
40         }
41
42         /// <summary>
43         /// Queries whether there are any connected slots.
44         /// </summary>
45         /// <returns>True if there are any slots connected to the signal</returns>
46         public bool Empty()
47         {
48             bool ret = Interop.ContentReceivedSignalType.Empty(SwigCPtr);
49             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50             return ret;
51         }
52
53         /// <summary>
54         /// Queries the number of slots.
55         /// </summary>
56         /// <returns>The number of slots connected to this signal</returns>
57         public uint GetConnectionCount()
58         {
59             uint ret = Interop.ContentReceivedSignalType.GetConnectionCount(SwigCPtr);
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61             return ret;
62         }
63
64         /// <summary>
65         /// Connects a function.
66         /// </summary>
67         /// <param name="func">The function to connect</param>
68         public void Connect(System.Delegate func)
69         {
70             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
71             {
72                 Interop.ContentReceivedSignalType.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
73                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74             }
75         }
76
77         /// <summary>
78         /// Disconnects a function.
79         /// </summary>
80         /// <param name="func">The function to disconnect</param>
81         public void Disconnect(System.Delegate func)
82         {
83             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
84             {
85                 Interop.ContentReceivedSignalType.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
86                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87             }
88         }
89
90         /// <summary>
91         /// Connects a member function.
92         /// </summary>
93         /// <param name="arg1">The member function to connect</param>
94         /// <param name="arg2">The member function to connect</param>
95         /// <param name="arg3">The member function to connect</param>
96         public void Emit(string arg1, string arg2, string arg3)
97         {
98             Interop.ContentReceivedSignalType.Emit(SwigCPtr, arg1, arg2, arg3);
99             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100         }
101
102         /// <summary>
103         /// The contructor.
104         /// </summary>
105         public ContentReceivedSignalType() : this(Interop.ContentReceivedSignalType.NewContentReceivedSignalType(), true)
106         {
107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108         }
109     }
110 }