1ca74fb85356284e7fa1d542723d0026adda02d3
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / VisualFactory.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 Tizen.NUI
12 {
13
14     /// <summary>
15     /// VisualFactory is a singleton object that provides and shares visuals between views
16     /// </summary>
17     public class VisualFactory : BaseHandle
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20
21         internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualFactory_SWIGUpcast(cPtr), cMemoryOwn)
22         {
23             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24         }
25
26         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualFactory obj)
27         {
28             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29         }
30
31         ~VisualFactory()
32         {
33             DisposeQueue.Instance.Add(this);
34         }
35
36         public override void Dispose()
37         {
38             if (!Stage.IsInstalled())
39             {
40                 DisposeQueue.Instance.Add(this);
41                 return;
42             }
43
44             lock (this)
45             {
46                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
47                 {
48                     if (swigCMemOwn)
49                     {
50                         swigCMemOwn = false;
51                         NDalicPINVOKE.delete_VisualFactory(swigCPtr);
52                     }
53                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
54                 }
55                 global::System.GC.SuppressFinalize(this);
56                 base.Dispose();
57             }
58         }
59
60
61         /// <summary>
62         /// Create or retrieve VisualFactory singleton.
63         /// </summary>
64         /// <returns>A handle to the VisualFactory control.</returns>
65         public static VisualFactory Get()
66         {
67             VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true);
68             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69             return ret;
70         }
71
72         internal VisualFactory() : this(NDalicPINVOKE.new_VisualFactory__SWIG_0(), true)
73         {
74             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75         }
76
77         internal VisualFactory(VisualFactory handle) : this(NDalicPINVOKE.new_VisualFactory__SWIG_1(VisualFactory.getCPtr(handle)), true)
78         {
79             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80         }
81
82         internal VisualFactory Assign(VisualFactory handle)
83         {
84             VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Assign(swigCPtr, VisualFactory.getCPtr(handle)), false);
85             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86             return ret;
87         }
88
89         /// <summary>
90         /// Request the visual
91         /// </summary>
92         /// <param name="propertyMap">The map contains the properties required by the visual. The content of the map determines the type of visual that will be returned.</param>
93         /// <returns>The handle to the created visual</returns>
94         public VisualBase CreateVisual(PropertyMap propertyMap)
95         {
96             VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_0(swigCPtr, PropertyMap.getCPtr(propertyMap)), true);
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             return ret;
99         }
100
101         internal VisualBase CreateVisual(Image image)
102         {
103             VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_1(swigCPtr, Image.getCPtr(image)), true);
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105             return ret;
106         }
107
108         internal VisualBase CreateVisual(string url, Uint16Pair size)
109         {
110             VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size)), true);
111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112             return ret;
113         }
114         private static readonly VisualFactory instance = VisualFactory.Get();
115
116         /// <summary>
117         /// retrieve VisualFactory singleton.
118         /// </summary>
119         public static VisualFactory Instance
120         {
121             get
122             {
123                 return instance;
124             }
125         }
126
127     }
128
129 }