Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #if !defined(__EIKMENUP_H__)
20 #define __EIKMENUP_H__
22 #if !defined(__EIKBCTRL_H__)
26 #if !defined(__EIKDEF_H__)
30 #if !defined(__EIKSBOBS_H__)
31 #include <eiksbobs.h> // for TEikScrollEvent
36 // FORWARD DECLARATIONS
37 class MEikMenuObserver;
38 class CEikHotKeyTable;
39 class CEikMenuPaneTitle;
41 class CEikScrollBarFrame;
43 class TEikScrollBarModel;
45 class CEikMenuPaneExtension ;
48 const TInt KScaleableTextSeparator = 0x0001;
51 * A helper class for extending CEikMenuPaneItem without breaking binary
54 class CExtendedItemData : public CBase
66 /** Two packaked bitmaps: bitmap icon and mask for it. */
69 /** Scalable text buffer. */
70 HBufC* iScaleableText;
75 * The @c CEikMenuPaneItem class encapsulates the data needed to define a menu
76 * pane item and provides some of the functionality required to display the
81 class CEikMenuPaneItem : public CBase
86 /** Struct to menu pane item. */
90 /** Nominal text length.*/
91 enum { ENominalTextLength=40 };
94 * ID of the command to issue when the menu item using this @c SData is
99 /** Resource ID of a menu pane to cascade from this item. */
103 * Flags used internally by @c CEikMenuPane and accessible through
104 * functions such as @c CEikMenuPane::SetItemDimmed().
108 /** The text buffer displayed in the main area of the menu item. */
109 TBuf<ENominalTextLength> iText; // less than this actually stored
112 * Additional descriptive text about the item. This is used by @c
113 * CEikMenuPane to display hotkey names.
121 * C++ default constructor.
123 IMPORT_C CEikMenuPaneItem();
128 IMPORT_C ~CEikMenuPaneItem();
131 * Sets a menu item icon. This replaces any icon already set for the menu
134 * @param aIcon Menu item icon consisting of a picture bitmap and a mask
137 IMPORT_C void SetIcon(CGulIcon* aIcon);
140 * Draws the menu item icon.
142 * @param aGc Graphics context to which the icon is drawn.
143 * @param aRect Rectangle in which the icon is drawn.
144 * @param aDimmed If @c ETrue the icon is drawn dimmed.
145 * @param aBitmapSpaceRequired Length of one side of the square required to
146 * contain the bitmap.
148 IMPORT_C void DrawItemIcon(CWindowGc& aGc,
151 TInt aBitmapSpaceRequired) const;
154 * Construct an icon from bitmaps.
156 * Constructs a new icon for the menu item, taking ownership of the picture
157 * bitmap aBitmap and the mask bitmap aMask unless the bitmaps are
160 * @param aBitmap Picture bitmap.
161 * @param aMask Mask bitmap.
163 IMPORT_C void CreateIconL(CFbsBitmap* aBitmap,
167 * Gets a pointer to the menu item's icon picture bitmap. This does not
168 * imply transfer of ownership.
170 * @return Picture bitmap.
172 IMPORT_C CFbsBitmap* IconBitmap() const;
175 * Gets a pointer to the menu item's icon mask bitmap. This does not imply
176 * transfer of ownership.
178 * @return Mask bitmap.
180 IMPORT_C CFbsBitmap* IconMask() const;
183 * Sets icon bitmap ownership.
184 * Sets the menu item's icon bitmaps as externally owned if @c
185 * aOwnedExternally is @c ETrue.
187 * @param aOwnedExternally If @c ETrue bitmaps are set as externally owned.
188 * @c If EFalse bitmaps are set as not being externally owned.
190 IMPORT_C void SetBitmapsOwnedExternally(TBool aOwnedExternally);
193 * Sets the picture bitmap. Transfers ownership unless the bitmaps are
194 * already owned externally.
196 * @param aBitmap Picture bitmap.
198 IMPORT_C void SetIconBitmapL(CFbsBitmap* aBitmap);
201 * Sets the mask bitmap. Transfers ownership unless the bitmaps are already
204 * @param aMask Mask bitmap.
206 IMPORT_C void SetIconMaskL(CFbsBitmap* aMask);
209 * Returns scaleable text. If there isn't scaleable text available then
210 * this method returns @c iData.iText.
212 * @return Pointer to TPtrC object that contains scaleable text.
214 IMPORT_C TPtrC ScaleableText() const;
217 * Sets scaleable text. @c iData.iText is set to first text version.
219 * @param aText Scalable text.
221 IMPORT_C void SetScaleableTextL(const TDesC& aText);
224 inline void CreateExtendedDataBlock();
225 inline TBool IsScaleableText(const TDesC& aText) const;
226 TPtrC GetNominalText(const TDesC& aText);
230 /** The y position of the menu pane item. */
233 /** The menu pane item's hotkey text. */
236 /** Information from an SData struct. */
240 CExtendedItemData* iExtendedData;
244 inline void CEikMenuPaneItem::CreateExtendedDataBlock()
248 TRAPD(err, ( iExtendedData = new (ELeave) CExtendedItemData() ) );
253 inline TBool CEikMenuPaneItem::IsScaleableText(const TDesC& aText) const
255 return (aText.Locate(TChar(KScaleableTextSeparator)) == KErrNotFound ? EFalse : ETrue);
260 * Menu panes are opened by activating the menu title
261 * @c (CEikMenuPaneTitle / MENU_TITLE) which is displayed in the menu bar @c
262 * (CEikMenuBar / MENU_BAR). They can also be cascaded from a menu item @c
263 * (CEikMenuPaneItem / MENU_ITEM) or launched by a menu button @c
266 * Menu panes may be defined using a @c MENU_PANE resource.
268 class CEikMenuPane : public CEikBorderedControl
271 enum {ENothingSelected=-1};
273 friend class CMenuScroller;
274 friend class CEikMenuPaneExtension;
277 /** The text to be displayed for a hotkey. */
278 typedef TBuf<20> THotKeyDisplayText;
283 * This class provides a constructor to create an array of menu pane items
284 * and a destructor to destroy an array of menu pane items.
286 class CItemArray:public CArrayPtrFlat<CEikMenuPaneItem>
292 * C++ default constructor that creates a flat array of menu pane
295 IMPORT_C CItemArray();
300 IMPORT_C ~CItemArray();
303 * Appends @c CEikMenuPaneItem class object to array.
305 * @param aMenuItem The menu item to add.
307 IMPORT_C void AddItemL(CEikMenuPaneItem* aMenuItem);
315 IMPORT_C ~CEikMenuPane();
318 * C++ default constructor. Constructs a menu pane object with the
319 * specified observer.
321 * @param aMenuObserver Menu observer.
323 IMPORT_C CEikMenuPane(MEikMenuObserver* aMenuObserver);
326 * Handles 2nd base construction. Completes construction of a menu pane object.
328 * @param aOwner Menu pane owner ( for cascade menu ).
329 * @param aEditMenuObserver Observer for the edit menu. In default this is
332 IMPORT_C void ConstructL(CEikMenuPane* aOwner,
333 MEikMenuObserver* aEditMenuObserver = NULL);
336 * Destroys the menu pane's item array.
338 IMPORT_C void Reset();
343 * From @c CcoeControl.
345 * Handles key events offered to the menu by the control environment and
346 * provides an appropriate implementation of @c
347 * CCoeControl::OfferKeyEventL().
349 * @param aKeyEvent The key event.
350 * @param aType The type of key event: @c EEventKey, @c EEventKeyUp or @c
353 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
357 * From @c CcoeControl.
359 * Handles a pointer event on the menu.
361 * @param aPointerEvent The pointer event to handle.
363 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
366 * From @c CcoeControl.
368 * Gets the list of logical colours employed in the drawing of the control,
369 * paired with an explanation of how they are used. Appends the list into
373 * @param aColorUseList The list of colours paired with explanations.
375 IMPORT_C virtual void GetColorUseListL(
376 CArrayFix<TCoeColorUse>& aColorUseList) const;
379 * From @c CcoeControl.
381 * Handles a change to the menu's resources which are shared across the
382 * environment. For example, colours or fonts.
385 * @param aType The type of resource that has changed.
387 IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u
389 private: // from base class
397 IMPORT_C void* ExtensionInterface( TUid aInterface );
399 public: // from MCoeInputObserver
402 * From @c CCoeControl.
404 * Gets the list box’s input capabilities as set through the list box flags.
406 * @return List box input capabilities.
408 IMPORT_C TCoeInputCapabilities InputCapabilities() const;
410 protected: // from base class
413 * From @c CCoeControl
415 * Draw a control called by window server.
417 * All controls, except blank controls, should implement this function. The
418 * default implementation draws a blank control. This function is used for
419 * window server-initiated redrawing of controls, and for some
420 * application-initiated drawing. It should be implemented by each control,
421 * but is only called from within @c CCoeControl's member functions, and
422 * not from the derived class. For this reason it is a private member
423 * function of @c CCoeControl.
425 * The rectangle aRect indicates the region of the control that needs to be
426 * redrawn. The implementation of @c Draw() must always draw to every pixel
427 * within this rectangle.
429 * @param aRect The region of the control to be redrawn.
430 * Co-ordinates are relative to the control's origin (top left
431 * corner). Optional, not used currently.
433 IMPORT_C void Draw(const TRect& aRect) const;
436 * From @c CCoeControl.
438 * Takes any action required when the menu pane gains or loses focus,
439 * to change its appearance for example.
441 * @param aDrawNow If @c EDrawNow the menu pane is redrawn. If @c
442 * ENoDrawNow the menu pane is not redrawn.
444 IMPORT_C void FocusChanged(TDrawNow aDrawNow);
447 * From @c CCoeControl.
449 * Constructs the menu pane using the specified resource reader.
450 * Fills the menu item array with the list of menu items provided by the
453 * @param aReader The resource reader to use.
454 * @leave KErrNoMemory Memory allocation failure earlier construction.
456 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
458 public: // new functions
461 * Adds a menu item dynamically by creating a new menu item, setting its
462 * data to @c aMenuItem and appending it to the pane's menu item array.
463 * Updates the menu's scroll bar to take account of the new item.
465 * @param aMenuItem The menu item to add.
466 * NOTICE that @c SData is a structure so all fields in it should be
467 * set to avoid any unexpected behaviour.
469 IMPORT_C void AddMenuItemL(const CEikMenuPaneItem::SData& aMenuItem);
472 * Adds a menu item dynamically by creating a new menu item, setting its
473 * data to @c aMenuItem and inserting it into the pane's menu item array.
474 * Updates the menu's scroll bar to take account of the new item.
476 * @param aMenuItem The menu item to add. NOTICE that @c SData is a
477 * structure so all fields in it should be set to avoid any
478 * unexpected behaviour.
479 * @param aPreviousId The id of the item after which the new item should be
482 IMPORT_C void AddMenuItemL(const CEikMenuPaneItem::SData& aMenuItem,
486 * Adds menu items dynamically by creating new menu items from resource
487 * and inserts them into the pane's menu item array.
489 * @param aResourceId The ID of the resource for the menu item.
490 * @param aPreviousId The ID of the previous menu item, after which this
491 * newly created item should be added.
492 * @param aAddSeperator Shouldn't be used as separator is not not supported
495 IMPORT_C void AddMenuItemsL(TInt aResourceId,
496 TInt aPreviousId = 0,
497 TBool aAddSeperator = EFalse);
500 * Deletes the specified item in the menu pane.
502 * @param aCommandId The ID for the item to be deleted.
504 IMPORT_C void DeleteMenuItem(TInt aCommandId);
507 * Deletes the items between specified items.
509 * @param aStartIndex The index of the item after which items should be
511 * @param aEndIndex The index of the item up to which items should be
514 IMPORT_C void DeleteBetweenMenuItems(TInt aStartIndex,
518 * Gets a reference to the data in the specified menu item.
520 * @param aCommandId The command ID of the menu item for which data is
522 * @return Reference to struct that contains command id.
524 IMPORT_C CEikMenuPaneItem::SData& ItemData(TInt aCommandId);
527 * Gets a pointer to the specified menu item. Also gets the position of the
528 * item within the menu pane. Panics if there are no menu items in the menu
529 * pane. Panics if the menu pane id does not identify any menu pane item in
532 * @param aCommandId The ID of the menu item for which a pointer is
534 * @param aPos On return, the position of the menu item with an ID of
536 * @return A pointer to the menu item.
537 * @panic EEikPanicNoSuchMenuItem Panics if there are no menu items in the
538 * menu pane or if the menu pane id does not
539 * identify any menu pane item in the array.
541 IMPORT_C CEikMenuPaneItem* ItemAndPos(TInt aCommandId,TInt& aPos);
544 * Displays the menu pane with the corner identified by @c aTargetType in
545 * the position specified by @c aTargetPos. This function uses @c
546 * aMinTitleWidth to calculate the area required to display the menu pane,
547 * taking into account whether the menu is a cascading menu or popup menu.
549 * @param aHotKeyTable Optional hotkey table.
550 * @param aTargetPos Position of the corner of the menu pane identified by
552 * @param aMenuPaneTitle The menu pane's title.
553 * @param aMinWidth Minimum width of the menu's title.
554 * @param aTargetType The corner of the menu pane to which @c aTargetPos
555 * relates. The default is the top left corner. Possible: @c
556 * EPopupTargetTopLeft, @c EPopupTargetTopRight,
557 * @cEPopupTargetBottomLeft, @c EPopupTargetBottomRight.
559 IMPORT_C void StartDisplayingMenuPane(
560 const CEikHotKeyTable* aHotKeyTable,
561 const TPoint& aTargetPos,
562 const CEikMenuPaneTitle* aMenuPaneTitle,
564 TPopupTargetPosType aTargetType = EPopupTargetTopLeft);
567 * Sets the text in a menu item.
569 * @param aCommandId The command (as defined in an .hrh file) associated
570 * with this menu item. This identifies the menu item whose text is
572 * @param aDes New item text.
574 IMPORT_C void SetItemTextL(TInt aCommandId,
578 * Sets the text in a menu item from resource.
580 * @param aCommandId The command (as defined in an .hrh file) associated
581 * with this menu item. This identifies the menu item whose text is
583 * @param aRid The resource ID of the menu item text.
585 IMPORT_C void SetItemTextL(TInt aCommandId,
589 * Dims (greys out) or undims a menu item. Dimming indicates that user
590 * input is not accepted.
592 * @param aCommandId The command (as defined in an .hrh file) associated
593 * with this menu item. This identifies the menu item whose text is
594 * to be dimmed or un-dimmed.
595 * @param aDimmed @c ETrue to dim this menu item. @c EFalse to un-dim this
598 IMPORT_C void SetItemDimmed(TInt aCommandId,
602 * Sets the item to be indicated or not. It should be used to change the
603 * state of radio buttons or check box items. It has real effect only
604 * starting from S60 v3.0.
606 * @param aCommandId The command (as defined in an .hrh file) associated
607 * with this menu item. This identifies the menu item for which the
608 * state is set or unset.
609 * @param aButtonState should be @c EEikMenuItemSymbolOn or @c
610 * EEikMenuItemSymbolIndeterminate
612 IMPORT_C void SetItemButtonState(TInt aCommandId,
616 * Sets the selected menu item.
618 * @param aSelectedItem The index of the item to get selected
620 IMPORT_C void SetSelectedItem(TInt aSelectedItem);
623 * Gets the position of the selected menu item.
625 * @return The position of the selected menu item.
627 IMPORT_C TInt SelectedItem() const;
630 * Closes and destroys any current cascade menu and takes focus back. Does
631 * nothing if no cascade menu exists.
633 IMPORT_C void CloseCascadeMenu();
636 * Sets the array containing the list of menu items for the current menu
639 * @param aItemArray The menu item array for the menu pane.
641 IMPORT_C void SetItemArray(CItemArray* aItemArray);
644 * Set menu item array ownership.
646 * @param aOwnedExternally If @c ETrue the menu pane's menu item array is
647 * set as externally owned. If @c EFalse the menu pane's menu item
648 * array is set as not externally owned.
650 IMPORT_C void SetItemArrayOwnedExternally(TBool aOwnedExternally);
653 * Sets the specified button to launch the menu pane. Doesn't have any
654 * effect in current implementation.
656 * @param aButton The button to set as launching the menu.
658 IMPORT_C void SetLaunchingButton(CEikButtonBase* aButton);
661 * Moves the menu pane highlight to a newly selected menu item identified
662 * by @c aNewSelectedItem. Scrolls the menu to show the new selected item
663 * if necessary and redraws only the newly selected item and the currently
664 * selected item if possible.
666 * @param aNewSelectedItem The newly selected menu item index.
668 IMPORT_C void MoveHighlightTo(TInt aNewSelectedItem);
671 * Gets the number of menu items within the menu pane.
673 * @return Number of menu items within menu pane.
675 IMPORT_C TInt NumberOfItemsInPane() const;
678 * Closes the menu pane.
680 IMPORT_C void Close();
685 * Handles key events offered to the menu by the control environment.
687 * @since Platform 004.
688 * @param aKeyEvent The key event.
689 * @param aType The type of key event: @c EEventKey, @c EEventKeyUp or @c
691 * @param aConsumeAllKeys If @c ETrue this function returns @c
692 * EKeyWasConsumed regardless of whether it was used. If @c EFalse
693 * the key event is consumed if possible and either @c
694 * EKeyWasConsumed or @c EKeyWasNotConsumed is returned as
697 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
699 TBool aConsumeAllKeys); // not available before Platform 004
702 * Sets whether the scroll bar occupies the left side of the menu pane.
704 * @param aOnLeft If @c ETrue the scroll bar will occupy the left side of
707 IMPORT_C void SetScrollBarOnLeft(TBool aOnLeft);
710 * Sets whether the menu pane uses an arrow head scroll bar.
712 * @param aArrowHead If @c ETrue the menu pane uses an arrow head scroll
715 IMPORT_C void SetArrowHeadScrollBar(TBool aArrowHead);
720 * Moves highlight to the next item or to the first one if last item is
723 IMPORT_C void NavigateToNextItem();
726 * Inserts the menu item to the specified position.
728 * @param aMenuItem The menu item to add. NOTICE @c SData is the structure
729 * and all fileds should be initialized.
730 * @param aPosition The position of newly created item in the array.
732 IMPORT_C void InsertMenuItemL(const CEikMenuPaneItem::SData& aMenuItem,
736 * Checks whether menu pane contains the menu item and returns position of
737 * it if the item is found.
739 * @param[in] aCommandId The command ID of the item to be searched for.
740 * @param[out] aPosition On return contains position of the item.
741 * @return @c ETrue if item was found. Otherwise @c EFalse.
743 IMPORT_C TBool MenuItemExists(TInt aCommandId,
747 * Checks whether the menu pane is a cascade menu or a main menu.
749 * @return @c ETrue if the menu pane is cascade menu and @c EFalse if the
750 * menu pane is the main menu.
752 IMPORT_C TBool IsCascadeMenuPane() const;
755 * Enables or disables text scrolling functionality. It is disabled by
758 * @param aEnable @c ETrue to enable text scrolling functionality.
760 IMPORT_C void EnableMarqueeL(const TBool aEnable);
763 * Report that selection was done for the currently highlighted item.
765 void ActivateCurrentItemL();
768 * Closes cascade menu if there is one and it is active.
770 TBool CancelActiveMenuPane();
773 * Deletes dimmed items from the menu item array.
775 void FilterDimmedItems();
780 * @param aWidth Not used.
782 void ClipMenuItems(TInt aWidth);
785 * Gets the menu pane for the cascade menu.
787 * @return The menu pane for the cascade menu.
789 IMPORT_C CEikMenuPane* CascadeMenuPane();
792 * Gets a reference to the data in the specified menu item.
795 * @param aItemIndex The index of the item in the items array.
796 * @return The menu item's data.
797 * @leave KErrArgument Wrong @aItemIndex.
799 IMPORT_C CEikMenuPaneItem::SData& ItemDataByIndexL(TInt aItemIndex);
802 * Checks if the position of the menu was set from outside.
805 * @return @c ETrue in case when position of the menu was set from outside.
807 TBool IsPositionToBeForced() const;
810 * Creates and enables a special characters row to be used in the edit
814 * @param aSpecialChars Buffer that holds the selected characters after
815 * user has selected them.
817 IMPORT_C void ConstructMenuSctRowL( TDes& aSpecialChars );
820 * Returns the command id of the specified menu item. The function panics
821 * if aIndex doesn't exist or is out of range.
822 * @param aIndex The index of the menu item for which the command ID is returned.
825 IMPORT_C TInt MenuItemCommandId( TInt aIndex ) const;
829 * Creates and enables a special characters row to be used in the edit menu.
830 * The special character row is constructed from the given special character table.
832 * @param aSpecialChars Buffer that holds the selected characters after
833 * user has selected them.
834 * @param aResourceId The special character table resource id to define the
835 * characters in the row.
839 IMPORT_C void ConstructMenuSctRowL( TDes& aSpecialChars, TInt aResourceId );
842 * Creates and enables a special characters row to be used in the edit menu.
843 * The special character row is constructed from the given special character dialog.
845 * @param aSpecialChars Buffer that holds the selected characters after
846 * user has selected them.
847 * @param aResourceId The special character dialog resource id that contains a special character table
851 IMPORT_C void ConstructMenuSctRowFromDialogL( TDes& aSpecialChars, TInt aResourceId );
854 * Creates and enables a special characters row to be used in the edit menu.
855 * The special character row is constructed from the given special character dialog.
857 * @param aCharCase the charcase used by menu sct
858 * @param aSpecialChars Buffer that holds the selected characters after
859 * user has selected them.
860 * @param aResourceId The special character dialog resource id that contains a special character table
864 IMPORT_C void ConstructMenuSctRowFromDialogL( TInt aCharCase, TDes& aSpecialChars, TInt aResourceId );
867 enum { EInvalidCurrentSize=0x01, EBackgroundFaded=0x02 };
869 private: // new functions
870 TRect CalculateSizeAndPosition() ;
871 enum THighlightType {ENoHighlight,EDrawHighlight,ERemoveHighlight};
872 void DrawItem(CWindowGc& aGc,TInt aItem, THighlightType aHighlight) const;
873 void FindHotKeyDisplayText(TDes& aDes,const CEikMenuPaneItem& aItem) const;
874 void ReportSelectionMadeL( TBool aAbortTransition = ETrue );
875 void ReportCanceled();
876 void GiveVisualFeedback();
877 void LaunchCascadeMenuL(TInt aCascadeMenuId);
878 void DoLaunchCascadeMenuL(TInt aCascadeMenuId);
879 void TryLaunchCascadeMenuL(const CEikMenuPaneItem& aItem);
880 void PrepareGcForDrawingItems(CGraphicsContext& aGc) const;
881 TBool ItemArrayOwnedExternally() const;
882 TBool IsHotKeyL(const TInt modifiers,const TInt aCode);
883 TBool MoveToItemL(TInt aCode, TInt aModifiers);
884 void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType);
885 void CreateScrollBarFrame();
886 void UpdateScrollBar();
887 void DoUpdateScrollBarL();
888 void UpdateScrollBarThumbs();
889 static TInt UpdateScrollBarCallBackL(TAny* aObj);
890 TRect ViewRect() const;
891 // TInt NumberOfItemsThatFitInView() const;
892 TInt TotalItemHeight() const;
893 void ScrollToMakeItemVisible(TInt aItemIndex);
894 void Scroll(TInt aAmount);
895 TBool CheckCreateScroller();
896 void CheckCreateScrollerL();
897 void ResetItemArray();
898 void CreateItemArrayL();
899 void SetVScrollBarFlag();
900 TInt TopHighlightGap() const;
901 TInt BottomHighlightGap() const;
902 TInt EvaluateMaxIconWidth() const;
903 void CreateIconFromResourceL(TResourceReader& aReader, CEikMenuPaneItem& aItem) const;
905 void AnimateMenuPane(const TPoint& aNewPos);
907 // To make layout correct
908 TRect ListMenuPane() const;
909 TRect PopupMenuWindow() const;
910 TRect PopupSubmenuWindow() const;
912 // Skin support for menu
913 void UpdateBackgroundContext(const TRect& aWindowRect);
915 // Support method for highlight animation
916 void RepaintHighlight() const;
918 private: // from CCoeControl
919 IMPORT_C void Reserved_1();
920 IMPORT_C void Reserved_2();
922 private : // new functions
923 void LoadCascadeBitmapL() ;
925 // Support for check mark, from v3.0
926 void LoadCheckMarkBitmapL();
927 TBool MenuHasCheckBoxOn() const;
928 // Support for radio button, from v3.0
929 void LoadRadioButtonBitmapL();
930 TBool IsItemMemberOfRadioButtonGroup(TInt aItem) const ;
931 // for drawing,from v3.0
932 TBool MenuHasIcon() const;
934 TRect CalculateSizeAndPositionScalable( const TRect& aWindowRect, TInt aNumItemsInPane ) ;
935 TRect HighlightRect() const;
936 void PrepareHighlightFrame() const;
937 void SetCascadedIconSize() const;
939 // fixes marquee flickering
940 friend class CAknMarqueeControl;
941 static TInt RedrawMarqueeEvent( TAny* aControl );
943 CEikMenuPaneExtension* Extension() const;
945 protected: // from CoeControl
948 * From @c CCoeControl.
950 * Retrieves an object of the same type as that encapsulated in aId. Other
951 * than in the case where @c NULL is returned, the object returned must be
952 * of the same object type - that is, the @c ETypeId member of the object
953 * pointed to by the pointer returned by this function must be equal to the
954 * @c iUid member of @c aId.
957 * @param aId An encapsulated object type ID.
958 * @return Encapsulates the pointer to the object provided. Note that the
959 * encapsulated pointer may be @c NULL.
961 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
963 public: // From CoeControl.
966 * From @c CoeControl.
968 * Gets the number of controls contained in a compound control. This
969 * function should be implemented by all compound controls.
972 * In SDK 6.1 this was changed from protected to public.
974 * @return The number of component controls contained by this control.
976 IMPORT_C TInt CountComponentControls() const;
979 * From @c CoeControl.
981 * Gets the specified component of a compound control. This function should´
982 * be implemented by all compound controls.
985 * Within a compound control, each component control is identified by an
986 * index, where the index depends on the order the controls were added: the
987 * first is given an index of 0, the next an index of 1, and so on.
989 * @param[in, out] aIndex The index of the control to get.
990 * @return The component control with an index of @c aIndex.
992 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
994 protected: // new functions
997 * Disables sliding effect
998 * By default is enabled if there is enough memory.
1002 void DisableAnimation();
1005 * The position of the menu will be changed according to the one
1006 * which is specified by arguments in StartDisplayingMenuPane()
1007 * By default those arguments are not used.
1010 * @param aForced @c Etrue if arguments are used.
1012 void SetPositionToBeForced(TBool aForced);
1015 * Gets the maximum number of items which can be seen simultaneously.
1017 * @return The maximum number of items which can be seen simultaneously.
1019 TInt NumberOfItemsThatFitInView() const;
1024 friend class CEikMenuButton;
1025 MEikMenuObserver* iMenuObserver;
1026 MEikMenuObserver* iEditMenuObserver;
1027 CEikMenuPane* iCascadeMenuPane;
1028 const CEikMenuPaneTitle* iMenuPaneTitle;
1029 const CEikHotKeyTable* iHotKeyTable;
1030 CEikMenuPane* iOwner;
1031 CItemArray* iItemArray;
1032 TBool iArrayOwnedExternally;
1033 TBool iAllowPointerUpEvents;
1034 TInt iNumberOfDragEvents;
1038 TInt iHotkeyColWidth;
1040 CEikScrollBarFrame* iSBFrame;
1041 CMenuScroller* iScroller;
1042 CEikButtonBase* iLaunchingButton; // for popouts only
1043 TInt iSubPopupWidth; // 0..2
1044 TBool iEnableAnimation;
1045 CEikMenuPaneExtension* iExtension ; // iSpare used for extension class pointer.