[4.0] Removed DEPRECATION WARNING by ImageView::New( image ) and SetImage( image )
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / image-view / image-view.cpp
1 /*
2  * Copyright (c) 2015 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 // CLASS HEADER
19 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
20
21 // EXTERNAL INCLUDES
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>
25
26 // INTERNAL INCLUDES
27 #include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
28
29 namespace Dali
30 {
31
32 namespace Toolkit
33 {
34
35 ImageView::ImageView()
36 {
37 }
38
39 ImageView::ImageView( const ImageView& imageView )
40 : Control( imageView )
41 {
42 }
43
44 ImageView& ImageView::operator=( const ImageView& imageView )
45 {
46   if( &imageView != this )
47   {
48     Control::operator=( imageView );
49   }
50   return *this;
51 }
52
53 ImageView::~ImageView()
54 {
55 }
56
57 ImageView ImageView::New()
58 {
59   return Internal::ImageView::New();
60 }
61
62 ImageView ImageView::New( Image image )
63 {
64   ImageView imageView = Internal::ImageView::New();
65   imageView.SetImage( image );
66   return imageView;
67 }
68
69 ImageView ImageView::New( const std::string& url )
70 {
71   ImageView imageView = Internal::ImageView::New();
72   imageView.SetImage( url, ImageDimensions() );
73   return imageView;
74 }
75
76 ImageView ImageView::New( const std::string& url, ImageDimensions size )
77 {
78   ImageView imageView = Internal::ImageView::New();
79   imageView.SetImage( url, size );
80   return imageView;
81 }
82
83 ImageView ImageView::DownCast( BaseHandle handle )
84 {
85   return Control::DownCast<ImageView, Internal::ImageView>( handle );
86 }
87
88 void ImageView::SetImage( Image image )
89 {
90   Dali::Toolkit::GetImpl( *this ).SetImage( image );
91 }
92
93 void ImageView::SetImage( const std::string& url )
94 {
95   Dali::Toolkit::GetImpl( *this ).SetImage( url, ImageDimensions() );
96 }
97
98 void ImageView::SetImage( const std::string& url, ImageDimensions size )
99 {
100   Dali::Toolkit::GetImpl( *this ).SetImage( url, size );
101 }
102
103 Image ImageView::GetImage() const
104 {
105   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetImage() is deprecated and will be removed from next release.\n" );
106
107   return Dali::Toolkit::GetImpl( *this ).GetImage();
108 }
109
110 ImageView::ImageView( Internal::ImageView& implementation )
111  : Control( implementation )
112 {
113 }
114
115 ImageView::ImageView( Dali::Internal::CustomActor* internal )
116  : Control( internal )
117 {
118   VerifyCustomActorPointer<Internal::ImageView>( internal );
119 }
120
121 } // namespace Toolkit
122
123 } // namespace Dali