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 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.
28 * The basic information of a navigation bar style: background and size.
29 * All the style metrics for tool bar and title bar are in pixels referring to a bar width of 'referenceWidth'.
30 * To fit the bars into different window size, the NavigationControl scales the bar by the ratio of windowWidth and referenceWidth.
32 struct BasicNaviBarStyle
37 BasicNaviBarStyle ( Actor background,
40 : background( background ),
41 referenceWidth( referenceWidth ),
46 Actor background; ///< bar background
47 int referenceWidth; ///< the width of the bar, this value also used to calculate the scale to fit the bar into windows of different sizes
48 int height; ///< the height of the bar
52 * The tool bar locates in the bottom of the frame where other controls (such as PushButton ) could be placed.
53 * NaviToolBarStyle provides the tool bar layout style, which customize the position and size of the controls placed on it.
54 * Controls could be added into three groups: HorizontalLeft, HorizontalCenter or HorizontalRight.
55 * The left and right groups can only have one control maximum each, while the central group can have multiple controls.
56 * It is fine to have no control in every group.
57 * +----------------------------------------+
58 * | +-+ +-----+ +-----+ +-+ |
59 * | +-+ +-----+ +-----+ +-+ |
60 * +----------------------------------------+
62 struct NaviToolBarStyle : BasicNaviBarStyle
67 NaviToolBarStyle ( Actor background,
72 int centralButtonHeight,
75 int hotizontalMargin )
76 : BasicNaviBarStyle( background, referenceWidth, height),
77 centralMaximum( centralMaximum ), centralMinimum( centralMinimum ),
78 centralButtonHeight( centralButtonHeight ), centralButtonGap( centralButtonGap ),
79 sideButtonSize( sideButtonSize ), hotizontalMargin( hotizontalMargin )
83 int centralMaximum; ///< the maximum width of central button
84 int centralMinimum; ///< the minimum width of central button
85 int centralButtonHeight; ///< the height of the central button
86 int centralButtonGap; ///< the gap width between central buttons
87 int sideButtonSize; ///< the size of side buttons in the left and right groups: sideButtonSize*sideButtonSize
88 int hotizontalMargin; ///< the horizontal margin width
92 * The title bar locates in the top of the frame where title, subtitle, title icon and other controls could be placed.
93 * NaviTitleBarStyle provides the title bar layout style,
94 * which customize the position and size of the components placed on it and the text style of the titles.
95 * The title bar contains two groups: the left group includes title icon, title and subtitle (subtitle and title icon are not must);
96 * while the right group can have multiple controls placed on, and it is also fine to have no control on it.
97 * +----------------------------------------+
98 * | +-+ Title +-+ +-+ |
99 * | +-+ Subtitle +-+ +-+ |
100 * +----------------------------------------+
102 struct NaviTitleBarStyle : BasicNaviBarStyle
107 NaviTitleBarStyle( Actor background,
108 TextStyle titleTextStyle,
109 TextStyle subtitleTextStyle,
112 int titleHeightWithoutSubtitle,
113 int titleHeightWithSubtitle,
116 int titleBottomMargin,
119 int buttonRightMargin,
120 int buttonBottomMargin,
121 int gapBetweenButtons )
122 : BasicNaviBarStyle( background, referenceWidth, height),
123 titleTextStyle( titleTextStyle ), subtitleTextStyle( subtitleTextStyle ),
124 titleHeightWithoutSubtitle( titleHeightWithoutSubtitle ),
125 titleHeightWithSubtitle( titleHeightWithSubtitle ), subtitleHeight( subtitleHeight ),
126 titleLeftMargin( titleLeftMargin ), titleBottomMargin( titleBottomMargin ),
127 titleIconSize( titleIconSize ), buttonSize( buttonSize ),
128 buttonRightMargin( buttonRightMargin ), buttonBottomMargin( buttonBottomMargin ),
129 gapBetweenButtons( gapBetweenButtons )
133 TextStyle titleTextStyle; ///< the text style of the tile text
134 TextStyle subtitleTextStyle; ///< the text style of the subtitle text
135 int titleHeightWithoutSubtitle; ///< the height of the title when no subtitle exists
136 int titleHeightWithSubtitle; ///< the height of the title when there is subtitle below
137 int subtitleHeight; ///< the height of the subtitle
138 int titleLeftMargin; ///< the Margin between title and the left edge of the bar
139 int titleBottomMargin; ///< the Margin between title and the bottom edge of the bar
140 int titleIconSize; ///< the size of the title icon: titleIconSize*titleIconSize
141 int buttonSize; ///< the size of the buttons in the right group: buttonSize*buttonSize
142 int buttonRightMargin; ///< the Margin between the button and the right edge of the bar
143 int buttonBottomMargin; ///< the Margin between the button and the bottom edge of the bar
144 int gapBetweenButtons; ///< the gap width between buttons
147 } // namespace Toolkit
151 #endif /* __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__ */