Merge "C# CustomView Implementation (C++ wrappers, manual bindings, C# wrappers)...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / ObjectRegistry.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13 using System;
14 using System.Runtime.InteropServices;
15
16
17 public class ObjectRegistry : BaseHandle {
18   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19
20   internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ObjectRegistry_SWIGUpcast(cPtr), cMemoryOwn) {
21     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22   }
23
24   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ObjectRegistry obj) {
25     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26   }
27
28   ~ObjectRegistry() {
29     Dispose();
30   }
31
32   public override void Dispose() {
33     lock(this) {
34       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35         if (swigCMemOwn) {
36           swigCMemOwn = false;
37           NDalicPINVOKE.delete_ObjectRegistry(swigCPtr);
38         }
39         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40       }
41       global::System.GC.SuppressFinalize(this);
42       base.Dispose();
43     }
44   }
45
46
47
48 public class ObjectCreatedEventArgs : EventArgs
49 {
50    private BaseHandle _baseHandle;
51
52    public BaseHandle BaseHandle
53    {
54       get
55       {
56          return _baseHandle;
57       }
58       set
59       {
60          _baseHandle = value;
61       }
62    }
63 }
64
65 public class ObjectDestroyedEventArgs : EventArgs
66 {
67    private RefObject _refObject;
68
69    public RefObject RefObject
70    {
71       get
72       {
73          return _refObject;
74       }
75       set
76       {
77          _refObject = value;
78       }
79    }
80 }
81
82
83   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84   private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
85   private DaliEventHandler<object,ObjectCreatedEventArgs> _objectRegistryObjectCreatedEventHandler;
86   private ObjectCreatedEventCallbackDelegate _objectRegistryObjectCreatedEventCallbackDelegate;
87
88   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89   private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
90   private DaliEventHandler<object,ObjectDestroyedEventArgs> _objectRegistryObjectDestroyedEventHandler;
91   private ObjectDestroyedEventCallbackDelegate _objectRegistryObjectDestroyedEventCallbackDelegate;
92
93   public event DaliEventHandler<object,ObjectCreatedEventArgs> ObjectCreated
94   {
95      add
96      {
97         lock(this)
98         {
99            // Restricted to only one listener
100            if (_objectRegistryObjectCreatedEventHandler == null)
101            {
102               _objectRegistryObjectCreatedEventHandler += value;
103
104               _objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
105               this.ObjectCreatedSignal().Connect(_objectRegistryObjectCreatedEventCallbackDelegate);
106            }
107         }
108      }
109
110      remove
111      {
112         lock(this)
113         {
114            if (_objectRegistryObjectCreatedEventHandler != null)
115            {
116               this.ObjectCreatedSignal().Disconnect(_objectRegistryObjectCreatedEventCallbackDelegate);
117            }
118
119            _objectRegistryObjectCreatedEventHandler -= value;
120         }
121      }
122   }
123
124   // Callback for ObjectRegistry ObjectCreatedSignal
125   private void OnObjectCreated(IntPtr baseHandle)
126   {
127      ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
128
129      // Populate all members of "e" (ObjectCreatedEventArgs) with real data
130      //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
131
132      if (_objectRegistryObjectCreatedEventHandler != null)
133      {
134         //here we send all data to user event handlers
135         _objectRegistryObjectCreatedEventHandler(this, e);
136      }
137   }
138
139   public event DaliEventHandler<object,ObjectDestroyedEventArgs> ObjectDestroyed
140   {
141      add
142      {
143         lock(this)
144         {
145            // Restricted to only one listener
146            if (_objectRegistryObjectDestroyedEventHandler == null)
147            {
148               _objectRegistryObjectDestroyedEventHandler += value;
149
150               _objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
151               this.ObjectDestroyedSignal().Connect(_objectRegistryObjectDestroyedEventCallbackDelegate);
152            }
153         }
154      }
155
156      remove
157      {
158         lock(this)
159         {
160            if (_objectRegistryObjectDestroyedEventHandler != null)
161            {
162               this.ObjectDestroyedSignal().Disconnect(_objectRegistryObjectDestroyedEventCallbackDelegate);
163            }
164
165            _objectRegistryObjectDestroyedEventHandler -= value;
166         }
167      }
168   }
169
170   // Callback for ObjectRegistry ObjectDestroyedSignal
171   private void OnObjectDestroyed(IntPtr refObject)
172   {
173      ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
174
175      // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
176      e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
177
178      if (_objectRegistryObjectDestroyedEventHandler != null)
179      {
180         //here we send all data to user event handlers
181         _objectRegistryObjectDestroyedEventHandler(this, e);
182      }
183   }
184
185
186   public ObjectRegistry() : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_0(), true) {
187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188   }
189
190   public ObjectRegistry(ObjectRegistry handle) : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_1(ObjectRegistry.getCPtr(handle)), true) {
191     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192   }
193
194   public ObjectRegistry Assign(ObjectRegistry rhs) {
195     ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.ObjectRegistry_Assign(swigCPtr, ObjectRegistry.getCPtr(rhs)), false);
196     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197     return ret;
198   }
199
200   public ObjectCreatedSignal ObjectCreatedSignal() {
201     ObjectCreatedSignal ret = new ObjectCreatedSignal(NDalicPINVOKE.ObjectRegistry_ObjectCreatedSignal(swigCPtr), false);
202     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203     return ret;
204   }
205
206   public ObjectDestroyedSignal ObjectDestroyedSignal() {
207     ObjectDestroyedSignal ret = new ObjectDestroyedSignal(NDalicPINVOKE.ObjectRegistry_ObjectDestroyedSignal(swigCPtr), false);
208     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209     return ret;
210   }
211
212 }
213
214 }