1.1 --- a/epoc32/include/mw/eikmenup.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mw/eikmenup.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -2,9 +2,9 @@
1.4 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
1.5 * All rights reserved.
1.6 * This component and the accompanying materials are made available
1.7 -* 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.8 +* under the terms of "Eclipse Public License v1.0"
1.9 * which accompanies this distribution, and is available
1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 *
1.13 * Initial Contributors:
1.14 * Nokia Corporation - initial contribution.
1.15 @@ -43,6 +43,8 @@
1.16 class TEikScrollBarModel;
1.17 class CGulIcon;
1.18 class CEikMenuPaneExtension ;
1.19 +class CEikCba;
1.20 +class CAknItemActionMenuData;
1.21
1.22 // CONSTANTS
1.23 const TInt KScaleableTextSeparator = 0x0001;
1.24 @@ -252,7 +254,7 @@
1.25
1.26 inline TBool CEikMenuPaneItem::IsScaleableText(const TDesC& aText) const
1.27 {
1.28 - return (aText.Locate(TChar(KScaleableTextSeparator)) == KErrNotFound ? EFalse : ETrue);
1.29 + return aText.Locate( TChar( KScaleableTextSeparator ) ) != KErrNotFound;
1.30 }
1.31
1.32
1.33 @@ -773,14 +775,7 @@
1.34 * Deletes dimmed items from the menu item array.
1.35 */
1.36 void FilterDimmedItems();
1.37 -
1.38 - /**
1.39 - * Not implemented.
1.40 - *
1.41 - * @param aWidth Not used.
1.42 - */
1.43 - void ClipMenuItems(TInt aWidth);
1.44 -
1.45 +
1.46 /**
1.47 * Gets the menu pane for the cascade menu.
1.48 *
1.49 @@ -797,15 +792,7 @@
1.50 * @leave KErrArgument Wrong @aItemIndex.
1.51 */
1.52 IMPORT_C CEikMenuPaneItem::SData& ItemDataByIndexL(TInt aItemIndex);
1.53 -
1.54 - /**
1.55 - * Checks if the position of the menu was set from outside.
1.56 - *
1.57 - * @since S60 3.1
1.58 - * @return @c ETrue in case when position of the menu was set from outside.
1.59 - */
1.60 - TBool IsPositionToBeForced() const;
1.61 -
1.62 +
1.63 /**
1.64 * Creates and enables a special characters row to be used in the edit
1.65 * menu.
1.66 @@ -824,7 +811,6 @@
1.67 */
1.68 IMPORT_C TInt MenuItemCommandId( TInt aIndex ) const;
1.69
1.70 -
1.71 /**
1.72 * Creates and enables a special characters row to be used in the edit menu.
1.73 * The special character row is constructed from the given special character table.
1.74 @@ -863,17 +849,89 @@
1.75 */
1.76 IMPORT_C void ConstructMenuSctRowFromDialogL( TInt aCharCase, TDes& aSpecialChars, TInt aResourceId );
1.77
1.78 + /**
1.79 + * Sets menu item as item specific command.
1.80 + *
1.81 + * @param aCommandId The command associated with this menu item.
1.82 + * @param aItemSpecific ETrue to define the menu item item specific,
1.83 + * EFalse otherwise.
1.84 + */
1.85 + IMPORT_C void SetItemSpecific( TInt aCommandId, TBool aItemSpecific );
1.86 +
1.87 + /**
1.88 + * Sets the embedded cba to options menu
1.89 + *
1.90 + * @param aCba Cba to embed to menu
1.91 + *
1.92 + * @since S60 v5.2
1.93 + */
1.94 + void SetEmbeddedCba( CEikCba* aCba );
1.95 +
1.96 + /**
1.97 + * Closes and destroys any current cascade menu and takes focus back. Does
1.98 + * nothing if no cascade menu exists.
1.99 + *
1.100 + * @param aMainMenuClosing ETrue if main menu is also to be closed.
1.101 + */
1.102 + void CloseCascadeMenu( TBool aMainMenuClosing );
1.103 +
1.104 + /**
1.105 + * Symbian two-phased constructor for menu panes that are created for
1.106 + * item specific menus.
1.107 + *
1.108 + * @internal
1.109 + * @since S60 v5.2
1.110 + * @return Created menu pane. Ownership transfers to caller.
1.111 + */
1.112 + static CEikMenuPane* NewItemCommandMenuL( MEikMenuObserver* aObserver );
1.113 +
1.114 + /**
1.115 + * Sets item specific commands dimmed.
1.116 + *
1.117 + * @internal
1.118 + * @since S60 v5.2
1.119 + */
1.120 + void SetItemCommandsDimmed();
1.121 +
1.122 + /**
1.123 + * Adds menu items to this menu and item action menu data.
1.124 + *
1.125 + * @internal
1.126 + * @since S60 v5.2
1.127 + * @param aMenuData Item action menu data.
1.128 + */
1.129 + void AddMenuItemsToItemActionMenuL(
1.130 + CAknItemActionMenuData& aMenuData );
1.131 +
1.132 + /**
1.133 + * Adds cascade menu items to item action menu data.
1.134 + *
1.135 + * @internal
1.136 + * @since S60 v5.2
1.137 + * @param aCascadeId Cascade menu id.
1.138 + * @param aItemSpecific If ETrue, adds only item specific items.
1.139 + * @param aMenuData Item action menu data.
1.140 + */
1.141 + void AddCascadeMenuItemsToActionMenuL(
1.142 + TInt aCascadeId,
1.143 + TBool aItemSpecific,
1.144 + CAknItemActionMenuData& aMenuData );
1.145 +
1.146 + /**
1.147 + * Enables the default highlight in menu
1.148 + */
1.149 + void SetDefaultHighlight();
1.150 +
1.151 private:
1.152 enum { EInvalidCurrentSize=0x01, EBackgroundFaded=0x02 };
1.153
1.154 private: // new functions
1.155 TRect CalculateSizeAndPosition() ;
1.156 enum THighlightType {ENoHighlight,EDrawHighlight,ERemoveHighlight};
1.157 + void DrawItem( TInt aItem, THighlightType aHighlight ) const;
1.158 void DrawItem(CWindowGc& aGc,TInt aItem, THighlightType aHighlight) const;
1.159 - void FindHotKeyDisplayText(TDes& aDes,const CEikMenuPaneItem& aItem) const;
1.160 void ReportSelectionMadeL( TBool aAbortTransition = ETrue );
1.161 void ReportCanceled();
1.162 - void GiveVisualFeedback();
1.163 void LaunchCascadeMenuL(TInt aCascadeMenuId);
1.164 void DoLaunchCascadeMenuL(TInt aCascadeMenuId);
1.165 void TryLaunchCascadeMenuL(const CEikMenuPaneItem& aItem);
1.166 @@ -888,7 +946,6 @@
1.167 void UpdateScrollBarThumbs();
1.168 static TInt UpdateScrollBarCallBackL(TAny* aObj);
1.169 TRect ViewRect() const;
1.170 -// TInt NumberOfItemsThatFitInView() const;
1.171 TInt TotalItemHeight() const;
1.172 void ScrollToMakeItemVisible(TInt aItemIndex);
1.173 void Scroll(TInt aAmount);
1.174 @@ -896,18 +953,7 @@
1.175 void CheckCreateScrollerL();
1.176 void ResetItemArray();
1.177 void CreateItemArrayL();
1.178 - void SetVScrollBarFlag();
1.179 - TInt TopHighlightGap() const;
1.180 - TInt BottomHighlightGap() const;
1.181 - TInt EvaluateMaxIconWidth() const;
1.182 void CreateIconFromResourceL(TResourceReader& aReader, CEikMenuPaneItem& aItem) const;
1.183 - // new for AVKON
1.184 - void AnimateMenuPane(const TPoint& aNewPos);
1.185 -
1.186 - // To make layout correct
1.187 - TRect ListMenuPane() const;
1.188 - TRect PopupMenuWindow() const;
1.189 - TRect PopupSubmenuWindow() const;
1.190
1.191 // Skin support for menu
1.192 void UpdateBackgroundContext(const TRect& aWindowRect);
1.193 @@ -938,9 +984,28 @@
1.194
1.195 // fixes marquee flickering
1.196 friend class CAknMarqueeControl;
1.197 - static TInt RedrawMarqueeEvent( TAny* aControl );
1.198
1.199 CEikMenuPaneExtension* Extension() const;
1.200 +
1.201 + /**
1.202 + * Creates menu pane's extension object if it doesn't exist yet.
1.203 + */
1.204 + void CheckCreateExtensionL();
1.205 +
1.206 + /**
1.207 + * Calculates the rectangle occupied by an item.
1.208 + *
1.209 + * @param aItemIndex Item's index.
1.210 + * @return Item's rectangle.
1.211 + */
1.212 + TRect ItemRect( TInt aItemIndex ) const;
1.213 +
1.214 + /**
1.215 + * Calculates the height of menu items.
1.216 + *
1.217 + * @return Item height.
1.218 + */
1.219 + TInt CalculateItemHeight() const;
1.220
1.221 protected: // from CoeControl
1.222
1.223 @@ -978,7 +1043,7 @@
1.224 /**
1.225 * From @c CoeControl.
1.226 *
1.227 - * Gets the specified component of a compound control. This function shouldŽ
1.228 + * Gets the specified component of a compound control. This function should?
1.229 * be implemented by all compound controls.
1.230 *
1.231 * Note:
1.232 @@ -992,25 +1057,7 @@
1.233 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
1.234
1.235 protected: // new functions
1.236 -
1.237 - /**
1.238 - * Disables sliding effect
1.239 - * By default is enabled if there is enough memory.
1.240 - *
1.241 - * @since 3.1
1.242 - */
1.243 - void DisableAnimation();
1.244 -
1.245 - /**
1.246 - * The position of the menu will be changed according to the one
1.247 - * which is specified by arguments in StartDisplayingMenuPane()
1.248 - * By default those arguments are not used.
1.249 - *
1.250 - * @since 3.1
1.251 - * @param aForced @c Etrue if arguments are used.
1.252 - */
1.253 - void SetPositionToBeForced(TBool aForced);
1.254 -
1.255 +
1.256 /**
1.257 * Gets the maximum number of items which can be seen simultaneously.
1.258 *
1.259 @@ -1018,8 +1065,6 @@
1.260 */
1.261 TInt NumberOfItemsThatFitInView() const;
1.262
1.263 - void DrawNow();
1.264 -
1.265 private: // data
1.266 friend class CEikMenuButton;
1.267 MEikMenuObserver* iMenuObserver;
1.268 @@ -1041,8 +1086,8 @@
1.269 CMenuScroller* iScroller;
1.270 CEikButtonBase* iLaunchingButton; // for popouts only
1.271 TInt iSubPopupWidth; // 0..2
1.272 - TBool iEnableAnimation;
1.273 - CEikMenuPaneExtension* iExtension ; // iSpare used for extension class pointer.
1.274 + TInt iSpare;
1.275 + CEikMenuPaneExtension* iExtension;
1.276
1.277 };
1.278