1 /** Copyright (c) 2016 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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class ResourceImage : Image {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal ResourceImage(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ResourceImage_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ResourceImage obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_ResourceImage(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
63 public class LoadingFinishedEventArgs : EventArgs
65 private ResourceImage _resourceImage;
67 public ResourceImage ResourceImage
71 return _resourceImage;
75 _resourceImage = value;
80 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81 private delegate void LoadingFinishedEventCallbackDelegate(IntPtr ResourceImage);
82 private DaliEventHandler<object,LoadingFinishedEventArgs> _resourceImageLoadingFinishedEventHandler;
83 private LoadingFinishedEventCallbackDelegate _resourceImageLoadingFinishedEventCallbackDelegate;
85 public event DaliEventHandler<object,LoadingFinishedEventArgs> LoadingFinished
91 // Restricted to only one listener
92 if (_resourceImageLoadingFinishedEventHandler == null)
94 _resourceImageLoadingFinishedEventHandler += value;
96 _resourceImageLoadingFinishedEventCallbackDelegate = new LoadingFinishedEventCallbackDelegate(OnLoadingFinished);
97 this.LoadingFinishedSignal().Connect(_resourceImageLoadingFinishedEventCallbackDelegate);
106 if (_resourceImageLoadingFinishedEventHandler != null)
108 this.LoadingFinishedSignal().Disconnect(_resourceImageLoadingFinishedEventCallbackDelegate);
111 _resourceImageLoadingFinishedEventHandler -= value;
116 // Callback for ResourceImage LoadingFinishedSignal
117 private void OnLoadingFinished(IntPtr data)
119 LoadingFinishedEventArgs e = new LoadingFinishedEventArgs();
121 // Populate all members of "e" (LoadingFinishedEventArgs) with real data
122 e.ResourceImage = ResourceImage.GetResourceImageFromPtr(data);
124 if (_resourceImageLoadingFinishedEventHandler != null)
126 //here we send all data to user event handlers
127 _resourceImageLoadingFinishedEventHandler(this, e);
132 public static ResourceImage GetResourceImageFromPtr(global::System.IntPtr cPtr) {
133 ResourceImage ret = new ResourceImage(cPtr, false);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 public static Uint16Pair GetImageSize(string url) {
140 Uint16Pair ret = new Uint16Pair(NDalicPINVOKE.ResourceImage_GetImageSize(url), true);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 public ResourceImage (string url, bool orientationCorrection) : this (NDalicPINVOKE.ResourceImage_New__SWIG_0(url, orientationCorrection), true) {
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public ResourceImage (string url) : this (NDalicPINVOKE.ResourceImage_New__SWIG_1(url), true) {
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 public ResourceImage (string url, Uint16Pair size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection) : this (NDalicPINVOKE.ResourceImage_New__SWIG_2(url, Uint16Pair.getCPtr(size), (int)fittingMode, (int)samplingMode, orientationCorrection), true) {
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public ResourceImage (string url, Uint16Pair size, FittingModeType fittingMode, SamplingModeType samplingMode) : this (NDalicPINVOKE.ResourceImage_New__SWIG_3(url, Uint16Pair.getCPtr(size), (int)fittingMode, (int)samplingMode), true) {
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 public ResourceImage (string url, Uint16Pair size, FittingModeType fittingMode) : this (NDalicPINVOKE.ResourceImage_New__SWIG_4(url, Uint16Pair.getCPtr(size), (int)fittingMode), true) {
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public ResourceImage (string url, Uint16Pair size) : this (NDalicPINVOKE.ResourceImage_New__SWIG_5(url, Uint16Pair.getCPtr(size)), true) {
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 public ResourceImage(ResourceImage handle) : this(NDalicPINVOKE.new_ResourceImage__SWIG_1(ResourceImage.getCPtr(handle)), true) {
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public ResourceImage Assign(ResourceImage rhs) {
174 ResourceImage ret = new ResourceImage(NDalicPINVOKE.ResourceImage_Assign(swigCPtr, ResourceImage.getCPtr(rhs)), false);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 public new static ResourceImage DownCast(BaseHandle handle) {
180 ResourceImage ret = new ResourceImage(NDalicPINVOKE.ResourceImage_DownCast(BaseHandle.getCPtr(handle)), true);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 public LoadingState GetLoadingState() {
186 LoadingState ret = (LoadingState)NDalicPINVOKE.ResourceImage_GetLoadingState(swigCPtr);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public string GetUrl() {
192 string ret = NDalicPINVOKE.ResourceImage_GetUrl(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public void Reload() {
198 NDalicPINVOKE.ResourceImage_Reload(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public ResourceImageSignal LoadingFinishedSignal() {
203 ResourceImageSignal ret = new ResourceImageSignal(NDalicPINVOKE.ResourceImage_LoadingFinishedSignal(swigCPtr), false);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();