2 * Copyright (c) 2015 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.
19 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/images/resource-image.h>
24 #include <dali/public-api/object/property-map.h>
27 #include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
35 ImageView::ImageView()
39 ImageView::ImageView( const ImageView& imageView )
40 : Control( imageView )
44 ImageView& ImageView::operator=( const ImageView& imageView )
46 if( &imageView != this )
48 Control::operator=( imageView );
53 ImageView::~ImageView()
57 ImageView ImageView::New()
59 return Internal::ImageView::New();
62 ImageView ImageView::New( Image image )
64 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: New() is deprecated and will be removed from next release. use New( const std::string& ) instead.\n" );
66 ImageView imageView = Internal::ImageView::New();
67 imageView.SetImage( image );
71 ImageView ImageView::New( const std::string& url )
73 ImageView imageView = Internal::ImageView::New();
74 imageView.SetImage( url, ImageDimensions() );
78 ImageView ImageView::New( const std::string& url, ImageDimensions size )
80 ImageView imageView = Internal::ImageView::New();
81 imageView.SetImage( url, size );
85 ImageView ImageView::DownCast( BaseHandle handle )
87 return Control::DownCast<ImageView, Internal::ImageView>( handle );
90 void ImageView::SetImage( Image image )
92 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetImage() is deprecated and will be removed from next release. Use SetImage( const std::string& ) instead.\n" );
94 Dali::Toolkit::GetImpl( *this ).SetImage( image );
97 void ImageView::SetImage( const std::string& url )
99 Dali::Toolkit::GetImpl( *this ).SetImage( url, ImageDimensions() );
102 void ImageView::SetImage( const std::string& url, ImageDimensions size )
104 Dali::Toolkit::GetImpl( *this ).SetImage( url, size );
107 Image ImageView::GetImage() const
109 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetImage() is deprecated and will be removed from next release.\n" );
111 return Dali::Toolkit::GetImpl( *this ).GetImage();
114 ImageView::ImageView( Internal::ImageView& implementation )
115 : Control( implementation )
119 ImageView::ImageView( Dali::Internal::CustomActor* internal )
120 : Control( internal )
122 VerifyCustomActorPointer<Internal::ImageView>( internal );
125 } // namespace Toolkit