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