4207138c09824c76e6f42c584a28082ddf4dfcbe
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / AsyncImageLoader.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 namespace Tizen.NUI
19 {
20     internal class AsyncImageLoader : BaseHandle
21     {
22
23         internal AsyncImageLoader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.AsyncImageLoader.AsyncImageLoader_SWIGUpcast(cPtr), cMemoryOwn)
24         {
25         }
26
27         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AsyncImageLoader obj)
28         {
29             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30         }
31
32         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
33         {
34             Interop.AsyncImageLoader.delete_AsyncImageLoader(swigCPtr);
35         }
36
37         public AsyncImageLoader() : this(Interop.AsyncImageLoader.AsyncImageLoader_New(), true)
38         {
39             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40
41         }
42         public AsyncImageLoader(AsyncImageLoader handle) : this(Interop.AsyncImageLoader.new_AsyncImageLoader__SWIG_1(AsyncImageLoader.getCPtr(handle)), true)
43         {
44             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
45         }
46
47         public AsyncImageLoader Assign(AsyncImageLoader handle)
48         {
49             AsyncImageLoader ret = new AsyncImageLoader(Interop.AsyncImageLoader.AsyncImageLoader_Assign(swigCPtr, AsyncImageLoader.getCPtr(handle)), false);
50             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51             return ret;
52         }
53
54         public static AsyncImageLoader DownCast(BaseHandle handle)
55         {
56             AsyncImageLoader ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as AsyncImageLoader;
57             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58             return ret;
59         }
60
61         public uint Load(string url)
62         {
63             uint ret = Interop.AsyncImageLoader.AsyncImageLoader_Load__SWIG_0(swigCPtr, url);
64             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65             return ret;
66         }
67
68         public uint Load(string url, Uint16Pair dimensions)
69         {
70             uint ret = Interop.AsyncImageLoader.AsyncImageLoader_Load__SWIG_1(swigCPtr, url, Uint16Pair.getCPtr(dimensions));
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72             return ret;
73         }
74
75         public uint Load(string url, Uint16Pair dimensions, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
76         {
77             uint ret = Interop.AsyncImageLoader.AsyncImageLoader_Load__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(dimensions), (int)fittingMode, (int)samplingMode, orientationCorrection);
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79             return ret;
80         }
81
82         public bool Cancel(uint loadingTaskId)
83         {
84             bool ret = Interop.AsyncImageLoader.AsyncImageLoader_Cancel(swigCPtr, loadingTaskId);
85             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86             return ret;
87         }
88
89         public void CancelAll()
90         {
91             Interop.AsyncImageLoader.AsyncImageLoader_CancelAll(swigCPtr);
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93         }
94
95         public SWIGTYPE_p_Dali__SignalT_void_fuint32_t_Dali__PixelDataF_t ImageLoadedSignal()
96         {
97             SWIGTYPE_p_Dali__SignalT_void_fuint32_t_Dali__PixelDataF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fuint32_t_Dali__PixelDataF_t(Interop.AsyncImageLoader.AsyncImageLoader_ImageLoadedSignal(swigCPtr));
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99             return ret;
100         }
101     }
102 }