3f5da36df1cf7d875ac60b841990bb4353883dee
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / navigation-frame / navigation-control.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 #include "navigation-control.h"
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 const char* const NavigationControl::ACTION_PUSH = "push";
33 const char* const NavigationControl::ACTION_POP = "pop";
34
35 NavigationControl::NavigationControl()
36 {
37 }
38
39 NavigationControl::NavigationControl( const NavigationControl& handle )
40 : Control(handle)
41 {
42 }
43
44 NavigationControl& NavigationControl::operator=( const NavigationControl& handle)
45 {
46   if( &handle != this )
47   {
48     Control::operator=( handle );
49   }
50   return *this;
51 }
52
53 NavigationControl::~NavigationControl()
54 {
55 }
56
57 NavigationControl NavigationControl::New()
58 {
59   return Internal::NavigationControl::New();
60 }
61
62 NavigationControl NavigationControl::DownCast( BaseHandle handle )
63 {
64   return Control::DownCast<NavigationControl, Internal::NavigationControl>(handle);
65 }
66
67 NavigationControl::NavigationControl( Internal::NavigationControl& implementation )
68 : Control( implementation )
69 {
70 }
71
72 NavigationControl::NavigationControl( Dali::Internal::CustomActor* internal )
73 : Control( internal)
74 {
75   VerifyCustomActorPointer<Internal::NavigationControl>(internal);
76 }
77
78
79 void NavigationControl::PushItem( Page item )
80 {
81   GetImpl( *this ).PushItem( item );
82 }
83
84 Page NavigationControl::PopItem()
85 {
86   return GetImpl( *this ).PopItem();
87 }
88
89 size_t NavigationControl::GetItemCount() const
90 {
91   return GetImpl( *this ).GetItemCount();
92 }
93
94 Page NavigationControl::GetItem(std::size_t index) const
95 {
96   return GetImpl( *this ).GetItem( index );
97 }
98
99 Page NavigationControl::GetCurrentItem() const
100 {
101   return GetImpl(*this ).GetCurrentItem();
102 }
103
104 void NavigationControl::SetBackground( Actor background)
105 {
106   GetImpl( *this ).SetBackground( background );
107 }
108
109 void NavigationControl::CreateNavigationToolBar( NaviToolBarStyle toolBarStylePortrait, NaviToolBarStyle toolBarStyleLandscape )
110 {
111   GetImpl( *this ).CreateNavigationToolBar( toolBarStylePortrait, toolBarStyleLandscape );
112 }
113
114 void NavigationControl::CreateNavigationTitleBar( NaviTitleBarStyle titleBarStylePortrait, NaviTitleBarStyle titleBarStyleLandscape )
115 {
116   GetImpl( *this ).CreateNavigationTitleBar( titleBarStylePortrait, titleBarStyleLandscape );
117 }
118
119 void NavigationControl::OrientationChanged( int angle )
120 {
121   GetImpl( *this ).OrientationChanged( angle );
122 }
123
124 void NavigationControl::SetOrientationRotateAnimation( float duration, AlphaFunction alphaFunc)
125 {
126   GetImpl( *this ).SetOrientationRotateAnimation( duration, alphaFunc );
127 }
128
129 NavigationControl::ItemPushedSignalV2& NavigationControl::ItemPushedSignal()
130 {
131   return GetImpl( *this ).ItemPushedSignal();
132 }
133
134 NavigationControl::ItemPoppedSignalV2& NavigationControl::ItemPoppedSignal()
135 {
136   return GetImpl( *this ).ItemPoppedSignal();
137 }
138
139 } // namespace Toolkit
140
141 } // namespace Dali