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