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