[NUI]Remove some unused APIs.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / VisualBase.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24
25     /// <summary>
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 />
29     /// </summary>
30     /// <since_tizen> 3 </since_tizen>
31     public class VisualBase : BaseHandle
32     {
33         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34
35         internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualBase_SWIGUpcast(cPtr), cMemoryOwn)
36         {
37             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38         }
39
40         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase obj)
41         {
42             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
43         }
44
45         /// <summary>
46         /// Dispose.
47         /// </summary>
48         /// <param name="type">The dispose type</param>
49         /// <since_tizen> 3 </since_tizen>
50         protected override void Dispose(DisposeTypes type)
51         {
52             if(disposed)
53             {
54                 return;
55             }
56
57             if(type == DisposeTypes.Explicit)
58             {
59                 //Called by User
60                 //Release your own managed resources here.
61                 //You should release all of your own disposable objects here.
62             }
63
64             //Release your own unmanaged resources here.
65             //You should not access any managed member here except static instance.
66             //because the execution order of Finalizes is non-deterministic.
67
68             if (swigCPtr.Handle != global::System.IntPtr.Zero)
69             {
70                 if (swigCMemOwn)
71                 {
72                     swigCMemOwn = false;
73                     NDalicPINVOKE.delete_VisualBase(swigCPtr);
74                 }
75                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76             }
77
78             base.Dispose(type);
79         }
80
81         /// <summary>
82         /// Creates an empty visual handle.
83         /// </summary>
84         /// <since_tizen> 3 </since_tizen>
85         public VisualBase() : this(NDalicPINVOKE.new_VisualBase__SWIG_0(), true)
86         {
87             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88         }
89
90         internal VisualBase(VisualBase handle) : this(NDalicPINVOKE.new_VisualBase__SWIG_1(VisualBase.getCPtr(handle)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93         }
94
95         /// <summary>
96         /// The name of the visual.
97         /// </summary>
98         /// <since_tizen> 3 </since_tizen>
99         public string Name
100         {
101             set
102             {
103                 SetName(value);
104             }
105             get
106             {
107                 return GetName();
108             }
109         }
110
111         internal void SetName(string name)
112         {
113             NDalicPINVOKE.VisualBase_SetName(swigCPtr, name);
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115         }
116
117         internal string GetName()
118         {
119             string ret = NDalicPINVOKE.VisualBase_GetName(swigCPtr);
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121             return ret;
122         }
123
124         /// <summary>
125         /// Sets the transform and the control size.
126         /// </summary>
127         /// <param name="transform">A property map describing the transform.</param>
128         /// <param name="controlSize">The size of the parent control for visuals that need to scale internally.</param>
129         /// <since_tizen> 3 </since_tizen>
130         public void SetTransformAndSize(PropertyMap transform, Vector2 controlSize)
131         {
132             NDalicPINVOKE.VisualBase_SetTransformAndSize(swigCPtr, PropertyMap.getCPtr(transform), Vector2.getCPtr(controlSize));
133             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134         }
135
136         /// <summary>
137         /// Returns the height for a given width.
138         /// </summary>
139         /// <param name="width">The width to use.</param>
140         /// <returns>The height based on the width.</returns>
141         /// <since_tizen> 3 </since_tizen>
142         public float GetHeightForWidth(float width)
143         {
144             float ret = NDalicPINVOKE.VisualBase_GetHeightForWidth(swigCPtr, width);
145             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146             return ret;
147         }
148
149         /// <summary>
150         /// Returns the width for a given height.
151         /// </summary>
152         /// <param name="height">The height to use.</param>
153         /// <returns>The width based on the height.</returns>
154         /// <since_tizen> 3 </since_tizen>
155         public float GetWidthForHeight(float height)
156         {
157             float ret = NDalicPINVOKE.VisualBase_GetWidthForHeight(swigCPtr, height);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162         /// <summary>
163         /// Returns the natural size of the visual.<br />
164         /// Deriving classes stipulate the natural size and by default a visual has a zero natural size.<br />
165         /// A visual may not actually have a natural size until it has been placed on window and acquired all it's resources.<br />
166         /// </summary>
167         /// <param name="naturalSize">The visual's natural size.</param>
168         /// <since_tizen> 3 </since_tizen>
169         public void GetNaturalSize(Size2D naturalSize)
170         {
171             NDalicPINVOKE.VisualBase_GetNaturalSize(swigCPtr, Size2D.getCPtr(naturalSize));
172             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173         }
174
175         /// <summary>
176         /// The depth index of this visual.
177         /// </summary>
178         /// <since_tizen> 3 </since_tizen>
179         public int DepthIndex
180         {
181             set
182             {
183                 SetDepthIndex(value);
184             }
185             get
186             {
187                 return GetDepthIndex();
188             }
189         }
190         internal void SetDepthIndex(int index)
191         {
192             NDalicPINVOKE.VisualBase_SetDepthIndex(swigCPtr, index);
193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194         }
195
196         internal int GetDepthIndex()
197         {
198             int ret = NDalicPINVOKE.VisualBase_GetDepthIndex(swigCPtr);
199             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200             return ret;
201         }
202
203         /// <summary>
204         /// Creates the property map representing this visual.
205         /// </summary>
206         /// <since_tizen> 3 </since_tizen>
207         public PropertyMap Creation
208         {
209             get
210             {
211                 PropertyMap map = new PropertyMap();
212                 CreatePropertyMap(map);
213                 return map;
214             }
215         }
216
217         internal void CreatePropertyMap(PropertyMap map)
218         {
219             NDalicPINVOKE.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map));
220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221         }
222
223         internal VisualBase(SWIGTYPE_p_Dali__Toolkit__Internal__Visual__Base impl) : this(NDalicPINVOKE.new_VisualBase__SWIG_2(SWIGTYPE_p_Dali__Toolkit__Internal__Visual__Base.getCPtr(impl)), true)
224         {
225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226         }
227
228     }
229
230 }