2 * Copyright(c) 2019 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.
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
23 internal class KeyboardEventSignalType : Disposable
26 internal KeyboardEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
31 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
33 Interop.KeyboardEventSignalType.delete_KeyboardEventSignalType(swigCPtr);
37 /// Queries whether there are any connected slots.
39 /// <returns>True if there are any slots connected to the signal</returns>
40 /// <since_tizen> 3 </since_tizen>
43 bool ret = Interop.KeyboardEventSignalType.KeyboardEventSignalType_Empty(swigCPtr);
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
49 /// Queries the number of slots.
51 /// <returns>The number of slots connected to this signal</returns>
52 /// <since_tizen> 3 </since_tizen>
53 public uint GetConnectionCount()
55 uint ret = Interop.KeyboardEventSignalType.KeyboardEventSignalType_GetConnectionCount(swigCPtr);
56 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61 /// Connects a function.
63 /// <param name="func">The function to connect</param>
64 /// <since_tizen> 3 </since_tizen>
65 public void Connect(System.Delegate func)
67 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
69 Interop.KeyboardEventSignalType.KeyboardEventSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 /// Disconnects a function.
77 /// <param name="func">The function to disconnect</param>
78 /// <since_tizen> 3 </since_tizen>
79 public void Disconnect(System.Delegate func)
81 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
83 Interop.KeyboardEventSignalType.KeyboardEventSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91 /// <param name="arg1">The first value to pass to callbacks</param>
92 /// <param name="arg2">The second value to pass to callbacks</param>
93 /// <returns>The value returned by the last callback, or a default constructed value if no callbacks are connected</returns>
94 /// <since_tizen> 5 </since_tizen>
95 public InputMethodContext.CallbackData Emit(InputMethodContext arg1, InputMethodContext.EventData arg2)
97 InputMethodContext.CallbackData ret = new InputMethodContext.CallbackData(Interop.KeyboardEventSignalType.KeyboardEventSignalType_Emit(swigCPtr, InputMethodContext.getCPtr(arg1), InputMethodContext.EventData.getCPtr(arg2)), true);
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// <since_tizen> 3 </since_tizen>
106 public KeyboardEventSignalType() : this(Interop.KeyboardEventSignalType.new_KeyboardEventSignalType(), true)
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();