Conversion to Apache 2.0 license
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / view / view.cpp
1 /*
2  * Copyright (c) 2014 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
20 #include "view.h"
21
22 // EXTERNAL INCLUDES
23
24 // INTERNAL INCLUDES
25
26 #include <dali-toolkit/internal/controls/view/view-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 const char* const View::SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start";
35
36 View::View()
37 {
38 }
39
40 View::View( const View& handle )
41 : Control( handle )
42 {
43 }
44
45 View& View::operator=( const View& handle )
46 {
47   if( &handle != this )
48   {
49     Control::operator=( handle );
50   }
51   return *this;
52 }
53
54 View::~View()
55 {
56 }
57
58 View View::New( bool fullscreen )
59 {
60   return Internal::View::New( fullscreen );
61 }
62
63 View View::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast<View, Internal::View>(handle);
66 }
67
68 Layer View::GetContentLayer( unsigned int index ) const
69 {
70   return GetImpl( *this ).GetContentLayer( index );
71 }
72
73 unsigned int View::AddContentLayer( Layer layer )
74 {
75   return GetImpl( *this ).AddContentLayer( layer );
76 }
77
78 void View::RemoveContentLayer( Layer layer )
79 {
80   GetImpl( *this ).RemoveContentLayer( layer );
81 }
82
83 Layer View::GetBackgroundLayer() const
84 {
85   return GetImpl( *this ).GetBackgroundLayer();
86 }
87
88 void View::SetBackground( ImageActor image )
89 {
90   GetImpl( *this ).SetBackground( image );
91 }
92
93 void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
94 {
95   GetImpl( *this ).SetOrientationFunction( portrait, landscale, portraitInverse, landscapeInverse );
96 }
97
98 void View::OrientationChanged( Orientation orientation )
99 {
100   GetImpl( *this ).OrientationChanged( orientation );
101 }
102
103 void View::SetAutoRotate( bool enabled )
104 {
105   GetImpl( *this ).SetAutoRotate( enabled );
106 }
107
108 View::OrientationAnimationStartedSignalV2& View::OrientationAnimationStartedSignal()
109 {
110   return GetImpl( *this ).OrientationAnimationStartedSignal();
111 }
112
113 View::View( Internal::View& implementation )
114 : Control( implementation )
115 {
116 }
117
118 View::View( Dali::Internal::CustomActor* internal )
119 : Control( internal )
120 {
121   VerifyCustomActorPointer<Internal::View>(internal);
122 }
123
124 } // namespace Toolkit
125
126 } // namespace Dali