d65bef01da4bb51a3cae91c02265610c5df40e19
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / image-view / image-view.cpp
1 /*
2  * Copyright (c) 2020 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/object/property-map.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
27
28 namespace Dali
29 {
30 namespace Toolkit
31 {
32 ImageView::ImageView()
33 {
34 }
35
36 ImageView::ImageView(const ImageView& imageView) = default;
37
38 ImageView::ImageView(ImageView&& rhs) = default;
39
40 ImageView& ImageView::operator=(const ImageView& imageView) = default;
41
42 ImageView& ImageView::operator=(ImageView&& rhs) = default;
43
44 ImageView::~ImageView()
45 {
46 }
47
48 ImageView ImageView::New()
49 {
50   return Internal::ImageView::New();
51 }
52
53 ImageView ImageView::New(const std::string& url)
54 {
55   ImageView imageView = Internal::ImageView::New();
56   imageView.SetImage(url, ImageDimensions());
57   return imageView;
58 }
59
60 ImageView ImageView::New(const std::string& url, ImageDimensions size)
61 {
62   ImageView imageView = Internal::ImageView::New();
63   imageView.SetImage(url, size);
64   return imageView;
65 }
66
67 ImageView ImageView::DownCast(BaseHandle handle)
68 {
69   return Control::DownCast<ImageView, Internal::ImageView>(handle);
70 }
71
72 void ImageView::SetImage(const std::string& url)
73 {
74   Dali::Toolkit::GetImpl(*this).SetImage(url, ImageDimensions());
75 }
76
77 void ImageView::SetImage(const std::string& url, ImageDimensions size)
78 {
79   Dali::Toolkit::GetImpl(*this).SetImage(url, size);
80 }
81
82 ImageView::ImageView(Internal::ImageView& implementation)
83 : Control(implementation)
84 {
85 }
86
87 ImageView::ImageView(Dali::Internal::CustomActor* internal)
88 : Control(internal)
89 {
90   VerifyCustomActorPointer<Internal::ImageView>(internal);
91 }
92
93 } // namespace Toolkit
94
95 } // namespace Dali