1 #ifndef __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__
2 #define __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
20 namespace Dali DALI_IMPORT_API
27 * The basic information of a navigation bar style: background and size.
28 * All the style metrics for tool bar and title bar are in pixels referring to a bar width of 'referenceWidth'.
29 * To fit the bars into different window size, the NavigationControl scales the bar by the ratio of windowWidth and referenceWidth.
31 struct BasicNaviBarStyle
36 BasicNaviBarStyle ( Actor background,
39 : background( background ),
40 referenceWidth( referenceWidth ),
45 Actor background; ///< bar background
46 int referenceWidth; ///< the width of the bar, this value also used to calculate the scale to fit the bar into windows of different sizes
47 int height; ///< the height of the bar
51 * The tool bar locates in the bottom of the frame where other controls (such as PushButton ) could be placed.
52 * NaviToolBarStyle provides the tool bar layout style, which customize the position and size of the controls placed on it.
53 * Controls could be added into three groups: HorizontalLeft, HorizontalCenter or HorizontalRight.
54 * The left and right groups can only have one control maximum each, while the central group can have multiple controls.
55 * It is fine to have no control in every group.
56 * +----------------------------------------+
57 * | +-+ +-----+ +-----+ +-+ |
58 * | +-+ +-----+ +-----+ +-+ |
59 * +----------------------------------------+
61 struct NaviToolBarStyle : BasicNaviBarStyle
66 NaviToolBarStyle ( Actor background,
71 int centralButtonHeight,
74 int hotizontalMargin )
75 : BasicNaviBarStyle( background, referenceWidth, height),
76 centralMaximum( centralMaximum ), centralMinimum( centralMinimum ),
77 centralButtonHeight( centralButtonHeight ), centralButtonGap( centralButtonGap ),
78 sideButtonSize( sideButtonSize ), hotizontalMargin( hotizontalMargin )
82 int centralMaximum; ///< the maximum width of central button
83 int centralMinimum; ///< the minimum width of central button
84 int centralButtonHeight; ///< the height of the central button
85 int centralButtonGap; ///< the gap width between central buttons
86 int sideButtonSize; ///< the size of side buttons in the left and right groups: sideButtonSize*sideButtonSize
87 int hotizontalMargin; ///< the horizontal margin width
91 * The title bar locates in the top of the frame where title, subtitle, title icon and other controls could be placed.
92 * NaviTitleBarStyle provides the title bar layout style,
93 * which customize the position and size of the components placed on it and the text style of the titles.
94 * The title bar contains two groups: the left group includes title icon, title and subtitle (subtitle and title icon are not must);
95 * while the right group can have multiple controls placed on, and it is also fine to have no control on it.
96 * +----------------------------------------+
97 * | +-+ Title +-+ +-+ |
98 * | +-+ Subtitle +-+ +-+ |
99 * +----------------------------------------+
101 struct NaviTitleBarStyle : BasicNaviBarStyle
106 NaviTitleBarStyle( Actor background,
107 TextStyle titleTextStyle,
108 TextStyle subtitleTextStyle,
111 int titleHeightWithoutSubtitle,
112 int titleHeightWithSubtitle,
115 int titleBottomMargin,
118 int buttonRightMargin,
119 int buttonBottomMargin,
120 int gapBetweenButtons )
121 : BasicNaviBarStyle( background, referenceWidth, height),
122 titleTextStyle( titleTextStyle ), subtitleTextStyle( subtitleTextStyle ),
123 titleHeightWithoutSubtitle( titleHeightWithoutSubtitle ),
124 titleHeightWithSubtitle( titleHeightWithSubtitle ), subtitleHeight( subtitleHeight ),
125 titleLeftMargin( titleLeftMargin ), titleBottomMargin( titleBottomMargin ),
126 titleIconSize( titleIconSize ), buttonSize( buttonSize ),
127 buttonRightMargin( buttonRightMargin ), buttonBottomMargin( buttonBottomMargin ),
128 gapBetweenButtons( gapBetweenButtons )
132 TextStyle titleTextStyle; ///< the text style of the tile text
133 TextStyle subtitleTextStyle; ///< the text style of the subtitle text
134 int titleHeightWithoutSubtitle; ///< the height of the title when no subtitle exists
135 int titleHeightWithSubtitle; ///< the height of the title when there is subtitle below
136 int subtitleHeight; ///< the height of the subtitle
137 int titleLeftMargin; ///< the Margin between title and the left edge of the bar
138 int titleBottomMargin; ///< the Margin between title and the bottom edge of the bar
139 int titleIconSize; ///< the size of the title icon: titleIconSize*titleIconSize
140 int buttonSize; ///< the size of the buttons in the right group: buttonSize*buttonSize
141 int buttonRightMargin; ///< the Margin between the button and the right edge of the bar
142 int buttonBottomMargin; ///< the Margin between the button and the bottom edge of the bar
143 int gapBetweenButtons; ///< the gap width between buttons
146 } // namespace Toolkit
150 #endif /* __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__ */