epoc32/include/mw/eikmobs.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __EIKMOBS_H__
williamr@2
    17
#define __EIKMOBS_H__
williamr@2
    18
williamr@2
    19
#include <eikcmobs.h>
williamr@2
    20
#include <w32std.h>
williamr@2
    21
#include <coedef.h>
williamr@2
    22
williamr@2
    23
class CCoeControl;
williamr@2
    24
class CEikMenuPane;
williamr@2
    25
class CEikMenuBar;
williamr@2
    26
class CEikHotKeyTable;
williamr@2
    27
class TPoint;
williamr@2
    28
williamr@2
    29
/** Menu observer interface.
williamr@2
    30
williamr@2
    31
Menu observers cooperate with menu bars and menu panes, initialising them 
williamr@2
    32
before display and responding to menu events appropriately. CEikAppUi implements 
williamr@2
    33
MEikMenuObserver, so these functions may be implemented on an application's 
williamr@2
    34
App UI.
williamr@2
    35
williamr@2
    36
@publishedAll
williamr@2
    37
@released */
williamr@2
    38
class MEikMenuObserver : public MEikCommandObserver
williamr@2
    39
	{
williamr@2
    40
public:
williamr@2
    41
	/** Menu types */
williamr@2
    42
	enum TMenuType
williamr@2
    43
		{
williamr@2
    44
		/** Menu pane. */
williamr@2
    45
		EMenuPane,
williamr@2
    46
		/** Menu bar. */
williamr@2
    47
		EMenuBar
williamr@2
    48
		};
williamr@2
    49
public:
williamr@2
    50
	IMPORT_C virtual void HandleAttemptDimmedSelectionL(TInt aCommandId);
williamr@2
    51
	IMPORT_C virtual TBool CheckHotKeyNotDimmedL(TInt aCommandId);
williamr@2
    52
	IMPORT_C virtual void RestoreMenuL(CCoeControl* aMenuControl,TInt aResourceId,TMenuType aType);
williamr@2
    53
	IMPORT_C virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
williamr@2
    54
	IMPORT_C virtual void DynInitMenuBarL(TInt aResourceId,CEikMenuBar* aMenuBar);
williamr@2
    55
	IMPORT_C virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos,TInt aModifiers,const CEikHotKeyTable* aTable);
williamr@2
    56
	IMPORT_C virtual void OfferKeyToAppL(const TKeyEvent& aKeyEvent,TEventCode aType);
williamr@2
    57
	/** Called by the Uikon framework to handle the emphasising or de-emphasising of 
williamr@2
    58
	a menu window. 
williamr@2
    59
	
williamr@2
    60
	CEikMenuBar objects call this on their observer to emphasise 
williamr@2
    61
	themselves when they are displayed, and de-emphasise themselves when they 
williamr@2
    62
	stop displaying.
williamr@2
    63
	
williamr@2
    64
	@param aMenuControl The menu control.
williamr@2
    65
	@param aEmphasis ETrue to emphasize the menu, EFalse otherwise. */
williamr@2
    66
	virtual void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis)=0;
williamr@2
    67
public:
williamr@2
    68
	IMPORT_C virtual CCoeControl* CreateCustomCommandControlL(TInt aControlType);
williamr@2
    69
protected:
williamr@2
    70
	IMPORT_C MEikMenuObserver();
williamr@2
    71
private:
williamr@2
    72
	IMPORT_C virtual void Reserved_1_MenuObserver();
williamr@2
    73
	IMPORT_C virtual void Reserved_2_MenuObserver();
williamr@2
    74
private: // from MEikCommandObserver. do not override!
williamr@2
    75
	IMPORT_C void MEikCommandObserver_Reserved1();
williamr@2
    76
	IMPORT_C void MEikCommandObserver_Reserved2();
williamr@2
    77
private:
williamr@2
    78
	TInt iMEikMenuObserver_Spare1;
williamr@2
    79
	};
williamr@2
    80
williamr@2
    81
williamr@2
    82
/** Provides additional functionality to an auto menu title, in the form of an 
williamr@2
    83
OfferHotKeyL() method, which is not required in the normal MEikMenuObserver.
williamr@2
    84
 
williamr@2
    85
Auto menu titles are used to ensure that some menu panes appear in every menu 
williamr@2
    86
constructed for an application. 
williamr@2
    87
williamr@2
    88
@publishedAll 
williamr@2
    89
@released */
williamr@2
    90
class MEikAutoMenuObserver : public MEikMenuObserver
williamr@2
    91
	{
williamr@2
    92
public:
williamr@2
    93
	/** Offers the specified hot key to the auto menu title.
williamr@2
    94
	
williamr@2
    95
	Implement this function if you expect to handle any events from an auto menu. 
williamr@2
    96
	
williamr@2
    97
	@param aKeyEvent The key event.
williamr@2
    98
	@param aType The type of key event.
williamr@2
    99
	@return The auto menu title's response. */
williamr@2
   100
	virtual TKeyResponse OfferHotKeyL(const TKeyEvent& aKeyEvent,TEventCode aType)=0;
williamr@2
   101
public: // from MEikMenuObserver
williamr@2
   102
	IMPORT_C void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
williamr@2
   103
public: 
williamr@2
   104
	IMPORT_C virtual void HandleAttemptDimmedSelectionL(TInt aCommandId);
williamr@2
   105
	IMPORT_C virtual TBool CheckHotKeyNotDimmedL(TInt aCommandId);
williamr@2
   106
	IMPORT_C virtual void RestoreMenuL(CCoeControl* aMenuControl,TInt aResourceId,TMenuType aType);
williamr@2
   107
	IMPORT_C virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
williamr@2
   108
	IMPORT_C virtual void DynInitMenuBarL(TInt aResourceId,CEikMenuBar* aMenuBar);
williamr@2
   109
	IMPORT_C virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos,TInt aModifiers,const CEikHotKeyTable* aTable);
williamr@2
   110
	IMPORT_C virtual void OfferKeyToAppL(const TKeyEvent& aKeyEvent,TEventCode aType);
williamr@2
   111
	IMPORT_C virtual CCoeControl* CreateCustomCommandControlL(TInt aControlType);
williamr@2
   112
protected:
williamr@2
   113
	IMPORT_C MEikAutoMenuObserver();
williamr@2
   114
private:
williamr@2
   115
	IMPORT_C virtual void Reserved_1_MenuObserver();
williamr@2
   116
	IMPORT_C virtual void Reserved_2_MenuObserver();
williamr@2
   117
private: // from MEikCommandObserver. do not override!
williamr@2
   118
	IMPORT_C void MEikCommandObserver_Reserved1();
williamr@2
   119
	IMPORT_C void MEikCommandObserver_Reserved2();
williamr@2
   120
private:
williamr@2
   121
	TInt iMEikAutoMenuObserver_Spare1;
williamr@2
   122
	};
williamr@2
   123
williamr@2
   124
williamr@2
   125
#endif	// __EIKMOBS_H__