1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
22 using Tizen.NUI.BaseComponents;
24 /// Interface to encapsulate information required for relayout.
26 public class RelayoutContainer : global::System.IDisposable
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29 protected bool swigCMemOwn;
31 internal RelayoutContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
33 swigCMemOwn = cMemoryOwn;
34 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelayoutContainer obj)
39 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam)
44 //A Flag to check who called Dispose(). (By User or DisposeQueue)
45 private bool isDisposeQueued = false;
46 //A Flat to check if it is already disposed.
47 protected bool disposed = false;
53 isDisposeQueued = true;
54 DisposeQueue.Instance.Add(this);
59 /// To make RelayoutContainer instance be disposed.
63 //Throw excpetion if Dispose() is called in separate thread.
64 if (!Window.IsInstalled())
66 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
71 Dispose(DisposeTypes.Implicit);
75 Dispose(DisposeTypes.Explicit);
76 System.GC.SuppressFinalize(this);
80 protected virtual void Dispose(DisposeTypes type)
87 if(type == DisposeTypes.Explicit)
90 //Release your own managed resources here.
91 //You should release all of your own disposable objects here.
94 //Release your own unmanaged resources here.
95 //You should not access any managed member here except static instance.
96 //because the execution order of Finalizes is non-deterministic.
98 if (swigCPtr.Handle != global::System.IntPtr.Zero)
103 NDalicPINVOKE.delete_RelayoutContainer(swigCPtr);
105 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
111 /// Adds relayout information to the container if it doesn't already exist.
113 /// <param name="view">The view to relayout</param>
114 /// <param name="size">The size to relayout</param>
115 public virtual void Add(View view, Size2D size)
117 NDalicPINVOKE.RelayoutContainer_Add(swigCPtr, View.getCPtr(view), Size2D.getCPtr(size));
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();