|
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 #if !defined(__EIKMENUB_H__) |
|
20 #define __EIKMENUB_H__ |
|
21 |
|
22 #if !defined(__EIKDEF_H__) |
|
23 #include <eikdef.h> |
|
24 #endif |
|
25 |
|
26 #if !defined(__EIKBCTRL_H__) |
|
27 #include <eikbctrl.h> |
|
28 #endif |
|
29 |
|
30 #if !defined(__EIKMENUP_H__) |
|
31 #include <eikmenup.h> |
|
32 #endif |
|
33 |
|
34 #include <eikbtgpc.h> |
|
35 #include <eikcmobs.h> |
|
36 #include <aknintermediate.h> |
|
37 |
|
38 class CEikHotKeyTable; |
|
39 class CEikMenuBarExtension; |
|
40 class CAknItemActionMenu; |
|
41 |
|
42 |
|
43 /** |
|
44 * The CEikMenuBarTitle class encapsulates the data needed to define a menu bar title and |
|
45 * provides some of the functionality required to display the title. |
|
46 * |
|
47 * @since ER5U |
|
48 */ |
|
49 class CEikMenuBarTitle : public CBase |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * Defines a menu bar. See also @c MEikMenuObserver::DynInitMenuPaneL(). |
|
54 * See also @c MENU_TITLE for details of the resource interface to menu |
|
55 * items. |
|
56 */ |
|
57 struct SData |
|
58 { |
|
59 enum { |
|
60 /** Nominal legth of the text. */ |
|
61 ENominalTextLength=40 |
|
62 }; |
|
63 /** |
|
64 * The resource ID from which the menu pane is constructed. |
|
65 */ |
|
66 TInt iMenuPaneResourceId; |
|
67 /** |
|
68 * The text to display on the menu pane. |
|
69 */ |
|
70 TBuf<ENominalTextLength> iText; // less than this actually stored |
|
71 }; |
|
72 public: |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 IMPORT_C CEikMenuBarTitle(); |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 IMPORT_C ~CEikMenuBarTitle(); |
|
81 /** |
|
82 * Sets the title icon. |
|
83 * |
|
84 * @param aIcon The icon to set. |
|
85 */ |
|
86 IMPORT_C void SetIcon(CGulIcon* aIcon); |
|
87 |
|
88 /** |
|
89 * Sets whether the bitmap and mask are owned externally or not. |
|
90 * |
|
91 * @param aOwnedExternally @c ETrue if bitmaps are set as externally owned. |
|
92 * @c EFalse if bitmaps are set as not being externally owned. |
|
93 */ |
|
94 IMPORT_C void SetBitmapsOwnedExternally(TBool aOwnedExternally); |
|
95 |
|
96 /** |
|
97 * Draws the title icon to the graphics context @c aGc, inside the rect @c |
|
98 * aRect with an offset from the left side of the rectangle of size @c |
|
99 * aLeftMargin. |
|
100 * |
|
101 * @param aGc Window graphic context. |
|
102 * @param aRect Rectangle area. |
|
103 * @param aLeftMargin Left margin. |
|
104 */ |
|
105 IMPORT_C void DrawIcon(CWindowGc& aGc, TRect aRect, TInt aLeftMargin) const; |
|
106 |
|
107 /** |
|
108 * Constructs a new icon for the title, taking ownership of the picture |
|
109 * bitmap and the mask bitmap unless they are externally owned. |
|
110 * |
|
111 * @param aBitmap Bitmap. |
|
112 * @param aMask Mask of the bitmap. |
|
113 */ |
|
114 IMPORT_C void CreateIconL(CFbsBitmap* aBitmap, CFbsBitmap* aMask); |
|
115 |
|
116 /** |
|
117 * Sets the bitmap for the icon. Transfers |
|
118 * ownership unless the bitmaps are owned externally. |
|
119 * |
|
120 * @param aBitmap Bitmap |
|
121 */ |
|
122 IMPORT_C void SetIconBitmapL(CFbsBitmap* aBitmap); |
|
123 |
|
124 /** |
|
125 * Sets the bitmap mask for the icon. Transfers ownership |
|
126 * unless the bitmaps are owned externally. |
|
127 * |
|
128 * @param aMask Mask of a bitmap. |
|
129 */ |
|
130 IMPORT_C void SetIconMaskL(CFbsBitmap* aMask); |
|
131 |
|
132 /** |
|
133 * Gets a pointer to the title icon’s bitmap. Does not imply transfer of |
|
134 * ownership. |
|
135 * |
|
136 * @return Pointer to the title icon’s bitmap. |
|
137 */ |
|
138 IMPORT_C CFbsBitmap* IconBitmap() const; |
|
139 |
|
140 /** |
|
141 * Gets a pointer to the title icon’s bitmap mask. Does not imply transfer |
|
142 * of ownership. |
|
143 * |
|
144 * @return Pointer to the title icon’s bitmap mask. |
|
145 */ |
|
146 IMPORT_C CFbsBitmap* IconMask() const; |
|
147 |
|
148 public: // other functions |
|
149 |
|
150 /** |
|
151 * Gets the value of the extra left margin for the title text which will |
|
152 * take into account the width of the title icon. |
|
153 * |
|
154 * @return Value of extra left margin. |
|
155 */ |
|
156 TInt ExtraLeftMargin() const; |
|
157 |
|
158 /** |
|
159 * Adjusts the value of the title text baseline offset @c aBaseLine to take |
|
160 * into account any size of the title icon. |
|
161 * |
|
162 * @param[in,out] aBaseLine Gets result of baseline. |
|
163 * @param[in,out] aTitleHeight Gets result of height. |
|
164 */ |
|
165 void CalculateBaseLine(TInt& aBaseLine, TInt& aTitleHeight); |
|
166 |
|
167 public: |
|
168 |
|
169 /** The title’s position on the menu bar. */ |
|
170 TInt iPos; |
|
171 |
|
172 /** The title’s width. */ |
|
173 TInt iWidth; |
|
174 |
|
175 /** The menu bar title text. */ |
|
176 SData iData; |
|
177 |
|
178 /** Flags used internally by the menu bar title. */ |
|
179 TInt iTitleFlags; |
|
180 |
|
181 private: |
|
182 CGulIcon* iIcon; |
|
183 }; |
|
184 |
|
185 /** |
|
186 * Menu bars are constructed from @c MENU_BAR resources and issue application |
|
187 * commands which should be handled by overriding @c |
|
188 * CEikAppUi::HandleCommandL(). |
|
189 */ |
|
190 class CEikMenuBar : public CEikBorderedControl, |
|
191 public MEikCommandObserver, |
|
192 public MAknIntermediateState |
|
193 { |
|
194 |
|
195 public: |
|
196 |
|
197 /** |
|
198 * Declares an object type for a class, in order to allow the object |
|
199 * provider mechanism to locate and provide objects from the class. |
|
200 */ |
|
201 DECLARE_TYPE_ID(0x101F4106) |
|
202 |
|
203 /** Specifies the menu item within the menu pane. */ |
|
204 struct SCursor |
|
205 { |
|
206 /** Index of a title in the menu bar. */ |
|
207 TInt iMenuPaneIndex; |
|
208 |
|
209 /** Index of an item in a menu pane. */ |
|
210 TInt iMenuItemIndex; |
|
211 }; |
|
212 |
|
213 /** */ |
|
214 struct SPosition |
|
215 { |
|
216 /** */ |
|
217 TInt iMenuId; |
|
218 |
|
219 /** */ |
|
220 SCursor iMenuCursorPos; |
|
221 }; |
|
222 |
|
223 enum TMenuType { |
|
224 /** |
|
225 * Options menu launched from the Options softkey. |
|
226 * This is the default value. |
|
227 */ |
|
228 EMenuOptions = 0, |
|
229 |
|
230 /** |
|
231 * Context sensitive menu that is launched from selection key |
|
232 * when the application supports it. |
|
233 */ |
|
234 EMenuContext = 1, |
|
235 |
|
236 /** |
|
237 * Edit menu containing editing specific items. |
|
238 */ |
|
239 EMenuEdit = 2, |
|
240 |
|
241 /** |
|
242 * Options menu launched from the Options softkey. Task swapper item |
|
243 * is not shown. |
|
244 */ |
|
245 EMenuOptionsNoTaskSwapper = 3 |
|
246 }; |
|
247 |
|
248 friend class CEikMenuPaneTitle; |
|
249 |
|
250 private: |
|
251 |
|
252 enum {ENothingSelected=-1}; |
|
253 |
|
254 public: |
|
255 |
|
256 /** |
|
257 * Destructor. |
|
258 */ |
|
259 IMPORT_C ~CEikMenuBar(); |
|
260 |
|
261 /** |
|
262 * C++ default constructor. |
|
263 */ |
|
264 IMPORT_C CEikMenuBar(); |
|
265 |
|
266 public: // framework |
|
267 |
|
268 /** |
|
269 * From @c CCoeControl |
|
270 * |
|
271 * Handles key events offered to the menu by the control environment and |
|
272 * provides an appropriate implementation of |
|
273 * @c CCoeControl::OfferKeyEventL(). |
|
274 * |
|
275 * @param aKeyEvent The key event. |
|
276 * @param aType The type of key event: @c EEventKey, @c EEventKeyUp or @c |
|
277 * EEventKeyDown. |
|
278 * |
|
279 * @return Indicates whether or not the key event was used by this control. |
|
280 */ |
|
281 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, |
|
282 TEventCode aType); |
|
283 |
|
284 /** |
|
285 * From @c CCoeControl |
|
286 * |
|
287 * Handles pointer events. This function gets called whenever a pointer |
|
288 * event occurs in the control, i.e. when the pointer is within the |
|
289 * control's extent, or when the control has grabbed the pointer. The |
|
290 * control should implement this function to handle pointer events. |
|
291 * |
|
292 * Note: events of type @c EButton1Down are processed before @c |
|
293 * HandlePointerEventL() is called, in order to transfer keyboard focus to |
|
294 * the control in which the @c EButton1Down event occurred. |
|
295 * |
|
296 * If overriding @c HandlePointerEventL(), the implementation must include |
|
297 * a base call to @c CCoeControl's @c HandlePointerEventL(). |
|
298 * |
|
299 * @param aPointerEvent The pointer event. |
|
300 */ |
|
301 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
302 |
|
303 /** |
|
304 * From @c CCoeControl |
|
305 * |
|
306 * Not implemented. |
|
307 * |
|
308 * @param Not used. |
|
309 */ |
|
310 IMPORT_C void Draw(const TRect& aRect) const; |
|
311 |
|
312 private: |
|
313 |
|
314 /** |
|
315 * From CAknControl |
|
316 */ |
|
317 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
318 |
|
319 private: // from MCoeInputObserver |
|
320 |
|
321 IMPORT_C TCoeInputCapabilities InputCapabilities() const; |
|
322 |
|
323 public: |
|
324 |
|
325 /** |
|
326 * This class enables construction, and destruction of an array of |
|
327 * information about menu bar titles. |
|
328 */ |
|
329 class CTitleArray : public CArrayPtrFlat<CEikMenuBarTitle> |
|
330 { |
|
331 |
|
332 public: |
|
333 |
|
334 /** |
|
335 * Destructor. |
|
336 */ |
|
337 IMPORT_C ~CTitleArray(); |
|
338 |
|
339 /** |
|
340 * C++ default constructor. |
|
341 */ |
|
342 IMPORT_C CTitleArray(); |
|
343 |
|
344 /** |
|
345 * Adds the menu bar title @c aMenuTitle to the end of the array owned |
|
346 * by the menu bar and transfers ownership. |
|
347 * |
|
348 * @param aMenuTitle Append object to flat array. |
|
349 */ |
|
350 IMPORT_C void AddTitleL(CEikMenuBarTitle* aMenuTitle); |
|
351 |
|
352 /** |
|
353 * Deletes selected index into array. |
|
354 * |
|
355 * @param aResource Array index that will be delete. |
|
356 */ |
|
357 void DeleteResource(TInt aResource); |
|
358 }; |
|
359 |
|
360 public: // new functions |
|
361 |
|
362 /** |
|
363 * Second phase constructor for a menu bar. |
|
364 * |
|
365 * @param aMenuObserver The menu's observer. |
|
366 * @param aHotKeyResourceId The ID of the resource, of type HOTKEY from |
|
367 * which the hotkey table is created. This is optional. By default |
|
368 * it's nil. |
|
369 * @param aMenuTitleResourceId The ID of the resource, of type @c MENU_BAR |
|
370 * from which the menu title array is created. This is optional. By |
|
371 * default it's nil. |
|
372 */ |
|
373 |
|
374 IMPORT_C void ConstructL(MEikMenuObserver* aMenuObserver, |
|
375 TInt aHotKeyResourceId=0, |
|
376 TInt aMenuTitleResourceId=0); |
|
377 |
|
378 /** |
|
379 * Second phase constructor for a menu bar which builds the menu bar from |
|
380 * the given resource file. |
|
381 * |
|
382 * @param aReader The resource reader. |
|
383 */ |
|
384 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); |
|
385 |
|
386 /** |
|
387 * Not implemented |
|
388 * |
|
389 * @param aHotKeyResourceId Not used. |
|
390 * @param aMenuTitleResourceId Not used. |
|
391 * @param aDisplayNow Not used. |
|
392 */ |
|
393 IMPORT_C void ChangeMenuBarL(TInt aHotKeyResourceId=0, |
|
394 TInt aMenuTitleResourceId=0, |
|
395 TInt aDisplayNow=ETrue); |
|
396 |
|
397 /** |
|
398 * Not implemented! |
|
399 * |
|
400 * @param aHotKeyTable Not used. |
|
401 * @return NULL. |
|
402 */ |
|
403 IMPORT_C CEikHotKeyTable* SetHotKeyTable(CEikHotKeyTable* aHotKeyTable); |
|
404 |
|
405 /** |
|
406 * Sets the menu’s resource ID. |
|
407 * |
|
408 * @param aMenuTitleResourceId The ID of the resource to use. |
|
409 */ |
|
410 IMPORT_C void SetMenuTitleResourceId(TInt aMenuTitleResourceId); |
|
411 |
|
412 /** |
|
413 * |
|
414 * |
|
415 * @param aMenuTitleResourceId |
|
416 */ |
|
417 IMPORT_C void SetContextMenuTitleResourceId(TInt aMenuTitleResourceId); |
|
418 |
|
419 /** |
|
420 * Not implemented. |
|
421 * |
|
422 * @param aTitleArray Not used. |
|
423 */ |
|
424 IMPORT_C void SetMenuTitleArray(CTitleArray* aTitleArray); |
|
425 |
|
426 /** |
|
427 * Not implemented. |
|
428 * |
|
429 * @param aOwnedExternally Not used. |
|
430 */ |
|
431 IMPORT_C void SetTitleArrayOwnedExternally(TBool aOwnedExternally); |
|
432 |
|
433 /** |
|
434 * Sets the cursor to the specifed menu pane and menu item. |
|
435 * |
|
436 * @param aCursor The menu pane and menu item to which the cursor is set. |
|
437 * @return A @c SCursor structure holding the menu item within the menu |
|
438 * pane. |
|
439 */ |
|
440 IMPORT_C SCursor SetMenuCursor(const SCursor& aCursor); |
|
441 |
|
442 /** |
|
443 * Stops displaying the menu bar. |
|
444 * |
|
445 * This function causes the menu bar to disappear from the screen until it |
|
446 * is invoked again by the user. In most circumstances this is done by the |
|
447 * @c Uikon framework, so an application program will not normally need to |
|
448 * use this function. |
|
449 */ |
|
450 IMPORT_C void StopDisplayingMenuBar(); |
|
451 |
|
452 /** |
|
453 * Displays the menu bar. |
|
454 * |
|
455 * If the menu is not already displayed, this function displays the menu |
|
456 * bar and allows the user to make a selection. In most circumstances this |
|
457 * is done by the @c Uikon framework, so an application program will not |
|
458 * normally need to use this function. |
|
459 */ |
|
460 IMPORT_C void TryDisplayMenuBarL(); |
|
461 IMPORT_C void TryDisplayContextMenuBarL(); |
|
462 /** |
|
463 * If the menu is not already displayed, this function displays the menu |
|
464 * bar without fep menu and allows the user to make a selection. In most |
|
465 * circumstances this is done by the @c Uikon framework, so an application |
|
466 * program will not normally need to use this function. |
|
467 */ |
|
468 IMPORT_C void TryDisplayMenuBarWithoutFepMenusL(); |
|
469 |
|
470 /** |
|
471 * Not implemented. |
|
472 * |
|
473 * @param aNewSelectedTitle Not used |
|
474 * @param aNewSelectedItem Not used. |
|
475 */ |
|
476 IMPORT_C void MoveHighlightToL(TInt aNewSelectedTitle, |
|
477 TInt aNewSelectedItem=0); |
|
478 |
|
479 /** |
|
480 * Not implemented. |
|
481 * |
|
482 * @param aItem Not used. |
|
483 */ |
|
484 IMPORT_C void DrawItem(TInt aItem) const; |
|
485 |
|
486 /** |
|
487 * Gets a pointer to the menu’s hot key table. |
|
488 */ |
|
489 CEikHotKeyTable* HotKeyTable() const { return(iHotKeyTable); } |
|
490 |
|
491 /** |
|
492 * Gets the index of the menu pane selected by the cursor. |
|
493 * |
|
494 * @return The index of the selected menu pane. |
|
495 */ |
|
496 IMPORT_C TInt SelectedTitle(); |
|
497 |
|
498 /** |
|
499 * Gets the index of the menu item selected by the cursor. |
|
500 * |
|
501 * @return The index of the selected menu item. |
|
502 */ |
|
503 IMPORT_C TInt SelectedItem(); |
|
504 |
|
505 /** |
|
506 * Searches for the menu item that corresponds to the specified command. |
|
507 * |
|
508 * @param aCommandId The ID to search for. |
|
509 * @param aPaneindex Menu pane index. |
|
510 * @param aItemindex Menu item index. |
|
511 */ |
|
512 IMPORT_C virtual void FindCommandIdInResourceL(TInt aCommandId, |
|
513 TInt& aPaneindex, |
|
514 TInt& aItemindex); |
|
515 |
|
516 /** |
|
517 * Gets a menu pane resource. |
|
518 * |
|
519 * @return The pointer to @c CEikMenuPane object containing a menu pane |
|
520 * resource. |
|
521 */ |
|
522 IMPORT_C CEikMenuPane* MenuPane(); |
|
523 |
|
524 /** |
|
525 * If the menu bar is visible, removes the menu bar height from the top of |
|
526 * @c aRect and returns the new rectangle in a new value of @c aRect. |
|
527 * |
|
528 * @param[in,out] aRect A rectangle that on return is reduced in height by |
|
529 * the height of the menu bar. |
|
530 */ |
|
531 IMPORT_C void ReduceRect(TRect& aRect) const; |
|
532 |
|
533 /** |
|
534 * Gets array of information about the menu bar titles. |
|
535 * |
|
536 * @return Pointer to @c CTitleArray object containing array of information |
|
537 * about menu bar titles. |
|
538 */ |
|
539 IMPORT_C CTitleArray* TitleArray(); |
|
540 |
|
541 /** |
|
542 * Sets menu observer interface. |
|
543 * |
|
544 * @param aEditMenuObserver Menu observer interface. |
|
545 */ |
|
546 IMPORT_C void SetEditMenuObserver(MEikMenuObserver* aEditMenuObserver); |
|
547 |
|
548 /** |
|
549 * Sets the menu observer interface to @c NULL. |
|
550 * |
|
551 * @param aEditMenuObserver Menu observer interface that will be set to @c |
|
552 * NULL. |
|
553 */ |
|
554 IMPORT_C void RemoveEditMenuObserver(MEikMenuObserver* aEditMenuObserver); |
|
555 |
|
556 /** |
|
557 * Allows the client to determine if the menubar instance is displayed. |
|
558 * |
|
559 * @return @c Etrue if displayed and @c EFalse if not. |
|
560 */ |
|
561 IMPORT_C TBool IsDisplayed(); |
|
562 |
|
563 /** |
|
564 * Sets type of the menu. Menu can be for example Options menu launched from |
|
565 * Options softkey or context sensitive menu launched from the selection key. |
|
566 * By default the launched menu is options menu. |
|
567 * @since S60 3.1 |
|
568 * @param aMenuType One of values of CEikMenuBar::TMenuType enumeration. |
|
569 */ |
|
570 IMPORT_C void SetMenuType(TMenuType aMenuType); |
|
571 |
|
572 /** |
|
573 * Gets type of the menu. |
|
574 * |
|
575 * @since S60 5.2 |
|
576 * @return the type defined in CEikMenuBar::TMenuType of menu. |
|
577 */ |
|
578 IMPORT_C CEikMenuBar::TMenuType GetMenuType() const; |
|
579 |
|
580 /** |
|
581 * Returns ETrue when item specific commands are enabled in menu |
|
582 * bar (main pane collection has a highlight) and EFalse when they are |
|
583 * disabled (main pane collection does not have a highlight). |
|
584 * |
|
585 * @since S60 5.2 |
|
586 * @return ETrue when item specific commands are enabled. |
|
587 */ |
|
588 IMPORT_C TBool ItemSpecificCommandsEnabled() const; |
|
589 |
|
590 /** |
|
591 * Sets item action menu instance to menu bar. |
|
592 * |
|
593 * @internal |
|
594 * @since S60 v5.2 |
|
595 * @param aItemActionMenu Pointer to item action menu. |
|
596 */ |
|
597 void SetItemActionMenu( CAknItemActionMenu* aItemActionMenu ); |
|
598 |
|
599 /** |
|
600 * Provides pointer to item action menu. |
|
601 * |
|
602 * @internal |
|
603 * @since S60 v5.2 |
|
604 * @return Pointer to item action menu. |
|
605 */ |
|
606 CAknItemActionMenu* ItemActionMenu() const; |
|
607 |
|
608 /** |
|
609 * Populates item action menu. |
|
610 * |
|
611 * @internal |
|
612 * @since S60 v5.2 |
|
613 * @param aItemActionMenu Reference to item action menu. |
|
614 * @return Created menu pane. Ownership transfers to caller. |
|
615 */ |
|
616 CEikMenuPane* PopulateItemActionMenuL( CAknItemActionMenu& aItemActionMenu ); |
|
617 |
|
618 private: // from MAknIntermediateState |
|
619 |
|
620 void CloseState(); |
|
621 |
|
622 public: // from CCoeControl |
|
623 |
|
624 /** |
|
625 * From @c CCoeControl. |
|
626 * |
|
627 * Gets the list of logical colours used to draw the control. |
|
628 * |
|
629 * The list includes an explanation of how each colour is used. By default, |
|
630 * this function has an empty implementation. |
|
631 * |
|
632 * @since 5.1 SDK. |
|
633 * @param aColorUseList The colour list. |
|
634 */ |
|
635 IMPORT_C virtual void GetColorUseListL( |
|
636 CArrayFix<TCoeColorUse>& aColorUseList) const; |
|
637 |
|
638 /** |
|
639 * From @c CCoeControl. |
|
640 * |
|
641 * Handles a change to the control's resources. |
|
642 * |
|
643 * The types of resources handled are those which are shared across the |
|
644 * environment, e.g. colours or fonts. |
|
645 * |
|
646 * @since 5.1 SDK. |
|
647 * @param aType A message UID value. The most common is @c |
|
648 * KEikMessageColorSchemeChange which controls get when the colour |
|
649 * scheme is changed. Other examples include: @c |
|
650 * KEikMessageFadeAllWindows, @c KEikMessageUnfadeWindows, @c |
|
651 * KEikMessageZoomChange, @c KEikMessageVirtualCursorStateChange, @c |
|
652 * KEikMessageCapsLock, @c KEikMessagePrepareForSave. |
|
653 */ |
|
654 IMPORT_C virtual void HandleResourceChange(TInt aType); |
|
655 |
|
656 private: // from CCoeControl |
|
657 IMPORT_C void Reserved_1(); |
|
658 IMPORT_C void Reserved_2(); |
|
659 // from MEikCommandObserver |
|
660 void ProcessCommandL(TInt aCommandId); |
|
661 private: // from MObjectProvider |
|
662 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
663 private: |
|
664 void StartDisplayingMenuBarL(); |
|
665 void HideMenuPane(); |
|
666 void SaveCurrentMenuPositionL(); |
|
667 void SetCursorPositionFromArray(); |
|
668 TBool MenuHasItems() const; |
|
669 void SetMenuHasItems(); |
|
670 TBool MenuHasPane() const; |
|
671 void SetMenuHasPane(); |
|
672 TBool TitleArrayOwnedExternally() const; |
|
673 void ResetTitleArray(); |
|
674 void CreateTitleArrayL(); |
|
675 void SetMenuPaneFlag(TInt aFlag); |
|
676 void AddFEPMenuL(); |
|
677 void AddMenuIfNotPresentL(TInt aResourceId); |
|
678 void UpdateTitleTextBaseline(); |
|
679 private: |
|
680 enum TEikMenuFlags {ETitleArrayOwnedExternally=0x01,EMenuHasItems=0x02,EMenuHasPane=0x04,EBackgroundFaded=0x08, ESoundsInstalled=0x10}; |
|
681 CEikButtonGroupContainer* iMenuCba; |
|
682 MEikMenuObserver* iMenuObserver; |
|
683 MEikMenuObserver* iEditMenuObserver; |
|
684 MEikMenuObserver* iActiveEditMenuObserver; |
|
685 CEikMenuPane* iMenuPane; |
|
686 CEikHotKeyTable* iHotKeyTable; |
|
687 SCursor iCursor; |
|
688 TInt iMenuTitleResourceId; |
|
689 TInt iMenuPaneResourceId; |
|
690 TInt iMenuHotKeyResourceId; |
|
691 TInt iSelectedTitle; |
|
692 TInt iBaseLine; |
|
693 TInt iMenuTitleLeftSpace; |
|
694 TInt iMenuFlags; |
|
695 CTitleArray* iTitleArray; |
|
696 CArrayFixFlat<SPosition>* iPastMenuPosArray; |
|
697 TBool iPreventFepMenu; |
|
698 friend class CEikMenuBarExtension; |
|
699 CEikMenuBarExtension* iExt; |
|
700 }; |
|
701 |
|
702 /** |
|
703 * This class is not intended to be used by application programmers. |
|
704 */ |
|
705 class CEikMenuPaneTitle : public CEikBorderedControl |
|
706 { |
|
707 |
|
708 public: |
|
709 |
|
710 /** |
|
711 * Default C++ constructor |
|
712 */ |
|
713 IMPORT_C CEikMenuPaneTitle(CEikMenuBar* aMenuBar); |
|
714 |
|
715 /** |
|
716 * Second phase constructor for a menu bar. By default Symbian 2nd phase |
|
717 * constructor is private. |
|
718 */ |
|
719 IMPORT_C void ConstructL(); |
|
720 |
|
721 /** |
|
722 * Not implemented |
|
723 * |
|
724 * @param aSelectedTitle Not used. |
|
725 */ |
|
726 IMPORT_C void SetSelectedTitle(TInt aSelectedTitle); |
|
727 |
|
728 /** |
|
729 * Not implemented |
|
730 * |
|
731 * @param aRect Not used. |
|
732 */ |
|
733 IMPORT_C void Draw(const TRect& aRect) const; |
|
734 |
|
735 /** |
|
736 * Gets the menu pane title’s margins. |
|
737 * |
|
738 * @return The menu pane title’s margins. |
|
739 */ |
|
740 IMPORT_C TMargins Margins() const; |
|
741 |
|
742 /** |
|
743 * Not implemented |
|
744 */ |
|
745 IMPORT_C void Close(); |
|
746 |
|
747 public:// framework |
|
748 |
|
749 /** |
|
750 * Not implemented. |
|
751 * |
|
752 * @param aPointerEvent Not used. |
|
753 */ |
|
754 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
755 |
|
756 /** |
|
757 * From @c CCoeControl. |
|
758 * |
|
759 * Gets the list of logical colours used to draw the control. |
|
760 * |
|
761 * The list includes an explanation of how each colour is used. By default, |
|
762 * this function has an empty implementation. |
|
763 * |
|
764 * Since 5.1 SDK. |
|
765 * |
|
766 * @param aColorUseList The colour list. |
|
767 */ |
|
768 IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u |
|
769 |
|
770 /** |
|
771 * Not implemented |
|
772 * |
|
773 * @param aType Not used. |
|
774 */ |
|
775 IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u |
|
776 |
|
777 private: |
|
778 /** |
|
779 * From CAknControl |
|
780 */ |
|
781 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
782 private: |
|
783 CEikMenuBar* const iMenuBar; |
|
784 TInt iSelectedTitle; |
|
785 }; |
|
786 |
|
787 #endif |