Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / navigation-frame / navigation-title-bar.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__
2 #define __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
23 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
24 #include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
25 #include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 /**
37  * The title bar locates in the top of the frame where title, subtitle, title icon and other controls could be placed.
38  * The title bar contains two groups: the left group includes title icon, title and subtitle (subtitle and title icon are not must);
39  * while the right group can have multiple controls placed on, and it is also fine to have no control on it.
40  * If the current NavigationOtem provides no control for the bar at all and also has not set a title, the bar is hidden.
41  *               +----------------------------------------+
42  *               | +-+ Title                   +-+  +-+   |
43  *               | +-+ Subtitle                +-+  +-+   |
44  *               +----------------------------------------+
45  */
46 class NavigationTitleBar : public NavigationBar
47 {
48 public:
49
50   NavigationTitleBar(NavigationControl& naviControl,
51                      Toolkit::NaviTitleBarStyle titleBarStylePortrait,
52                      Toolkit::NaviTitleBarStyle titleBarStyleLandscape );
53
54 protected:
55
56   /**
57    * @copydoc Toolkit::Internal::NavigationBar::Update
58    */
59   void Update( Toolkit::Page page );
60
61   /**
62    * @copydoc Toolkit::Internal::NavigationBar::OrientationUpdate
63    */
64   void OrientationUpdate( bool isPortrait );
65
66 private:
67   /**
68    * Set the fixed width and height to the cells of the layout
69    * These sizes need to be updated when the orientation is changing.
70    */
71   void SetFixedSizes();
72
73 private:
74
75   Toolkit::NaviTitleBarStyle        mStylePortrait;
76   Toolkit::NaviTitleBarStyle        mStyleLandscape;
77   const Toolkit::NaviTitleBarStyle* mCurrentStyle;
78
79   Toolkit::TableView mButtonLayout;
80   Toolkit::TableView mTitleLayout;
81   Toolkit::TableView mTitleIconLayout;
82
83 };
84
85 } // namespace Internal
86
87 } // namespace Toolkit
88
89 } // namespace Dali
90
91
92 #endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__ */