epoc32/include/mw/eikmnbut.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
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
/*
williamr@2
     2
* Copyright (c) 2000-2006 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Uikon legacy button that launches a menu when activated
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#if !defined(__EIKMNBUT_H__)
williamr@2
    20
#define __EIKMNBUT_H__
williamr@2
    21
williamr@2
    22
#if !defined(__EIKMOBS_H__)
williamr@2
    23
#include <eikmobs.h>
williamr@2
    24
#endif										 
williamr@2
    25
williamr@2
    26
#if !defined(__EIKCMBUT_H__)
williamr@2
    27
#include <eikcmbut.h>
williamr@2
    28
#endif
williamr@2
    29
williamr@2
    30
class CEikMenuPane;
williamr@2
    31
williamr@2
    32
/**
williamr@2
    33
 *  This class implements a command button that, when pressed, raises a Menu pane.
williamr@2
    34
 *
williamr@2
    35
 *  This class does NOT implement S60 look-and-feel and is not skinned.
williamr@2
    36
 *
williamr@2
    37
 *  @lib eikcoctl.dll
williamr@2
    38
 *  @since S60 1.0
williamr@2
    39
 */
williamr@2
    40
class CEikMenuButton : public CEikCommandButton, private MEikMenuObserver
williamr@2
    41
{
williamr@2
    42
public:
williamr@2
    43
    /**
williamr@2
    44
    * C++ constructor
williamr@2
    45
    */
williamr@2
    46
    IMPORT_C CEikMenuButton();
williamr@2
    47
    
williamr@2
    48
    /**
williamr@2
    49
    * destructor
williamr@2
    50
    */
williamr@2
    51
    IMPORT_C ~CEikMenuButton();
williamr@2
    52
williamr@2
    53
    /**
williamr@2
    54
    * 2nd phase constructor using a MNBUT resource struct
williamr@2
    55
    *
williamr@2
    56
    * @param aReader    A constructed resource reader.
williamr@2
    57
    */
williamr@2
    58
    IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
williamr@2
    59
    
williamr@2
    60
    /**
williamr@2
    61
    * Launch the related menu pane
williamr@2
    62
    * 
williamr@2
    63
    * @param aObserver Mandatory supplied menu observer pointer.
williamr@2
    64
    */
williamr@2
    65
    IMPORT_C void LaunchPopupMenuL(MEikMenuObserver* aObserver);
williamr@2
    66
    
williamr@2
    67
    /**
williamr@2
    68
    * Set the menu pane id to be launched when the control is activated.
williamr@2
    69
    * 
williamr@2
    70
    * @param aMenuPaneId  Resource ID of the menu pane to be launched
williamr@2
    71
    */
williamr@2
    72
    IMPORT_C void SetMenuPaneId(TInt aMenuPaneId);
williamr@2
    73
    
williamr@2
    74
protected:
williamr@2
    75
williamr@2
    76
    /**
williamr@2
    77
    * From CCoeControl
williamr@2
    78
    *
williamr@2
    79
    * Serialize the state of the control to the given stream
williamr@2
    80
    *
williamr@2
    81
    * @param aWriteStream   Stream to write to
williamr@2
    82
    */
williamr@2
    83
    IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
    84
williamr@2
    85
public: // from CEikButtonBase
williamr@2
    86
williamr@2
    87
    /**
williamr@2
    88
    * Triggers the change of appearance of the button that is associated with the button being pressed
williamr@2
    89
    */
williamr@2
    90
    IMPORT_C void Animate();
williamr@2
    91
williamr@2
    92
public: // From CCoeControl
williamr@2
    93
    
williamr@2
    94
    /**
williamr@2
    95
    * From CCoeControl
williamr@2
    96
    *
williamr@2
    97
    * Framework method called when a pointer event is found to be within this control's boundaries. 
williamr@2
    98
    * The default implementation causes the associated menu to be presented to the screen.
williamr@2
    99
    *
williamr@2
   100
    * @param aPointerEvent  Pointer event to process
williamr@2
   101
    */
williamr@2
   102
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   103
williamr@2
   104
private: 
williamr@2
   105
 
williamr@2
   106
    /**
williamr@2
   107
    * From MEikCommandObserver
williamr@2
   108
    *
williamr@2
   109
    * Framework method called to processs a command ID
williamr@2
   110
    *
williamr@2
   111
    * @param aCommandId ID of the command to respond to.
williamr@2
   112
    */
williamr@2
   113
    IMPORT_C void ProcessCommandL(TInt aCommandId);
williamr@2
   114
    
williamr@2
   115
    /**
williamr@2
   116
    * From MEikMenuObserver
williamr@2
   117
    *
williamr@2
   118
    * Called by the Uikon framework to handle the emphasising or de-emphasising of 
williamr@2
   119
    * a menu window. 
williamr@2
   120
    * 
williamr@2
   121
    * CEikMenuBar objects call this on their observer to emphasise 
williamr@2
   122
    * themselves when they are displayed, and de-emphasise themselves when they 
williamr@2
   123
    * stop displaying.
williamr@2
   124
    * 
williamr@2
   125
    * @param aMenuControl The menu control
williamr@2
   126
    * @param aEmphasis ETrue to emphasize the menu, EFalse otherwise
williamr@2
   127
    */
williamr@2
   128
    IMPORT_C void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
williamr@2
   129
    
williamr@2
   130
private:
williamr@2
   131
    void ClosePopupMenu();
williamr@2
   132
    void DoLaunchPopupMenuL();
williamr@2
   133
private:
williamr@2
   134
    /**
williamr@2
   135
    * From CAknControl
williamr@2
   136
    */
williamr@2
   137
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   138
    
williamr@2
   139
private:
williamr@2
   140
    /**
williamr@2
   141
    *  The object to receive the menu events
williamr@2
   142
    *  Not Owned
williamr@2
   143
    */
williamr@2
   144
    MEikMenuObserver* iMenuObserver;
williamr@2
   145
    
williamr@2
   146
    /**
williamr@2
   147
    * Holds a menu pane object to be popped up
williamr@2
   148
    * Owned
williamr@2
   149
    */
williamr@2
   150
    CEikMenuPane* iMenuPopup;
williamr@2
   151
    
williamr@2
   152
    /**
williamr@2
   153
    * Resource ID of the menu pane
williamr@2
   154
    */
williamr@2
   155
    TInt iMenuPaneId;
williamr@2
   156
    
williamr@2
   157
    TInt iSpare;
williamr@2
   158
    };
williamr@2
   159
williamr@2
   160
#endif