|
1 /* |
|
2 * Copyright (c) 2007 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 * Avkon implementation of the FEP's Menu component |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 #ifndef AKNFEPUIAVKONMENUS_H |
|
30 #define AKNFEPUIAVKONMENUS_H |
|
31 |
|
32 #include "aknfepuimenus.h" |
|
33 #include <eikmobs.h> |
|
34 |
|
35 class CEikMenuPane; |
|
36 class CEikMenuBar; |
|
37 |
|
38 |
|
39 class CAknFepUIAvkonMenuPaneImpl : public CAknFepUiInterfaceMenuPane |
|
40 { |
|
41 public: |
|
42 CAknFepUIAvkonMenuPaneImpl(); |
|
43 void ConstructMenuSctRowFromDialogL( TInt aCharCase, TDes& aSpecialChars, TInt aResourceId ); |
|
44 void ConstructMenuSctRowL( TDes& aSpecialChars, TInt aResourceId ); |
|
45 void DeleteMenuItem(TInt aCommandId); |
|
46 void InsertMenuItemL(const SItemData& aMenuItem, TInt aPosition); |
|
47 TBool MenuItemExists(TInt aCommandId, TInt& aPosition); |
|
48 TInt NumberOfItemsInPane() const; |
|
49 void SetItemDimmed(TInt aCommandId, TBool aDimmed); |
|
50 void SetMenuPane(CEikMenuPane* aMenuPane); |
|
51 CEikMenuPane* GetMenuPane(); |
|
52 public: |
|
53 CEikMenuPane* iMenuPane; // not owned |
|
54 }; |
|
55 |
|
56 |
|
57 class CAknFepUIAvkonMenuBarImpl : public CAknFepUiInterfaceMenuBar |
|
58 { |
|
59 private: |
|
60 NONSHARABLE_CLASS(TEditMenuObserver) : public MEikMenuObserver |
|
61 { |
|
62 public: // from MEikMenuObserver |
|
63 void ProcessCommandL(TInt aCommandId); |
|
64 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
65 void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); |
|
66 public: |
|
67 MAknFepUiInterfaceMenuObserver* iObserver; |
|
68 CAknFepUIAvkonMenuPaneImpl iTempPane; |
|
69 }; |
|
70 public: |
|
71 CAknFepUIAvkonMenuBarImpl(); |
|
72 CAknFepUiInterfaceMenuPane* MenuPane(); |
|
73 void SetMenuType(TMenuType aMenuType); |
|
74 void StopDisplayingMenuBar(); |
|
75 void ReplaceAllMenuPanes(TInt aResourceId); |
|
76 void TryDisplayMenuBarL(); |
|
77 void SetFocus(TBool aFocus); |
|
78 void RemoveFromStack(); |
|
79 TInt FirstMenuPaneResourceId(); |
|
80 TBool IsDisplayed(); |
|
81 void AddToStackL(TInt aPriority,TInt aStackingFlags); |
|
82 void TryDisplayMenuBarWithoutFepMenusL(); |
|
83 void SetMenuTitleResourceId(TInt aResourceId); |
|
84 void SetEditMenuObserver(MAknFepUiInterfaceMenuObserver* aEditMenuObserver); |
|
85 void RemoveEditMenuObserver(MAknFepUiInterfaceMenuObserver* aEditMenuObserver); |
|
86 |
|
87 public: |
|
88 CEikMenuBar* iMenuBar; // not owned |
|
89 CAknFepUIAvkonMenuPaneImpl iTempMenuPane; |
|
90 TEditMenuObserver iEditMenuObserver; |
|
91 }; |
|
92 |
|
93 |
|
94 class CAknFepUIAvkonMenuBarOwningImpl : public CAknFepUIAvkonMenuBarImpl, public MEikMenuObserver |
|
95 { |
|
96 public: |
|
97 ~CAknFepUIAvkonMenuBarOwningImpl(); |
|
98 void ConstructL(MAknFepUiInterfaceMenuObserver* aObserver, TInt aHotKeyResourceId, TInt aMenuTitleResourceId); |
|
99 |
|
100 private: // from MEikMenuObserver |
|
101 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
102 void DynInitMenuBarL(TInt aResourceId,CEikMenuBar* aMenuBar); |
|
103 void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); |
|
104 |
|
105 private: // from MEikCommandObserver |
|
106 void ProcessCommandL(TInt aCommandId); |
|
107 |
|
108 private: |
|
109 // owns CAknFepUIAvkonMenuBarImpl::iMenuBar |
|
110 MAknFepUiInterfaceMenuObserver* iObserver; |
|
111 }; |
|
112 |
|
113 |
|
114 #endif |