epoc32/include/eikmobs.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __EIKMOBS_H__
    17 #define __EIKMOBS_H__
    18 
    19 #include <eikcmobs.h>
    20 #include <w32std.h>
    21 #include <coedef.h>
    22 
    23 class CCoeControl;
    24 class CEikMenuPane;
    25 class CEikMenuBar;
    26 class CEikHotKeyTable;
    27 class TPoint;
    28 
    29 /** Menu observer interface.
    30 
    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 
    34 App UI.
    35 
    36 @publishedAll
    37 @released */
    38 class MEikMenuObserver : public MEikCommandObserver
    39 	{
    40 public:
    41 	/** Menu types */
    42 	enum TMenuType
    43 		{
    44 		/** Menu pane. */
    45 		EMenuPane,
    46 		/** Menu bar. */
    47 		EMenuBar
    48 		};
    49 public:
    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 
    58 	a menu window. 
    59 	
    60 	CEikMenuBar objects call this on their observer to emphasise 
    61 	themselves when they are displayed, and de-emphasise themselves when they 
    62 	stop displaying.
    63 	
    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;
    67 public:
    68 	IMPORT_C virtual CCoeControl* CreateCustomCommandControlL(TInt aControlType);
    69 protected:
    70 	IMPORT_C MEikMenuObserver();
    71 private:
    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();
    77 private:
    78 	TInt iMEikMenuObserver_Spare1;
    79 	};
    80 
    81 
    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.
    84  
    85 Auto menu titles are used to ensure that some menu panes appear in every menu 
    86 constructed for an application. 
    87 
    88 @publishedAll 
    89 @released */
    90 class MEikAutoMenuObserver : public MEikMenuObserver
    91 	{
    92 public:
    93 	/** Offers the specified hot key to the auto menu title.
    94 	
    95 	Implement this function if you expect to handle any events from an auto menu. 
    96 	
    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);
   103 public: 
   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);
   112 protected:
   113 	IMPORT_C MEikAutoMenuObserver();
   114 private:
   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();
   120 private:
   121 	TInt iMEikAutoMenuObserver_Spare1;
   122 	};
   123 
   124 
   125 #endif	// __EIKMOBS_H__