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;
36 internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.VisualFactory.Upcast(cPtr), cMemoryOwn)
40 internal VisualFactory() : this(Interop.VisualFactory.NewVisualFactory(), true)
42 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46 /// Retrieves the VisualFactory singleton.
48 /// <since_tizen> 3 </since_tizen>
49 public static VisualFactory Instance
55 instance = new VisualFactory(Interop.VisualFactory.Get(), true);
56 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
64 /// Please do not use! this will be deprecated, please use VisualFactory.Instance instead.
66 /// <since_tizen> 3 </since_tizen>
67 [Obsolete("Please do not use! This will be deprecated! Please use VisualFactory.Instance instead! " +
69 "VisualFactory visualFactory = VisualFactory.Instance; " +
70 "visualFactory.CreateVisual(visualMap);")]
71 [EditorBrowsable(EditorBrowsableState.Never)]
72 public static VisualFactory Get()
74 return VisualFactory.Instance;
78 /// Request the visual.
80 /// <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>
81 /// <returns>The handle to the created visual.</returns>
82 /// <since_tizen> 3 </since_tizen>
83 public VisualBase CreateVisual(PropertyMap propertyMap)
85 VisualBase ret = new VisualBase(Interop.VisualFactory.CreateVisual(SwigCPtr, PropertyMap.getCPtr(propertyMap)), true);
86 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();