2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "async-image-loader.h"
21 #include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
29 AsyncImageLoader::AsyncImageLoader()
33 AsyncImageLoader::~AsyncImageLoader()
37 AsyncImageLoader::AsyncImageLoader( Internal::AsyncImageLoader* impl )
42 AsyncImageLoader::AsyncImageLoader( const AsyncImageLoader& handle )
43 : BaseHandle( handle )
47 AsyncImageLoader& AsyncImageLoader::operator=( const AsyncImageLoader& handle )
49 BaseHandle::operator=( handle );
53 AsyncImageLoader AsyncImageLoader::DownCast( BaseHandle handle )
55 return AsyncImageLoader( dynamic_cast<Dali::Toolkit::Internal::AsyncImageLoader*>( handle.GetObjectPtr() ) );
58 AsyncImageLoader AsyncImageLoader::New()
60 IntrusivePtr<Internal::AsyncImageLoader> internal = Internal::AsyncImageLoader::New();
61 return AsyncImageLoader( internal.Get() );
64 uint32_t AsyncImageLoader::Load( const std::string& url )
66 return GetImplementation( *this ).Load( url, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, true );
69 uint32_t AsyncImageLoader::Load( const std::string& url, ImageDimensions dimensions )
71 return GetImplementation( *this ).Load( url, dimensions, FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, true );
74 uint32_t AsyncImageLoader::Load( const std::string& url,
75 ImageDimensions dimensions,
76 FittingMode::Type fittingMode,
77 SamplingMode::Type samplingMode,
78 bool orientationCorrection )
80 return GetImplementation(*this).Load( url, dimensions, fittingMode, samplingMode, orientationCorrection );
83 bool AsyncImageLoader::Cancel( uint32_t loadingTaskId )
85 return GetImplementation(*this).Cancel( loadingTaskId );
88 void AsyncImageLoader::CancelAll()
90 GetImplementation( *this ).CancelAll();
93 AsyncImageLoader::ImageLoadedSignalType& AsyncImageLoader::ImageLoadedSignal()
95 return GetImplementation( *this ).ImageLoadedSignal();
97 } // namespace Toolkit