c35b57e7a0ee43c74eb0109673c083c7bdd2f376
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / navigation-frame / navigation-bar-style.h
1 #ifndef __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__
2 #define __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_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 namespace Dali DALI_IMPORT_API
22 {
23
24 namespace Toolkit
25 {
26
27   /**
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.
31    */
32   struct BasicNaviBarStyle
33   {
34     /**
35      * Constructor
36      */
37     BasicNaviBarStyle ( Actor background,
38                     int referenceWidth,
39                     int height )
40      : background( background ),
41        referenceWidth( referenceWidth ),
42        height( height )
43      {
44      }
45
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
49   };
50
51   /**
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    *               +----------------------------------------+
61    */
62   struct NaviToolBarStyle : BasicNaviBarStyle
63   {
64     /**
65      * Constructor
66      */
67     NaviToolBarStyle ( Actor background,
68                        int referenceWidth,
69                        int height,
70                        int centralMaximum,
71                        int centralMinimum,
72                        int centralButtonHeight,
73                        int centralButtonGap,
74                        int sideButtonSize,
75                        int hotizontalMargin )
76     : BasicNaviBarStyle( background, referenceWidth, height),
77       centralMaximum( centralMaximum ), centralMinimum( centralMinimum ),
78       centralButtonHeight( centralButtonHeight ), centralButtonGap( centralButtonGap ),
79       sideButtonSize( sideButtonSize ), hotizontalMargin( hotizontalMargin )
80     {
81     }
82
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
89   };
90
91   /**
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    *               +----------------------------------------+
101    */
102   struct NaviTitleBarStyle : BasicNaviBarStyle
103   {
104     /**
105      * Constructor
106      */
107     NaviTitleBarStyle( Actor background,
108                        TextStyle titleTextStyle,
109                        TextStyle subtitleTextStyle,
110                        int referenceWidth,
111                        int height,
112                        int titleHeightWithoutSubtitle,
113                        int titleHeightWithSubtitle,
114                        int subtitleHeight,
115                        int titleLeftMargin,
116                        int titleBottomMargin,
117                        int titleIconSize,
118                        int buttonSize,
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 )
130     {
131     }
132
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
145   };
146
147 } // namespace Toolkit
148 } // namespace Dali
149
150
151 #endif /* __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__ */