1 #ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_H__
2 #define __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/dali.h>
26 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
27 #include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
28 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
29 #include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
42 * Base class for different navigation bars such as tool bar, title bar.
44 class NavigationBar : public Dali::RefObject, public ConnectionTracker
50 * Pass in the navigationControl with which the bar associates and its style.
52 NavigationBar( NavigationControl& naviControl,
53 Toolkit::BasicNaviBarStyle barStylePortrait,
54 Toolkit::BasicNaviBarStyle barStyleLandscape);
57 * Update the bar scale when the size of the navigation control is set / reset
58 * Also Update the style when the orientation( portrait/landscape) is changed
59 * @param[in] naviControlSize The size of the navigation control
60 * @param[in] orientation The angle of the current orientation
62 void ScaleStyleUpdate( Vector2 naviControlSize, int orientation );
65 * Retrieve the height of the bar
66 * @return The height of the bar
68 float GetBarHeight() const;
73 * Set a background image and add it onto the NavigaionControl's bar layer.
76 void SetBackground( Actor background );
79 * Call the update function when it receives the page pushed signal.
81 void OnItemPushed( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem );
84 * Call the update function when it receives the page popped signal.
86 void OnItemPopped( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem );
93 virtual ~NavigationBar();
96 * Given the current page, update the bar content.
97 * @param[in] naviItem the item on the top of the navigation stack
99 virtual void Update( Toolkit::Page naviItem ) = 0;
102 * update the bar style when the orientation is changed
103 * @param[in] isPortrait Whether the current orientation is portrait mode
105 virtual void OrientationUpdate( bool isPortrait ) = 0;
110 NavigationBar(const NavigationBar&);
113 NavigationBar& operator=(const NavigationBar& rhs);
117 NavigationControl& mInternalNavigationControl;
118 Toolkit::BasicNaviBarStyle mBasicStylePortrait;
119 Toolkit::BasicNaviBarStyle mBasicStyleLandscape;
120 const Toolkit::BasicNaviBarStyle* mBasicCurrentStyle;
121 float mRelativeScale;
124 Toolkit::TableView mLayout;
128 Toolkit::Page mCurrentItem;
133 } // namespace Internal
135 } // namespace Toolkit
140 #endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_H__ */