2 * Copyright(c) 2021 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;
24 /// The VisualFactory is a singleton object that provides and shares visuals between views.
26 /// <since_tizen> 3 </since_tizen>
27 public class VisualFactory : BaseHandle
30 /// Instance of the VisualFactory singleton.
32 private static VisualFactory instance;
34 internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
38 internal VisualFactory() : this(Interop.VisualFactory.NewVisualFactory(), true)
40 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44 /// Retrieves the VisualFactory singleton.
46 /// <since_tizen> 3 </since_tizen>
47 public static VisualFactory Instance
53 instance = new VisualFactory(Interop.VisualFactory.Get(), true);
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
62 /// Please do not use! this will be deprecated, please use VisualFactory.Instance instead.
64 /// <since_tizen> 3 </since_tizen>
65 [Obsolete("Please do not use! This will be deprecated! Please use VisualFactory.Instance instead! " +
67 "VisualFactory visualFactory = VisualFactory.Instance; " +
68 "visualFactory.CreateVisual(visualMap);")]
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 public static VisualFactory Get()
72 return VisualFactory.Instance;
76 /// Request the visual.
78 /// <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>
79 /// <returns>The handle to the created visual.</returns>
80 /// <since_tizen> 3 </since_tizen>
81 public VisualBase CreateVisual(PropertyMap propertyMap)
83 VisualBase ret = new VisualBase(Interop.VisualFactory.CreateVisual(SwigCPtr, PropertyMap.getCPtr(propertyMap)), true);
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();