Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git] / examples / styling / image-channel-control.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 #include "image-channel-control.h"
18 #include "image-channel-control-impl.h"
19
20 namespace Demo
21 {
22 ImageChannelControl::ImageChannelControl()
23 {
24 }
25
26 ImageChannelControl::ImageChannelControl(const ImageChannelControl& imageChannelControl)
27 : Control(imageChannelControl)
28 {
29 }
30
31 ImageChannelControl& ImageChannelControl::operator=(const ImageChannelControl& rhs)
32 {
33   if(&rhs != this)
34   {
35     Control::operator=(rhs);
36   }
37   return *this;
38 }
39
40 ImageChannelControl::~ImageChannelControl()
41 {
42 }
43
44 ImageChannelControl ImageChannelControl::New()
45 {
46   ImageChannelControl imageChannelControl = Internal::ImageChannelControl::New();
47   return imageChannelControl;
48 }
49
50 ImageChannelControl ImageChannelControl::New(const std::string& url)
51 {
52   ImageChannelControl imageChannelControl = Internal::ImageChannelControl::New();
53   imageChannelControl.SetImage(url);
54   return imageChannelControl;
55 }
56
57 ImageChannelControl ImageChannelControl::DownCast(BaseHandle handle)
58 {
59   return Control::DownCast<ImageChannelControl, Internal::ImageChannelControl>(handle);
60 }
61
62 void ImageChannelControl::SetImage(const std::string& url)
63 {
64   GetImpl(*this).SetImage(url);
65 }
66
67 void ImageChannelControl::SetVisibility(bool visibility)
68 {
69   GetImpl(*this).SetVisibility(visibility);
70 }
71
72 ImageChannelControl::ImageChannelControl(Internal::ImageChannelControl& implementation)
73 : Control(implementation)
74 {
75 }
76
77 ImageChannelControl::ImageChannelControl(Dali::Internal::CustomActor* internal)
78 : Control(internal)
79 {
80   VerifyCustomActorPointer<Internal::ImageChannelControl>(internal);
81 }
82
83 } //namespace Demo