0b3193f91c3b75d2fec1d466da4c1942a3709032
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visual-factory / visual-base.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/devel-api/visual-factory/visual-base.h>
20
21 // INTERAL INCLUDES
22 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Visual
31 {
32
33 Base::Base()
34 {
35 }
36
37 Base::~Base()
38 {
39 }
40
41 Base::Base( const Base& handle )
42 : BaseHandle( handle )
43 {
44 }
45
46 Base& Base::operator=( const Base& handle )
47 {
48   BaseHandle::operator=( handle );
49   return *this;
50 }
51
52 Base::Base(Internal::Visual::Base *impl)
53 : BaseHandle( impl )
54 {
55 }
56
57 void Base::SetSize( const Vector2& size )
58 {
59   GetImplementation( *this ).SetSize( size );
60 }
61
62 const Vector2& Base::GetSize() const
63 {
64   return GetImplementation( *this ).GetSize();
65 }
66
67 void Base::GetNaturalSize(Vector2& naturalSize ) const
68 {
69   GetImplementation( *this ).GetNaturalSize( naturalSize );
70 }
71
72 void Base::SetDepthIndex( float index )
73 {
74   GetImplementation( *this ).SetDepthIndex( index );
75 }
76
77 float Base::GetDepthIndex() const
78 {
79   return GetImplementation( *this ).GetDepthIndex();
80 }
81
82 void Base::SetOnStage( Actor& actor )
83 {
84   GetImplementation( *this ).SetOnStage( actor );
85 }
86
87 void Base::SetOffStage( Actor& actor )
88 {
89   GetImplementation( *this ).SetOffStage( actor );
90 }
91
92 void Base::RemoveAndReset( Actor& actor )
93 {
94   if( actor && *this )
95   {
96     SetOffStage( actor );
97   }
98   Reset();
99 }
100
101 void Base::CreatePropertyMap( Property::Map& map ) const
102 {
103   GetImplementation( *this ).CreatePropertyMap( map );
104 }
105
106 } // namespace Visual
107
108 } // namespace Toolkit
109
110 } // namespace Dali