1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
26 class CEikHotKeyTable;
29 /** Menu observer interface.
31 Menu observers cooperate with menu bars and menu panes, initialising them
32 before display and responding to menu events appropriately. CEikAppUi implements
33 MEikMenuObserver, so these functions may be implemented on an application's
38 class MEikMenuObserver : public MEikCommandObserver
50 IMPORT_C virtual void HandleAttemptDimmedSelectionL(TInt aCommandId);
51 IMPORT_C virtual TBool CheckHotKeyNotDimmedL(TInt aCommandId);
52 IMPORT_C virtual void RestoreMenuL(CCoeControl* aMenuControl,TInt aResourceId,TMenuType aType);
53 IMPORT_C virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
54 IMPORT_C virtual void DynInitMenuBarL(TInt aResourceId,CEikMenuBar* aMenuBar);
55 IMPORT_C virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos,TInt aModifiers,const CEikHotKeyTable* aTable);
56 IMPORT_C virtual void OfferKeyToAppL(const TKeyEvent& aKeyEvent,TEventCode aType);
57 /** Called by the Uikon framework to handle the emphasising or de-emphasising of
60 CEikMenuBar objects call this on their observer to emphasise
61 themselves when they are displayed, and de-emphasise themselves when they
64 @param aMenuControl The menu control.
65 @param aEmphasis ETrue to emphasize the menu, EFalse otherwise. */
66 virtual void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis)=0;
68 IMPORT_C virtual CCoeControl* CreateCustomCommandControlL(TInt aControlType);
70 IMPORT_C MEikMenuObserver();
72 IMPORT_C virtual void Reserved_1_MenuObserver();
73 IMPORT_C virtual void Reserved_2_MenuObserver();
74 private: // from MEikCommandObserver. do not override!
75 IMPORT_C void MEikCommandObserver_Reserved1();
76 IMPORT_C void MEikCommandObserver_Reserved2();
78 TInt iMEikMenuObserver_Spare1;
82 /** Provides additional functionality to an auto menu title, in the form of an
83 OfferHotKeyL() method, which is not required in the normal MEikMenuObserver.
85 Auto menu titles are used to ensure that some menu panes appear in every menu
86 constructed for an application.
90 class MEikAutoMenuObserver : public MEikMenuObserver
93 /** Offers the specified hot key to the auto menu title.
95 Implement this function if you expect to handle any events from an auto menu.
97 @param aKeyEvent The key event.
98 @param aType The type of key event.
99 @return The auto menu title's response. */
100 virtual TKeyResponse OfferHotKeyL(const TKeyEvent& aKeyEvent,TEventCode aType)=0;
101 public: // from MEikMenuObserver
102 IMPORT_C void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
104 IMPORT_C virtual void HandleAttemptDimmedSelectionL(TInt aCommandId);
105 IMPORT_C virtual TBool CheckHotKeyNotDimmedL(TInt aCommandId);
106 IMPORT_C virtual void RestoreMenuL(CCoeControl* aMenuControl,TInt aResourceId,TMenuType aType);
107 IMPORT_C virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
108 IMPORT_C virtual void DynInitMenuBarL(TInt aResourceId,CEikMenuBar* aMenuBar);
109 IMPORT_C virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos,TInt aModifiers,const CEikHotKeyTable* aTable);
110 IMPORT_C virtual void OfferKeyToAppL(const TKeyEvent& aKeyEvent,TEventCode aType);
111 IMPORT_C virtual CCoeControl* CreateCustomCommandControlL(TInt aControlType);
113 IMPORT_C MEikAutoMenuObserver();
115 IMPORT_C virtual void Reserved_1_MenuObserver();
116 IMPORT_C virtual void Reserved_2_MenuObserver();
117 private: // from MEikCommandObserver. do not override!
118 IMPORT_C void MEikCommandObserver_Reserved1();
119 IMPORT_C void MEikCommandObserver_Reserved2();
121 TInt iMEikAutoMenuObserver_Spare1;
125 #endif // __EIKMOBS_H__