2 * Copyright(c) 2017 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.ComponentModel;
19 using System.Runtime.InteropServices;
23 internal class WidgetImpl : BaseObject
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal WidgetImpl() : this( NDalicManualPINVOKE.WidgetImpl_New(), true )
29 SwigDirectorConnect();
32 internal WidgetImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetImpl_SWIGUpcast(cPtr), cMemoryOwn)
34 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetImpl obj)
39 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 protected override void Dispose(DisposeTypes type)
49 if (type == DisposeTypes.Explicit)
52 //Release your own managed resources here.
53 //You should release all of your own disposable objects here.
56 //Release your own unmanaged resources here.
57 //You should not access any managed member here except static instance.
58 //because the execution order of Finalizes is non-deterministic.
60 if (swigCPtr.Handle != global::System.IntPtr.Zero)
65 //throw new global::System.MethodAccessException("C++ destructor does not have public access");
67 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 public class WIdgetInstanceOnCreateArgs : EventArgs
75 private string _contentInfo;
76 private Window _window;
78 public string ContentInfo
103 private EventHandler<WIdgetInstanceOnCreateArgs> _widgetInstanceOnCreateEventHandler;
104 public event EventHandler<WIdgetInstanceOnCreateArgs> WidgetInstanceCreated
108 _widgetInstanceOnCreateEventHandler += value;
112 _widgetInstanceOnCreateEventHandler -= value;
116 public class WIdgetInstanceOnDestroyArgs : EventArgs
118 private string _contentInfo;
119 private Widget.TerminationType _terminateType;
121 public string ContentInfo
129 _contentInfo = value;
133 public Widget.TerminationType TerminateType
137 return _terminateType;
141 _terminateType = value;
146 private EventHandler<WIdgetInstanceOnDestroyArgs> _widgetInstanceOnDestroyEventHandler;
147 public event EventHandler<WIdgetInstanceOnDestroyArgs> WidgetInstanceDestroyed
151 _widgetInstanceOnDestroyEventHandler += value;
155 _widgetInstanceOnDestroyEventHandler -= value;
159 public class WidgetInstanceOnResizeArgs : EventArgs
161 private Window _window;
176 private EventHandler<WidgetInstanceOnResizeArgs> _widgetInstanceOnResizeEventHandler;
177 public event EventHandler<WidgetInstanceOnResizeArgs> WidgetInstanceResized
181 _widgetInstanceOnResizeEventHandler += value;
185 _widgetInstanceOnResizeEventHandler -= value;
189 private EventHandler _widgetInstanceOnPauseEventHandler;
190 public event EventHandler WidgetInstancePaused
194 _widgetInstanceOnPauseEventHandler += value;
198 _widgetInstanceOnPauseEventHandler -= value;
202 private EventHandler _widgetInstanceOnResumeEventHandler;
203 public event EventHandler WidgetInstanceResumed
207 _widgetInstanceOnResumeEventHandler += value;
211 _widgetInstanceOnResumeEventHandler -= value;
215 public class WidgetInstanceOnUpdateArgs : EventArgs
217 private string _contentInfo;
220 public string ContentInfo
228 _contentInfo = value;
245 private EventHandler<WidgetInstanceOnUpdateArgs> _widgetInstanceOnUpdateEventHandler;
246 public event EventHandler<WidgetInstanceOnUpdateArgs> WidgetInstanceUpdated
250 _widgetInstanceOnUpdateEventHandler += value;
254 _widgetInstanceOnUpdateEventHandler -= value;
258 public virtual void OnCreate(string contentInfo, Window window)
260 WIdgetInstanceOnCreateArgs args = new WIdgetInstanceOnCreateArgs();
261 args.ContentInfo = contentInfo;
262 args.Window = window;
263 _widgetInstanceOnCreateEventHandler?.Invoke(this, args);
266 public virtual void OnTerminate(string contentInfo, Widget.TerminationType type)
268 WIdgetInstanceOnDestroyArgs args = new WIdgetInstanceOnDestroyArgs();
269 args.ContentInfo = contentInfo;
270 args.TerminateType = type;
271 _widgetInstanceOnDestroyEventHandler?.Invoke(this,args);
274 public virtual void OnPause()
276 _widgetInstanceOnPauseEventHandler?.Invoke(this, new EventArgs());
279 public virtual void OnResume()
281 _widgetInstanceOnResumeEventHandler?.Invoke(this, new EventArgs());
284 public virtual void OnResize(Window window)
286 WidgetInstanceOnResizeArgs args = new WidgetInstanceOnResizeArgs();
287 args.Window = window;
288 _widgetInstanceOnResizeEventHandler?.Invoke(this, args);
291 public virtual void OnUpdate(string contentInfo, int force)
293 WidgetInstanceOnUpdateArgs args = new WidgetInstanceOnUpdateArgs();
294 args.ContentInfo = contentInfo;
296 _widgetInstanceOnUpdateEventHandler?.Invoke(this, args);
299 internal virtual void SignalConnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
303 internal virtual void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
307 public void SetContentInfo(string contentInfo)
309 NDalicManualPINVOKE.WidgetImpl_SetContentInfo(swigCPtr, contentInfo);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 internal void SetImpl(SWIGTYPE_p_Dali__Widget__Impl impl)
315 NDalicManualPINVOKE.WidgetImpl_SetImpl(swigCPtr, SWIGTYPE_p_Dali__Widget__Impl.getCPtr(impl));
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 private void SwigDirectorConnect()
321 swigDelegate0 = new SwigDelegateWidgetImpl_0(SwigDirectorOnCreate);
322 swigDelegate1 = new SwigDelegateWidgetImpl_1(SwigDirectorOnTerminate);
323 swigDelegate2 = new SwigDelegateWidgetImpl_2(SwigDirectorOnPause);
324 swigDelegate3 = new SwigDelegateWidgetImpl_3(SwigDirectorOnResume);
325 swigDelegate4 = new SwigDelegateWidgetImpl_4(SwigDirectorOnResize);
326 swigDelegate5 = new SwigDelegateWidgetImpl_5(SwigDirectorOnUpdate);
327 swigDelegate6 = new SwigDelegateWidgetImpl_6(SwigDirectorSignalConnected);
328 swigDelegate7 = new SwigDelegateWidgetImpl_7(SwigDirectorSignalDisconnected);
329 NDalicManualPINVOKE.WidgetImpl_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7);
332 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
334 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
335 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(WidgetImpl));
336 return hasDerivedMethod;
339 private void SwigDirectorOnCreate(string contentInfo, global::System.IntPtr window)
341 OnCreate(contentInfo, new Window(window, true));
344 private void SwigDirectorOnTerminate(string contentInfo, int type)
346 OnTerminate(contentInfo, (Widget.TerminationType)type);
349 private void SwigDirectorOnPause()
354 private void SwigDirectorOnResume()
359 private void SwigDirectorOnResize(global::System.IntPtr window)
361 OnResize(new Window(window, true));
364 private void SwigDirectorOnUpdate(string contentInfo, int force)
366 OnUpdate(contentInfo, force);
369 private void SwigDirectorSignalConnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
371 SignalConnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
374 private void SwigDirectorSignalDisconnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
376 SignalDisconnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
379 public delegate void SwigDelegateWidgetImpl_0(string contentInfo, global::System.IntPtr window);
380 public delegate void SwigDelegateWidgetImpl_1(string contentInfo, int type);
381 public delegate void SwigDelegateWidgetImpl_2();
382 public delegate void SwigDelegateWidgetImpl_3();
383 public delegate void SwigDelegateWidgetImpl_4(global::System.IntPtr window);
384 public delegate void SwigDelegateWidgetImpl_5(string contentInfo, int force);
385 public delegate void SwigDelegateWidgetImpl_6(global::System.IntPtr slotObserver, global::System.IntPtr callback);
386 public delegate void SwigDelegateWidgetImpl_7(global::System.IntPtr slotObserver, global::System.IntPtr callback);
388 private SwigDelegateWidgetImpl_0 swigDelegate0;
389 private SwigDelegateWidgetImpl_1 swigDelegate1;
390 private SwigDelegateWidgetImpl_2 swigDelegate2;
391 private SwigDelegateWidgetImpl_3 swigDelegate3;
392 private SwigDelegateWidgetImpl_4 swigDelegate4;
393 private SwigDelegateWidgetImpl_5 swigDelegate5;
394 private SwigDelegateWidgetImpl_6 swigDelegate6;
395 private SwigDelegateWidgetImpl_7 swigDelegate7;
397 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(string), typeof(Window) };
398 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(string), typeof(Widget.TerminationType) };
399 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
400 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
401 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { typeof(Window) };
402 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { typeof(string), typeof(int) };
403 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { typeof(SlotObserver), typeof(SWIGTYPE_p_Dali__CallbackBase) };
404 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { typeof(SlotObserver), typeof(SWIGTYPE_p_Dali__CallbackBase) };