2 * Copyright(c) 2017 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.Runtime.InteropServices;
20 using System.ComponentModel;
26 /// Sets whether the actor should be focusable by keyboard navigation.<br />
27 /// Visuals reuse geometry, shader etc. across controls. They ensure that the renderer and texture sets exist only when control is on window.<br />
28 /// Each visual also responds to actor size and color change, and provides clipping at the renderer level.<br />
30 /// <since_tizen> 3 </since_tizen>
31 public class VisualBase : BaseHandle
35 /// Creates an empty visual handle.
37 /// <since_tizen> 3 </since_tizen>
38 public VisualBase() : this(Interop.VisualBase.new_VisualBase__SWIG_0(), true)
40 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43 internal VisualBase(VisualBase handle) : this(Interop.VisualBase.new_VisualBase__SWIG_1(VisualBase.getCPtr(handle)), true)
45 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47 internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.VisualBase.VisualBase_SWIGUpcast(cPtr), cMemoryOwn)
52 /// The name of the visual.
54 /// <since_tizen> 3 </since_tizen>
68 /// The depth index of this visual.
70 /// <since_tizen> 3 </since_tizen>
79 return GetDepthIndex();
84 /// Creates the property map representing this visual.
86 /// <since_tizen> 3 </since_tizen>
87 public PropertyMap Creation
91 PropertyMap map = new PropertyMap();
92 CreatePropertyMap(map);
98 /// Sets the transform and the control size.
100 /// <param name="transform">A property map describing the transform.</param>
101 /// <param name="controlSize">The size of the parent control for visuals that need to scale internally.</param>
102 /// <since_tizen> 3 </since_tizen>
103 public void SetTransformAndSize(PropertyMap transform, Vector2 controlSize)
105 Interop.VisualBase.VisualBase_SetTransformAndSize(swigCPtr, PropertyMap.getCPtr(transform), Vector2.getCPtr(controlSize));
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110 /// Returns the height for a given width.
112 /// <param name="width">The width to use.</param>
113 /// <returns>The height based on the width.</returns>
114 /// <since_tizen> 3 </since_tizen>
115 public float GetHeightForWidth(float width)
117 float ret = Interop.VisualBase.VisualBase_GetHeightForWidth(swigCPtr, width);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 /// Returns the width for a given height.
125 /// <param name="height">The height to use.</param>
126 /// <returns>The width based on the height.</returns>
127 /// <since_tizen> 3 </since_tizen>
128 public float GetWidthForHeight(float height)
130 float ret = Interop.VisualBase.VisualBase_GetWidthForHeight(swigCPtr, height);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 /// Returns the natural size of the visual.<br />
137 /// Deriving classes stipulate the natural size and by default a visual has a zero natural size.<br />
138 /// A visual may not actually have a natural size until it has been placed on window and acquired all it's resources.<br />
140 /// <param name="naturalSize">The visual's natural size.</param>
141 /// <since_tizen> 3 </since_tizen>
142 public void GetNaturalSize(Size2D naturalSize)
144 Interop.VisualBase.VisualBase_GetNaturalSize(swigCPtr, Size2D.getCPtr(naturalSize));
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase obj)
150 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
153 internal void SetName(string name)
155 Interop.VisualBase.VisualBase_SetName(swigCPtr, name);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 internal string GetName()
161 string ret = Interop.VisualBase.VisualBase_GetName(swigCPtr);
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 internal void SetDepthIndex(int index)
168 Interop.VisualBase.VisualBase_SetDepthIndex(swigCPtr, index);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 internal int GetDepthIndex()
174 int ret = Interop.VisualBase.VisualBase_GetDepthIndex(swigCPtr);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 internal void CreatePropertyMap(PropertyMap map)
181 Interop.VisualBase.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map));
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 /// This will not be public opened.
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
189 Interop.VisualBase.delete_VisualBase(swigCPtr);