Separate C# classes into Internal and Public
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / PreFocusChangeSignal.cs
1 /*
2  * Copyright (c) 2017 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
20 namespace Dali {
21
22 public delegate IntPtr SwigDelegatePreFocusChangeSignal(IntPtr current, IntPtr proposed, View.Focus.Direction direction);
23
24 internal class PreFocusChangeSignal : global::System.IDisposable {
25   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26   protected bool swigCMemOwn;
27
28   internal PreFocusChangeSignal(global::System.IntPtr cPtr, bool cMemoryOwn) {
29     swigCMemOwn = cMemoryOwn;
30     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31   }
32
33   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PreFocusChangeSignal obj) {
34     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35   }
36
37   ~PreFocusChangeSignal() {
38     DisposeQueue.Instance.Add(this);
39   }
40
41   public virtual void Dispose() {
42     if (!Window.IsInstalled()) {
43       DisposeQueue.Instance.Add(this);
44       return;
45     }
46
47     lock(this) {
48       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
49         if (swigCMemOwn) {
50           swigCMemOwn = false;
51           NDalicManualPINVOKE.delete_PreFocusChangeSignal(swigCPtr);
52         }
53         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
54       }
55       global::System.GC.SuppressFinalize(this);
56     }
57   }
58
59   public bool Empty() {
60     bool ret = NDalicManualPINVOKE.PreFocusChangeSignal_Empty(swigCPtr);
61     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
62     return ret;
63   }
64
65   public uint GetConnectionCount() {
66     uint ret = NDalicManualPINVOKE.PreFocusChangeSignal_GetConnectionCount(swigCPtr);
67     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
68     return ret;
69   }
70
71   public void Connect(FocusManager.PreFocusChangeEventCallbackDelegate func) {
72      NDalicManualPINVOKE.PreFocusChangeSignal_Connect(swigCPtr, func);
73      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74  }
75
76   public void Disconnect(System.Delegate func) {
77     System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
78     {
79       NDalicManualPINVOKE.PreFocusChangeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
80       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81     }
82   }
83
84   public View Emit(View arg1, View arg2, View.Focus.Direction arg3) {
85     View ret = new View(NDalicManualPINVOKE.PreFocusChangeSignal_Emit(swigCPtr, View.getCPtr(arg1), View.getCPtr(arg2), (int)arg3), true);
86     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87     return ret;
88   }
89
90   public PreFocusChangeSignal() : this(NDalicManualPINVOKE.new_PreFocusChangeSignal(), true) {
91     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92   }
93
94 }
95
96 }