More SVACE fixes
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / ResourceImage.cs
1 /** Copyright (c) 2016 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class ResourceImage : Image {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
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);
38   }
39
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;
42   }
43
44   ~ResourceImage() {
45     Dispose();
46   }
47
48   public override void Dispose() {
49     lock(this) {
50       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
51         if (swigCMemOwn) {
52           swigCMemOwn = false;
53           NDalicPINVOKE.delete_ResourceImage(swigCPtr);
54         }
55         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56       }
57       global::System.GC.SuppressFinalize(this);
58       base.Dispose();
59     }
60   }
61
62
63 public class LoadingFinishedEventArgs : EventArgs
64 {
65    private ResourceImage _resourceImage;
66
67    public ResourceImage ResourceImage
68    {
69       get
70       {
71          return _resourceImage;
72       }
73       set
74       {
75          _resourceImage = value;
76       }
77    }
78 }
79
80   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81   private delegate void LoadingFinishedEventCallbackDelegate(IntPtr ResourceImage);
82   private DaliEventHandler<object,LoadingFinishedEventArgs> _resourceImageLoadingFinishedEventHandler;
83   private LoadingFinishedEventCallbackDelegate _resourceImageLoadingFinishedEventCallbackDelegate;
84
85   public event DaliEventHandler<object,LoadingFinishedEventArgs> LoadingFinished
86   {
87      add
88      {
89         lock(this)
90         {
91            // Restricted to only one listener
92            if (_resourceImageLoadingFinishedEventHandler == null)
93            {
94               _resourceImageLoadingFinishedEventHandler += value;
95
96               _resourceImageLoadingFinishedEventCallbackDelegate = new LoadingFinishedEventCallbackDelegate(OnLoadingFinished);
97               this.LoadingFinishedSignal().Connect(_resourceImageLoadingFinishedEventCallbackDelegate);
98            }
99         }
100      }
101
102      remove
103      {
104         lock(this)
105         {
106            if (_resourceImageLoadingFinishedEventHandler != null)
107            {
108               this.LoadingFinishedSignal().Disconnect(_resourceImageLoadingFinishedEventCallbackDelegate);
109            }
110
111            _resourceImageLoadingFinishedEventHandler -= value;
112         }
113      }
114   }
115
116   // Callback for ResourceImage LoadingFinishedSignal
117   private void OnLoadingFinished(IntPtr data)
118   {
119      LoadingFinishedEventArgs e = new LoadingFinishedEventArgs();
120
121      // Populate all members of "e" (LoadingFinishedEventArgs) with real data
122      e.ResourceImage = ResourceImage.GetResourceImageFromPtr(data);
123
124      if (_resourceImageLoadingFinishedEventHandler != null)
125      {
126         //here we send all data to user event handlers
127         _resourceImageLoadingFinishedEventHandler(this, e);
128      }
129   }
130
131
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();
135     return ret;
136   }
137
138
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();
142     return ret;
143   }
144
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();
147
148   }
149   public ResourceImage (string url) : this (NDalicPINVOKE.ResourceImage_New__SWIG_1(url), true) {
150       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151
152   }
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();
155
156   }
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();
159
160   }
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();
163
164   }
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();
167
168   }
169   public ResourceImage(ResourceImage handle) : this(NDalicPINVOKE.new_ResourceImage__SWIG_1(ResourceImage.getCPtr(handle)), true) {
170     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171   }
172
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();
176     return ret;
177   }
178
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();
182     return ret;
183   }
184
185   public LoadingState GetLoadingState() {
186     LoadingState ret = (LoadingState)NDalicPINVOKE.ResourceImage_GetLoadingState(swigCPtr);
187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188     return ret;
189   }
190
191   public string GetUrl() {
192     string ret = NDalicPINVOKE.ResourceImage_GetUrl(swigCPtr);
193     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194     return ret;
195   }
196
197   public void Reload() {
198     NDalicPINVOKE.ResourceImage_Reload(swigCPtr);
199     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200   }
201
202   public ResourceImageSignal LoadingFinishedSignal() {
203     ResourceImageSignal ret = new ResourceImageSignal(NDalicPINVOKE.ResourceImage_LoadingFinishedSignal(swigCPtr), false);
204     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205     return ret;
206   }
207
208 }
209
210 }