1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 /// ImageView is a class for displaying an image resource.
32 /// An instance of ImageView can be created using a URL or an Image instance.
34 public class ImageView : View
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 DisposeQueue.Instance.Add(this);
53 public override void Dispose()
55 if (!Stage.IsInstalled())
57 DisposeQueue.Instance.Add(this);
63 if (swigCPtr.Handle != global::System.IntPtr.Zero)
68 NDalicPINVOKE.delete_ImageView(swigCPtr);
70 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
72 global::System.GC.SuppressFinalize(this);
78 internal class Property : global::System.IDisposable
80 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
81 protected bool swigCMemOwn;
83 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
85 swigCMemOwn = cMemoryOwn;
86 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
89 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
91 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
99 public virtual void Dispose()
103 if (swigCPtr.Handle != global::System.IntPtr.Zero)
108 NDalicPINVOKE.delete_ImageView_Property(swigCPtr);
110 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
112 global::System.GC.SuppressFinalize(this);
116 internal Property() : this(NDalicPINVOKE.new_ImageView_Property(), true)
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get();
122 internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get();
123 internal static readonly int PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.ImageView_Property_PRE_MULTIPLIED_ALPHA_get();
124 internal static readonly int PIXEL_AREA = NDalicPINVOKE.ImageView_Property_PIXEL_AREA_get();
129 /// Creates an initialized ImageView.
131 public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true)
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 /// Creates an initialized ImageView from an URL to an image resource.
138 /// If the string is empty, ImageView will not display anything.
140 /// <param name="url">The url of the image resource to display</param>
141 public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true)
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 internal ImageView(string url, Uint16Pair size) : this(NDalicPINVOKE.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true)
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 internal ImageView(ImageView imageView) : this(NDalicPINVOKE.new_ImageView__SWIG_1(ImageView.getCPtr(imageView)), true)
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 internal ImageView Assign(ImageView imageView)
157 ImageView ret = new ImageView(NDalicPINVOKE.ImageView_Assign(swigCPtr, ImageView.getCPtr(imageView)), false);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 /// Downcasts a handle to ImageView handle.
163 /// If handle points to a ImageView, the downcast produces valid handle.
164 /// If not, the returned handle is left uninitialized.
166 /// <param name="handle">Handle to an object</param>
167 /// <returns>Handle to a ImageView or an uninitialized handle</returns>
168 public new static ImageView DownCast(BaseHandle handle)
170 ImageView ret = new ImageView(NDalicPINVOKE.ImageView_DownCast(BaseHandle.getCPtr(handle)), true);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 /// Sets this ImageView from the given URL.
176 /// If the URL is empty, ImageView will not display anything.
178 /// <param name="url">The URL to the image resource to display</param>
179 public void SetImage(string url)
181 NDalicPINVOKE.ImageView_SetImage__SWIG_1(swigCPtr, url);
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 internal void SetImage(string url, Uint16Pair size)
186 NDalicPINVOKE.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size));
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 internal enum PropertyRange
191 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
192 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000,
193 ANIMATABLE_PROPERTY_START_INDEX = PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
194 ANIMATABLE_PROPERTY_END_INDEX = PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000
198 /// ImageView ResourceUrl, type string
200 public string ResourceUrl
205 GetProperty(ImageView.Property.RESOURCE_URL).Get(out temp);
210 SetProperty(ImageView.Property.RESOURCE_URL, new Tizen.NUI.PropertyValue(value));
214 /// ImageView ImageMap, type PropertyMap : string if it is a url, map otherwise
216 public PropertyMap ImageMap
220 PropertyMap temp = new PropertyMap();
221 GetProperty(ImageView.Property.IMAGE).Get(temp);
226 SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
230 /// ImageView PreMultipliedAlpha, type Boolean
231 /// Image must be initialized.
233 public bool PreMultipliedAlpha
238 GetProperty(ImageView.Property.PRE_MULTIPLIED_ALPHA).Get(ref temp);
243 SetProperty(ImageView.Property.PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue(value));
247 /// ImageView PixelArea, type Vector4 (Animatable property)
248 /// Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].
250 public Vector4 PixelArea
254 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
255 GetProperty(ImageView.Property.PIXEL_AREA).Get(temp);
260 SetProperty(ImageView.Property.PIXEL_AREA, new Tizen.NUI.PropertyValue(value));