2 * Copyright(c) 2018 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.
19 using System.ComponentModel;
25 /// The VisualFactory is a singleton object that provides and shares visuals between views.
27 /// <since_tizen> 3 </since_tizen>
28 public class VisualFactory : BaseHandle
32 /// Instance of the VisualFactory singleton.
34 private static VisualFactory instance = null;
35 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37 internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualFactory_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal VisualFactory() : this(NDalicPINVOKE.new_VisualFactory__SWIG_0(), true)
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48 /// Retrieves the VisualFactory singleton.
50 /// <since_tizen> 3 </since_tizen>
51 public static VisualFactory Instance
57 instance = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true);
58 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// Please do not use! this will be deprecated, please use VisualFactory.Instance instead.
68 /// <since_tizen> 3 </since_tizen>
69 [Obsolete("Please do not use! This will be deprecated! Please use VisualFactory.Instance instead! " +
71 "VisualFactory visualFactory = VisualFactory.Instance; " +
72 "visualFactory.CreateVisual(visualMap);")]
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public static VisualFactory Get()
76 return VisualFactory.Instance;
80 /// Request the visual.
82 /// <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>
83 /// <returns>The handle to the created visual.</returns>
84 /// <since_tizen> 3 </since_tizen>
85 public VisualBase CreateVisual(PropertyMap propertyMap)
87 VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_0(swigCPtr, PropertyMap.getCPtr(propertyMap)), true);
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualFactory obj)
94 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
97 internal VisualBase CreateVisual(Image image)
99 VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_1(swigCPtr, Image.getCPtr(image)), true);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();