epoc32/include/mw/eikmnbut.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/eikmnbut.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/eikmnbut.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,160 @@
     1.4 -eikmnbut.h
     1.5 +/*
     1.6 +* Copyright (c) 2000-2006 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Uikon legacy button that launches a menu when activated
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#if !defined(__EIKMNBUT_H__)
    1.24 +#define __EIKMNBUT_H__
    1.25 +
    1.26 +#if !defined(__EIKMOBS_H__)
    1.27 +#include <eikmobs.h>
    1.28 +#endif										 
    1.29 +
    1.30 +#if !defined(__EIKCMBUT_H__)
    1.31 +#include <eikcmbut.h>
    1.32 +#endif
    1.33 +
    1.34 +class CEikMenuPane;
    1.35 +
    1.36 +/**
    1.37 + *  This class implements a command button that, when pressed, raises a Menu pane.
    1.38 + *
    1.39 + *  This class does NOT implement S60 look-and-feel and is not skinned.
    1.40 + *
    1.41 + *  @lib eikcoctl.dll
    1.42 + *  @since S60 1.0
    1.43 + */
    1.44 +class CEikMenuButton : public CEikCommandButton, private MEikMenuObserver
    1.45 +{
    1.46 +public:
    1.47 +    /**
    1.48 +    * C++ constructor
    1.49 +    */
    1.50 +    IMPORT_C CEikMenuButton();
    1.51 +    
    1.52 +    /**
    1.53 +    * destructor
    1.54 +    */
    1.55 +    IMPORT_C ~CEikMenuButton();
    1.56 +
    1.57 +    /**
    1.58 +    * 2nd phase constructor using a MNBUT resource struct
    1.59 +    *
    1.60 +    * @param aReader    A constructed resource reader.
    1.61 +    */
    1.62 +    IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
    1.63 +    
    1.64 +    /**
    1.65 +    * Launch the related menu pane
    1.66 +    * 
    1.67 +    * @param aObserver Mandatory supplied menu observer pointer.
    1.68 +    */
    1.69 +    IMPORT_C void LaunchPopupMenuL(MEikMenuObserver* aObserver);
    1.70 +    
    1.71 +    /**
    1.72 +    * Set the menu pane id to be launched when the control is activated.
    1.73 +    * 
    1.74 +    * @param aMenuPaneId  Resource ID of the menu pane to be launched
    1.75 +    */
    1.76 +    IMPORT_C void SetMenuPaneId(TInt aMenuPaneId);
    1.77 +    
    1.78 +protected:
    1.79 +
    1.80 +    /**
    1.81 +    * From CCoeControl
    1.82 +    *
    1.83 +    * Serialize the state of the control to the given stream
    1.84 +    *
    1.85 +    * @param aWriteStream   Stream to write to
    1.86 +    */
    1.87 +    IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
    1.88 +
    1.89 +public: // from CEikButtonBase
    1.90 +
    1.91 +    /**
    1.92 +    * Triggers the change of appearance of the button that is associated with the button being pressed
    1.93 +    */
    1.94 +    IMPORT_C void Animate();
    1.95 +
    1.96 +public: // From CCoeControl
    1.97 +    
    1.98 +    /**
    1.99 +    * From CCoeControl
   1.100 +    *
   1.101 +    * Framework method called when a pointer event is found to be within this control's boundaries. 
   1.102 +    * The default implementation causes the associated menu to be presented to the screen.
   1.103 +    *
   1.104 +    * @param aPointerEvent  Pointer event to process
   1.105 +    */
   1.106 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.107 +
   1.108 +private: 
   1.109 + 
   1.110 +    /**
   1.111 +    * From MEikCommandObserver
   1.112 +    *
   1.113 +    * Framework method called to processs a command ID
   1.114 +    *
   1.115 +    * @param aCommandId ID of the command to respond to.
   1.116 +    */
   1.117 +    IMPORT_C void ProcessCommandL(TInt aCommandId);
   1.118 +    
   1.119 +    /**
   1.120 +    * From MEikMenuObserver
   1.121 +    *
   1.122 +    * Called by the Uikon framework to handle the emphasising or de-emphasising of 
   1.123 +    * a menu window. 
   1.124 +    * 
   1.125 +    * CEikMenuBar objects call this on their observer to emphasise 
   1.126 +    * themselves when they are displayed, and de-emphasise themselves when they 
   1.127 +    * stop displaying.
   1.128 +    * 
   1.129 +    * @param aMenuControl The menu control
   1.130 +    * @param aEmphasis ETrue to emphasize the menu, EFalse otherwise
   1.131 +    */
   1.132 +    IMPORT_C void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
   1.133 +    
   1.134 +private:
   1.135 +    void ClosePopupMenu();
   1.136 +    void DoLaunchPopupMenuL();
   1.137 +private:
   1.138 +    /**
   1.139 +    * From CAknControl
   1.140 +    */
   1.141 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.142 +    
   1.143 +private:
   1.144 +    /**
   1.145 +    *  The object to receive the menu events
   1.146 +    *  Not Owned
   1.147 +    */
   1.148 +    MEikMenuObserver* iMenuObserver;
   1.149 +    
   1.150 +    /**
   1.151 +    * Holds a menu pane object to be popped up
   1.152 +    * Owned
   1.153 +    */
   1.154 +    CEikMenuPane* iMenuPopup;
   1.155 +    
   1.156 +    /**
   1.157 +    * Resource ID of the menu pane
   1.158 +    */
   1.159 +    TInt iMenuPaneId;
   1.160 +    
   1.161 +    TInt iSpare;
   1.162 +    };
   1.163 +
   1.164 +#endif