|
1 /* |
|
2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LAFMENUB_H__ |
|
20 #define __LAFMENUB_H__ |
|
21 |
|
22 #include <uiklaf/private/lafenv.h> |
|
23 #include <lafmain.h> |
|
24 #include <lafpublc.h> |
|
25 #include "lafmenup.h" |
|
26 #include <e32std.h> |
|
27 #include <gulbordr.h> |
|
28 #include <coecntrl.h> |
|
29 |
|
30 /** |
|
31 * @internal |
|
32 * Do not use |
|
33 */ |
|
34 class LafMenuBar |
|
35 { |
|
36 public: |
|
37 enum TAnchor |
|
38 { |
|
39 ERelativeToScreen, |
|
40 ERelativeToApplication |
|
41 }; |
|
42 enum TWidth |
|
43 { |
|
44 EMinPossible, |
|
45 EScreenWidth, |
|
46 EAppWidth, |
|
47 EClientWidth |
|
48 }; |
|
49 public: |
|
50 class TTitleAttributes |
|
51 { |
|
52 public: |
|
53 IMPORT_C TTitleAttributes(); |
|
54 public: |
|
55 TInt iBaseLine; |
|
56 TInt iFlags; |
|
57 }; |
|
58 public: |
|
59 IMPORT_C static TBool FadeBehind(); |
|
60 IMPORT_C static TBool IsAlwaysVisible(); |
|
61 IMPORT_C static void GetDefaultBorder(TGulBorder& aBorder); |
|
62 IMPORT_C static void GetBorderColors(TGulBorder::TColors& aBorderColors,const MLafEnv& aLafEnv,const CCoeControl& aMatchedControl); |
|
63 IMPORT_C static TWidth DefaultSpan(); |
|
64 IMPORT_C static TBool ShowHotKeys(); |
|
65 IMPORT_C static void TopLeftCornerPosition(TPoint & aPosition,TAnchor& aMenuAnchor); |
|
66 IMPORT_C static TInt InputCapabilities(); |
|
67 IMPORT_C static void DrawBetweenRects(const MLafEnv& aLafEnv, const CCoeControl& aMenuBar, CWindowGc& aGc, const TRect& aInnerRect, const TRect& aClientRect); |
|
68 IMPORT_C static void DrawText(const MLafEnv& aLafEnv, const CCoeControl& aMenuBar, CWindowGc& aGc, const TRect& aRect, const TDesC& aText, const TTitleAttributes& aTitleAttributes); |
|
69 IMPORT_C static void PrepareGcForDrawingTitle(const MLafEnv& aLafEnv, const CCoeControl& aMenuBar, CWindowGc& aGc); |
|
70 IMPORT_C static void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList); |
|
71 IMPORT_C static TUint MapKeyCode(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
72 public: |
|
73 // Constants |
|
74 inline static TInt DefaultMenuPaneIndex(); |
|
75 inline static TInt ExtraBaselineOffsetForFirstPaneItem(); |
|
76 inline static TInt HorizontalBorder(); |
|
77 inline static TInt VerticalBorder(); |
|
78 inline static TInt MnemonicPad(); |
|
79 inline static TInt MenuPaneOverlap(); |
|
80 inline static TInt MenuTitleLeftSpace(); |
|
81 inline static TInt MenuTitleRightSpace(); |
|
82 inline static TInt MenuTitleLeftSmallSpace(); |
|
83 inline static TInt MenuTitleRightSmallSpace(); |
|
84 inline static TInt NumOfSideButtons(); |
|
85 inline static TInt ShadowHeight(); |
|
86 inline static TInt SidebarPopupXPos(); |
|
87 inline static TInt SpaceBetweenMenuPaneTitleAndMenuBar(); |
|
88 // |
|
89 inline static const CFont* NormalFont(const MLafEnv& aLafEnv); |
|
90 private: |
|
91 enum TFontType |
|
92 { |
|
93 EAnnotation, |
|
94 ENormal, |
|
95 ESymbol |
|
96 }; |
|
97 enum TConstantType |
|
98 { |
|
99 EDefaultMenuPaneIndex, |
|
100 EExtraBaselineOffsetForFirstPaneItem, |
|
101 EHorizontalBorder, |
|
102 EVerticalBorder, |
|
103 EMnemonicPad, |
|
104 EMenuPaneOverlap, |
|
105 EMenuTitleLeftSpace, |
|
106 EMenuTitleRightSpace, |
|
107 EMenuTitleLeftSmallSpace, |
|
108 EMenuTitleRightSmallSpace, |
|
109 ENumOfSideButtons, |
|
110 EShadowHeight, |
|
111 ESidebarPopupXPos, |
|
112 ESpaceBetweenMenuPaneTitleAndMenuBar |
|
113 }; |
|
114 private: |
|
115 IMPORT_C static const CFont* Font(const MLafEnv& aLafEnv, TFontType aFontType); |
|
116 IMPORT_C static TInt Constant(TConstantType aConstant); |
|
117 }; |
|
118 |
|
119 |
|
120 // |
|
121 // class LafMenuPaneTitle |
|
122 // |
|
123 |
|
124 /** |
|
125 * @internal |
|
126 * Do not use |
|
127 */ |
|
128 class LafMenuPaneTitle |
|
129 { |
|
130 public: |
|
131 IMPORT_C static void GetDefaultBorder(TGulBorder& aBorder); |
|
132 IMPORT_C static void GetBorderColors(TGulBorder::TColors& aBorderColors,const MLafEnv& aLafEnv,const CCoeControl& aMatchedControl); |
|
133 IMPORT_C static void DrawTitlePaneJoint(const MLafEnv& aLafEnv, const CCoeControl& aMenuPaneTitle, CWindowGc& aGc, const TRect& aInnerRect); |
|
134 IMPORT_C static void DrawText(const MLafEnv& aLafEnv, const CCoeControl& aMenuPaneTitle, CWindowGc& aGc, const TRect& aRect, const TDesC& aText, LafMenuBar::TTitleAttributes aMenuBarAttributes); |
|
135 IMPORT_C static void PrepareGcForDrawingTitle(const MLafEnv& aLafEnv, const CCoeControl& aMenuPaneTitle, CWindowGc& aGc); |
|
136 IMPORT_C static void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList); |
|
137 public: |
|
138 // Constants |
|
139 inline static TInt ShadowHeight(); |
|
140 inline static TInt TitleLeftSpace(); |
|
141 inline static TInt TitleRightSpace(); |
|
142 inline static TInt TitleSmallLeftSpace(); |
|
143 inline static TInt TitleSmallRightSpace(); |
|
144 private: |
|
145 enum TConstantType |
|
146 { |
|
147 EShadowHeight, |
|
148 ETitleLeftSpace, |
|
149 ETitleRightSpace, |
|
150 ETitleSmallLeftSpace, |
|
151 ETitleSmallRightSpace |
|
152 }; |
|
153 private: |
|
154 IMPORT_C static TInt Constant(TConstantType aConstant); |
|
155 }; |
|
156 |
|
157 // |
|
158 // class LafMenuBarTitle |
|
159 // |
|
160 |
|
161 /** |
|
162 * @internal |
|
163 * Do not use |
|
164 */ |
|
165 class LafMenuBarTitle |
|
166 { |
|
167 public: |
|
168 IMPORT_C static void DrawIcon(CWindowGc& aGc, const TRect& aRect, const CGulIcon& aIcon); |
|
169 }; |
|
170 |
|
171 |
|
172 // Inlines |
|
173 inline TInt LafMenuBar::HorizontalBorder() |
|
174 {//static |
|
175 return Constant(EHorizontalBorder); |
|
176 }; |
|
177 |
|
178 inline TInt LafMenuBar::VerticalBorder() |
|
179 {//static |
|
180 return Constant(EVerticalBorder); |
|
181 } |
|
182 |
|
183 inline TInt LafMenuBar::MnemonicPad() |
|
184 {//static |
|
185 return Constant(EMnemonicPad); |
|
186 } |
|
187 |
|
188 inline TInt LafMenuBar::NumOfSideButtons() |
|
189 {//static |
|
190 return Constant(ENumOfSideButtons); |
|
191 } |
|
192 |
|
193 inline TInt LafMenuBar::SidebarPopupXPos() |
|
194 {//static |
|
195 return Constant(ESidebarPopupXPos); |
|
196 } |
|
197 |
|
198 inline TInt LafMenuBar::MenuPaneOverlap() |
|
199 {//static |
|
200 return Constant(EMenuPaneOverlap); |
|
201 } |
|
202 |
|
203 inline TInt LafMenuBar::MenuTitleLeftSpace() |
|
204 {//static |
|
205 return Constant(EMenuTitleLeftSpace); |
|
206 } |
|
207 |
|
208 inline TInt LafMenuBar::MenuTitleRightSpace() |
|
209 {//static |
|
210 return Constant(EMenuTitleRightSpace); |
|
211 } |
|
212 |
|
213 inline TInt LafMenuBar::MenuTitleLeftSmallSpace() |
|
214 {//static |
|
215 return Constant(EMenuTitleLeftSmallSpace); |
|
216 } |
|
217 |
|
218 inline TInt LafMenuBar::MenuTitleRightSmallSpace() |
|
219 {//static |
|
220 return Constant(EMenuTitleRightSmallSpace); |
|
221 } |
|
222 |
|
223 inline TInt LafMenuBar::ExtraBaselineOffsetForFirstPaneItem() |
|
224 {//static |
|
225 return Constant(EExtraBaselineOffsetForFirstPaneItem); |
|
226 } |
|
227 |
|
228 /** |
|
229 * Sets the first menu pane to be displayed. Defaults to 0. |
|
230 * Can only be set as an offset from 0 so setting "the last pane" isn't possible |
|
231 */ |
|
232 inline TInt LafMenuBar::DefaultMenuPaneIndex() |
|
233 { // static |
|
234 return Constant(EDefaultMenuPaneIndex); |
|
235 } |
|
236 |
|
237 /** |
|
238 * Returns the shadow height for the menu bar. |
|
239 */ |
|
240 inline TInt LafMenuBar::ShadowHeight() |
|
241 {//static |
|
242 return Constant(EShadowHeight); |
|
243 } |
|
244 |
|
245 /** |
|
246 * Returns the space between the menu bar and the relative menu pane title. |
|
247 */ |
|
248 inline TInt LafMenuBar::SpaceBetweenMenuPaneTitleAndMenuBar() |
|
249 {//static |
|
250 return Constant(ESpaceBetweenMenuPaneTitleAndMenuBar); |
|
251 } |
|
252 |
|
253 /** |
|
254 * Returns the menu bar normal font. |
|
255 */ |
|
256 inline const CFont* LafMenuBar::NormalFont(const MLafEnv& aLafEnv) |
|
257 { // static |
|
258 return Font(aLafEnv, ENormal); |
|
259 } |
|
260 |
|
261 /** |
|
262 * Returns the shadow height for the menu pane title. |
|
263 */ |
|
264 inline TInt LafMenuPaneTitle::ShadowHeight() |
|
265 {//static |
|
266 return Constant(EShadowHeight); |
|
267 } |
|
268 |
|
269 /** |
|
270 * Returns the left space between the border and the text. |
|
271 */ |
|
272 inline TInt LafMenuPaneTitle::TitleLeftSpace() |
|
273 {//static |
|
274 return Constant(ETitleLeftSpace); |
|
275 } |
|
276 |
|
277 /** |
|
278 * Returns the right space between the border and the text. |
|
279 */ |
|
280 inline TInt LafMenuPaneTitle::TitleRightSpace() |
|
281 {//static |
|
282 return Constant(ETitleRightSpace); |
|
283 } |
|
284 |
|
285 /** |
|
286 * Returns the small left space between the border and the text. This is used instead of TitleLeftSpace |
|
287 * when the menu bar size is to big. |
|
288 */ |
|
289 inline TInt LafMenuPaneTitle::TitleSmallLeftSpace() |
|
290 {//static |
|
291 return Constant(ETitleSmallLeftSpace); |
|
292 } |
|
293 |
|
294 /** |
|
295 * Returns the small right space between the border and the text. This is used instead of TitleRightSpace |
|
296 * when the menu bar size is to big. |
|
297 */ |
|
298 inline TInt LafMenuPaneTitle::TitleSmallRightSpace() |
|
299 {//static |
|
300 return Constant(ETitleSmallRightSpace); |
|
301 } |
|
302 |
|
303 #endif //__LAFMENUB_H__ |