LCOV - code coverage report
Current view: top level - include/vcl - menu.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 21 35 60.0 %
Date: 2014-04-11 Functions: 19 29 65.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_VCL_MENU_HXX
      21             : #define INCLUDED_VCL_MENU_HXX
      22             : 
      23             : #include <tools/solar.h>
      24             : #include <vcl/dllapi.h>
      25             : #include <tools/rc.hxx>
      26             : #include <tools/resid.hxx>
      27             : #include <rsc/rsc-vcl-shared-types.hxx>
      28             : #include <vcl/bitmapex.hxx>
      29             : #include <tools/color.hxx>
      30             : #include <vcl/vclevent.hxx>
      31             : #include <com/sun/star/uno/Reference.hxx>
      32             : 
      33             : struct MenuItemData;
      34             : class Point;
      35             : class Size;
      36             : class Rectangle;
      37             : class Menu;
      38             : class MenuItemList;
      39             : class HelpEvent;
      40             : class Image;
      41             : class PopupMenu;
      42             : class KeyCode;
      43             : class KeyEvent;
      44             : class MenuFloatingWindow;
      45             : class Window;
      46             : class SalMenu;
      47             : struct SystemMenuData;
      48             : 
      49             : namespace com {
      50             : namespace sun {
      51             : namespace star {
      52             : namespace accessibility {
      53             :     class XAccessible;
      54             : }}}}
      55             : 
      56             : namespace vcl { struct MenuLayoutData; }
      57             : 
      58             : 
      59             : // - Menu-Types -
      60             : 
      61             : 
      62             : #define MENU_APPEND             ((sal_uInt16)0xFFFF)
      63             : #define MENU_ITEM_NOTFOUND      ((sal_uInt16)0xFFFF)
      64             : 
      65             : #define POPUPMENU_EXECUTE_DOWN     ((sal_uInt16)0x0001)
      66             : #define POPUPMENU_EXECUTE_UP       ((sal_uInt16)0x0002)
      67             : #define POPUPMENU_EXECUTE_LEFT     ((sal_uInt16)0x0004)
      68             : #define POPUPMENU_EXECUTE_RIGHT    ((sal_uInt16)0x0008)
      69             : #define POPUPMENU_NOMOUSEUPCLOSE   ((sal_uInt16)0x0010)
      70             : //If there isn't enough space to put the menu where it wants
      71             : //to go, then they will be autoplaced. Toggle this bit
      72             : //on to force menus to be placed either above or below
      73             : //the starting rectangle and shrunk to fit and then scroll rather than place
      74             : //the menu beside that rectangle
      75             : #define POPUPMENU_NOHORZ_PLACEMENT ((sal_uInt16)0x0020)
      76             : 
      77             : #define MENU_FLAG_NOAUTOMNEMONICS       0x0001
      78             : #define MENU_FLAG_HIDEDISABLEDENTRIES   0x0002
      79             : 
      80             : // overrides default hiding of disabled entries in popup menus
      81             : #define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004
      82             : 
      83             : struct ImplMenuDelData
      84             : {
      85             :     ImplMenuDelData* mpNext;
      86             :     const Menu* mpMenu;
      87             : 
      88             :     explicit ImplMenuDelData( const Menu* );
      89             :     ~ImplMenuDelData();
      90             : 
      91     1076001 :     bool isDeleted() const { return mpMenu == 0; }
      92             : };
      93             : 
      94             : 
      95             : // - Menu -
      96             : 
      97             : 
      98           0 : struct MenuLogo
      99             : {
     100             :     BitmapEx    aBitmap;
     101             :     Color       aStartColor;
     102             :     Color       aEndColor;
     103             : };
     104             : 
     105             : class VCL_DLLPUBLIC Menu : public Resource
     106             : {
     107             :     friend class MenuBar;
     108             :     friend class MenuBarWindow;
     109             :     friend class MenuButton;
     110             :     friend class MenuFloatingWindow;
     111             :     friend class PopupMenu;
     112             :     friend class SystemWindow;
     113             :     friend struct ImplMenuDelData;
     114             : private:
     115             :     ImplMenuDelData*    mpFirstDel;
     116             :     MenuItemList*       pItemList;          // Liste mit den MenuItems
     117             :     MenuLogo*           pLogo;
     118             :     Menu*               pStartedFrom;
     119             :     Window*             pWindow;
     120             : 
     121             :     Link                aActivateHdl;       // Active-Handler
     122             :     Link                aDeactivateHdl;     // Deactivate-Handler
     123             :     Link                aHighlightHdl;      // Highlight-Handler
     124             :     Link                aSelectHdl;         // Highlight-Handler
     125             : 
     126             :     VclEventListeners   maEventListeners;
     127             :     VclEventListeners   maChildEventListeners;
     128             : 
     129             :     OUString            aTitleText;         // PopupMenu text
     130             : 
     131             :     sal_uLong           nEventId;
     132             :     sal_uInt16          mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
     133             :     sal_uInt16          nMenuFlags;
     134             :     sal_uInt16          nDefaultItem;       // Id of default item
     135             :     sal_uInt16          nSelectedId;
     136             : 
     137             :     sal_uInt16          nHighlightedItem;
     138             : 
     139             :     // for output:
     140             :     sal_uInt16          nImgOrChkPos;
     141             :     sal_uInt16          nTextPos;
     142             : 
     143             :     bool            bIsMenuBar  : 1,        // Is this a menubar?
     144             :                         bCanceled   : 1,        // Terminated during a callback
     145             :                         bInCallback : 1,        // In Activate/Deactivate
     146             :                         bKilled     : 1;        // Killed...
     147             : 
     148             :     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
     149             :     mutable vcl::MenuLayoutData* mpLayoutData;
     150             :     SalMenu*            mpSalMenu;
     151             : 
     152             : protected:
     153             :     SAL_DLLPRIVATE void             ImplInit();
     154             :     SAL_DLLPRIVATE void             ImplLoadRes( const ResId& rResId );
     155             :     SAL_DLLPRIVATE Menu*            ImplGetStartMenu();
     156             :     SAL_DLLPRIVATE Menu*            ImplFindSelectMenu();
     157             :     SAL_DLLPRIVATE Menu*            ImplFindMenu( sal_uInt16 nId );
     158             :     SAL_DLLPRIVATE Size             ImplCalcSize( const Window* pWin );
     159             :     SAL_DLLPRIVATE bool             ImplIsVisible( sal_uInt16 nPos ) const;
     160             :     SAL_DLLPRIVATE bool             ImplIsSelectable( sal_uInt16 nPos ) const;
     161             :     SAL_DLLPRIVATE sal_uInt16           ImplGetVisibleItemCount() const;
     162             :     SAL_DLLPRIVATE sal_uInt16           ImplGetFirstVisible() const;
     163             :     SAL_DLLPRIVATE sal_uInt16           ImplGetPrevVisible( sal_uInt16 nPos ) const;
     164             :     SAL_DLLPRIVATE sal_uInt16           ImplGetNextVisible( sal_uInt16 nPos ) const;
     165             :     SAL_DLLPRIVATE void             ImplPaint( Window* pWin, sal_uInt16 nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, bool bHighlighted = false, bool bLayout = false, bool bRollover = false ) const;
     166             :     SAL_DLLPRIVATE void             ImplSelect();
     167             :     SAL_DLLPRIVATE void             ImplCallHighlight( sal_uInt16 nHighlightItem );
     168             :     SAL_DLLPRIVATE void             ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
     169             :     DECL_DLLPRIVATE_LINK(           ImplCallSelect, void* );
     170             : 
     171             :     SAL_DLLPRIVATE void             ImplFillLayoutData() const;
     172      337978 :     SAL_DLLPRIVATE SalMenu*         ImplGetSalMenu() { return mpSalMenu; }
     173             :     SAL_DLLPRIVATE void             ImplSetSalMenu( SalMenu *pMenu );
     174             :     SAL_DLLPRIVATE OUString         ImplGetHelpText( sal_uInt16 nItemId ) const;
     175             : 
     176             :     // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
     177             :     // return value is maximum width and height of checkboxes and radiobuttons
     178             :     SAL_DLLPRIVATE Size             ImplGetNativeCheckAndRadioSize( const Window*, long& rCheckHeight, long& rRadioHeight ) const;
     179             : 
     180             :     // returns native submenu arrow size and spacing from right border
     181             :     // return value is whether it's supported natively
     182             :     SAL_DLLPRIVATE bool         ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const;
     183             : 
     184             :     SAL_DLLPRIVATE void                ImplAddDel( ImplMenuDelData &rDel );
     185             :     SAL_DLLPRIVATE void                ImplRemoveDel( ImplMenuDelData &rDel );
     186             : public:
     187             :     SAL_DLLPRIVATE void             ImplKillLayoutData() const;
     188             :     SAL_DLLPRIVATE Menu*            ImplGetStartedFrom() const { return pStartedFrom; }
     189             : 
     190             :                             Menu();
     191             :     explicit                Menu( bool bMenuBar );
     192      242096 :     SAL_DLLPRIVATE Window*  ImplGetWindow() const { return pWindow; }
     193             :     void ImplSelectWithStart( Menu* pStartMenu = NULL );
     194             : 
     195             :     public:
     196             :     virtual             ~Menu();
     197             : 
     198             :     virtual void        Activate();
     199             :     virtual void        Deactivate();
     200             :     virtual void        Highlight();
     201             :     virtual void        Select();
     202             :     virtual void        RequestHelp( const HelpEvent& rHEvt );
     203             : 
     204             :     void                InsertItem( sal_uInt16 nItemId, const OUString& rStr,
     205             :                                     MenuItemBits nItemBits = 0,
     206             :                                     const OString &rIdent = OString(),
     207             :                                     sal_uInt16 nPos = MENU_APPEND );
     208             :     void                InsertItem( sal_uInt16 nItemId, const Image& rImage,
     209             :                                     MenuItemBits nItemBits = 0,
     210             :                                     const OString &rIdent = OString(),
     211             :                                     sal_uInt16 nPos = MENU_APPEND );
     212             :     void                InsertItem( sal_uInt16 nItemId,
     213             :                                     const OUString& rString, const Image& rImage,
     214             :                                     MenuItemBits nItemBits = 0,
     215             :                                     const OString &rIdent = OString(),
     216             :                                     sal_uInt16 nPos = MENU_APPEND );
     217             :     void                InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
     218             :     void                InsertSeparator( const OString &rIdent = OString(),
     219             :                             sal_uInt16 nPos = MENU_APPEND );
     220             :     void                RemoveItem( sal_uInt16 nPos );
     221             :     void                CopyItem( const Menu& rMenu, sal_uInt16 nPos,
     222             :                                   sal_uInt16 nNewPos = MENU_APPEND );
     223             :     void                Clear();
     224             : 
     225             :     void                CreateAutoMnemonics();
     226             : 
     227          21 :     void                SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
     228          98 :     sal_uInt16              GetMenuFlags() const { return nMenuFlags; }
     229             : 
     230             :     sal_uInt16              GetItemCount() const;
     231             :     sal_uInt16          GetItemId(sal_uInt16 nPos) const;
     232             :     sal_uInt16          GetItemId(const OString &rIdent) const;
     233             :     sal_uInt16          GetItemPos( sal_uInt16 nItemId ) const;
     234             :     OString             GetItemIdent(sal_uInt16 nItemId) const;
     235             :     MenuItemType        GetItemType( sal_uInt16 nPos ) const;
     236             :     sal_uInt16          GetCurItemId() const;
     237             :     OString             GetCurItemIdent() const;
     238             : 
     239             :     void                SetHighlightItem(sal_uInt16 nHighlightedItem);
     240             : 
     241           0 :     void                SetDefaultItem( sal_uInt16 nItemId )    { nDefaultItem = nItemId; }
     242           0 :     sal_uInt16          GetDefaultItem() const              { return nDefaultItem; }
     243             : 
     244             :     void                SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
     245             :     MenuItemBits        GetItemBits( sal_uInt16 nItemId ) const;
     246             : 
     247             :     void                SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
     248             :     sal_uLong           GetUserValue( sal_uInt16 nItemId ) const;
     249             : 
     250             :     void                SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
     251             :     PopupMenu*          GetPopupMenu( sal_uInt16 nItemId ) const;
     252             : 
     253             :     void                SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
     254             :     KeyCode             GetAccelKey( sal_uInt16 nItemId ) const;
     255             : 
     256             :     void                CheckItem( sal_uInt16 nItemId, bool bCheck = true );
     257             :     bool                IsItemChecked( sal_uInt16 nItemId ) const;
     258             : 
     259             :     void                SelectItem( sal_uInt16 nItemId );
     260             :     void                DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
     261             : 
     262             :     void                EnableItem( sal_uInt16 nItemId, bool bEnable = true );
     263           0 :     void                EnableItem(const OString &rIdent, bool bEnable = true)
     264             :     {
     265           0 :         EnableItem(GetItemId(rIdent), bEnable);
     266           0 :     }
     267             :     bool            IsItemEnabled( sal_uInt16 nItemId ) const;
     268             : 
     269             :     void                ShowItem( sal_uInt16 nItemId, bool bVisible = true );
     270           0 :     void                HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, false ); }
     271             : 
     272             :     bool            IsItemPosVisible( sal_uInt16 nItemPos ) const;
     273             :     bool            IsMenuVisible() const;
     274      275231 :     bool            IsMenuBar() const { return bIsMenuBar; }
     275             : 
     276             :     void                RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
     277             :     bool            HasValidEntries( bool bCheckPopups = true );
     278             : 
     279             :     void                SetItemText( sal_uInt16 nItemId, const OUString& rStr );
     280             :     OUString            GetItemText( sal_uInt16 nItemId ) const;
     281             : 
     282             :     void                SetItemImage( sal_uInt16 nItemId, const Image& rImage );
     283             :     Image               GetItemImage( sal_uInt16 nItemId ) const;
     284             :     void                SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
     285             :     void                SetItemImageMirrorMode( sal_uInt16 nItemId, bool bMirror );
     286             : 
     287             :     void                SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
     288             :     OUString            GetItemCommand( sal_uInt16 nItemId ) const;
     289             : 
     290             :     void                SetHelpText( sal_uInt16 nItemId, const OUString& rString );
     291             :     OUString            GetHelpText( sal_uInt16 nItemId ) const;
     292             : 
     293             :     void                SetTipHelpText( sal_uInt16 nItemId, const OUString& rString );
     294             :     OUString            GetTipHelpText( sal_uInt16 nItemId ) const;
     295             : 
     296             :     void                SetHelpCommand( sal_uInt16 nItemId, const OUString& rString );
     297             :     OUString            GetHelpCommand( sal_uInt16 nItemId ) const;
     298             : 
     299             :     void                SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
     300             :     OString             GetHelpId( sal_uInt16 nItemId ) const;
     301             : 
     302       26890 :     void                SetActivateHdl( const Link& rLink )     { aActivateHdl = rLink; }
     303             :     const Link&         GetActivateHdl() const                  { return aActivateHdl; }
     304             : 
     305       33102 :     void                SetDeactivateHdl( const Link& rLink )   { aDeactivateHdl = rLink; }
     306             :     const Link&         GetDeactivateHdl() const                { return aDeactivateHdl; }
     307             : 
     308       26890 :     void                SetHighlightHdl( const Link& rLink )    { aHighlightHdl = rLink; }
     309             :     const Link&         GetHighlightHdl() const                 { return aHighlightHdl; }
     310             : 
     311       32993 :     void                SetSelectHdl( const Link& rLink )       { aSelectHdl = rLink; }
     312             :     const Link&         GetSelectHdl() const                    { return aSelectHdl; }
     313             : 
     314             :     bool                HasLogo() const { return pLogo ? true : false; }
     315             : 
     316             :     void                AddEventListener( const Link& rEventListener );
     317             :     void                RemoveEventListener( const Link& rEventListener );
     318             :     void                AddChildEventListener( const Link& rEventListener );
     319             :     void                RemoveChildEventListener( const Link& rEventListener );
     320             : 
     321             :     Menu&               operator =( const Menu& rMenu );
     322             : 
     323             :     // Fuer Menu-'Funktionen'
     324        8139 :     MenuItemList*       GetItemList() const                     { return pItemList; }
     325             : 
     326             :     // returns the system's menu handle if native menus are supported
     327             :     // pData must point to a SystemMenuData structure
     328             :     bool                GetSystemMenuData( SystemMenuData* pData ) const;
     329             : 
     330             :     // accessibility helpers
     331             : 
     332             :     // returns the bounding box for the character at index nIndex
     333             :     // where nIndex is relative to the starting index of the item
     334             :     // with id nItemId (in coordinates of the displaying window)
     335             :     Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
     336             :     // -1 is returned if no character is at that point
     337             :     // if an index is found the corresponding item id is filled in (else 0)
     338             :     long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
     339             :     // returns the bounding rectangle for an item at pos nItemPos
     340             :     Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
     341             : 
     342             :     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
     343             :     void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
     344             : 
     345             :     // gets the activation key of the specified item
     346             :     KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
     347             : 
     348        3923 :     Window*             GetWindow() const { return pWindow; }
     349             : 
     350             :     void                SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
     351             :     OUString            GetAccessibleName( sal_uInt16 nItemId ) const;
     352             : 
     353             :     // returns whether the item a position nItemPos is highlighted or not.
     354             :     bool  IsHighlighted( sal_uInt16 nItemPos ) const;
     355             : 
     356             :     void                HighlightItem( sal_uInt16 nItemPos );
     357           0 :     void                DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
     358             : };
     359             : 
     360             : 
     361             : // - MenuBar -
     362             : 
     363             : 
     364             : class VCL_DLLPUBLIC MenuBar : public Menu
     365             : {
     366             :     Link                maCloserHdl;
     367             :     Link                maFloatHdl;
     368             :     Link                maHideHdl;
     369             :     bool            mbCloserVisible;
     370             :     bool            mbFloatBtnVisible;
     371             :     bool            mbHideBtnVisible;
     372             :     bool            mbDisplayable;
     373             : 
     374             :     friend class Application;
     375             :     friend class Menu;
     376             :     friend class MenuBarWindow;
     377             :     friend class MenuFloatingWindow;
     378             :     friend class SystemWindow;
     379             : 
     380             :     SAL_DLLPRIVATE static Window*   ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
     381             :     SAL_DLLPRIVATE static void      ImplDestroy( MenuBar* pMenu, bool bDelete );
     382             :     SAL_DLLPRIVATE bool         ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu = true );
     383             : 
     384             : public:
     385             :                         MenuBar();
     386             :                         MenuBar( const MenuBar& rMenu );
     387             :                         virtual ~MenuBar();
     388             : 
     389             :     MenuBar&            operator =( const MenuBar& rMenu );
     390             : 
     391             :     void                ShowCloser( bool bShow = true );
     392        4086 :     bool            HasCloser() const { return mbCloserVisible; }
     393        2043 :     bool            HasFloatButton() const { return mbFloatBtnVisible; }
     394        2043 :     bool            HasHideButton() const { return mbHideBtnVisible; }
     395             :     void                ShowButtons( bool bClose, bool bFloat, bool bHide );
     396             : 
     397             :     void                SelectEntry( sal_uInt16 nId );
     398             :     bool            HandleMenuActivateEvent( Menu *pMenu ) const;
     399             :     bool            HandleMenuDeActivateEvent( Menu *pMenu ) const;
     400             :     bool            HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
     401             :     bool            HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
     402             :     bool            HandleMenuButtonEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
     403             : 
     404        2835 :     void                SetCloserHdl( const Link& rLink )           { maCloserHdl = rLink; }
     405           0 :     const Link&         GetCloserHdl() const                        { return maCloserHdl; }
     406             :     void                SetFloatButtonClickHdl( const Link& rLink ) { maFloatHdl = rLink; }
     407           0 :     const Link&         GetFloatButtonClickHdl() const              { return maFloatHdl; }
     408             :     void                SetHideButtonClickHdl( const Link& rLink )  { maHideHdl = rLink; }
     409           0 :     const Link&         GetHideButtonClickHdl() const               { return maHideHdl; }
     410             : 
     411             :     //  - by default a menubar is displayable
     412             :     //  - if a menubar is not displayable, its MenuBarWindow will never be shown
     413             :     //    and it will be hidden if it was visible before
     414             :     //  - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
     415             :     void                SetDisplayable( bool bDisplayable );
     416        4627 :     bool            IsDisplayable() const                       { return mbDisplayable; }
     417             : 
     418             :     struct MenuBarButtonCallbackArg
     419             :     {
     420             :         sal_uInt16      nId;             // Id of the button
     421             :         bool            bHighlight;      // highlight on/off
     422             :         MenuBar*        pMenuBar;        // menubar the button belongs to
     423             :     };
     424             :     // add an arbitrary button to the menubar (will appear next to closer)
     425             :     // passed link will be call with a MenuBarButtonCallbackArg on press
     426             :     // passed string will be set as tooltip
     427             :     sal_uInt16          AddMenuBarButton( const Image&, const Link&, const OUString&, sal_uInt16 nPos = 0 );
     428             :     // set the highlight link for additional button with ID nId
     429             :     // highlight link will be called with a MenuBarButtonHighlightArg
     430             :     // the bHighlight member of that struct shall contain the new state
     431             :     void                SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
     432             :     // returns the rectangle occupied by the additional button named nId
     433             :     // coordinates are relative to the systemwindiow the menubar is attached to
     434             :     // if the menubar is unattached an empty rectangle is returned
     435             :     Rectangle           GetMenuBarButtonRectPixel( sal_uInt16 nId );
     436             :     void                RemoveMenuBarButton( sal_uInt16 nId );
     437             : };
     438             : 
     439           0 : inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
     440             : {
     441           0 :     Menu::operator =( rMenu );
     442           0 :     return *this;
     443             : }
     444             : 
     445             : 
     446             : 
     447             : // - PopupMenu -
     448             : 
     449             : 
     450             : class VCL_DLLPUBLIC PopupMenu : public Menu
     451             : {
     452             :     friend class Menu;
     453             :     friend class MenuFloatingWindow;
     454             :     friend class MenuBarWindow;
     455             :     friend struct MenuItemData;
     456             : 
     457             : private:
     458             :     Menu**              pRefAutoSubMenu;    // keeps track if a pointer to this Menu is stored in the MenuItemData
     459             : 
     460          32 :     SAL_DLLPRIVATE MenuFloatingWindow*   ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
     461             : 
     462             : protected:
     463             :     SAL_DLLPRIVATE sal_uInt16                ImplExecute( Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
     464             :     SAL_DLLPRIVATE long                  ImplCalcHeight( sal_uInt16 nEntries ) const;
     465             :     SAL_DLLPRIVATE sal_uInt16                ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
     466             : 
     467             : public:
     468             :                         PopupMenu();
     469             :                         PopupMenu( const PopupMenu& rMenu );
     470             :     explicit            PopupMenu( const ResId& );
     471             :     virtual             ~PopupMenu();
     472             : 
     473             :     void                SetText( const OUString& rTitle )  { aTitleText = rTitle; }
     474             :     const OUString&     GetText() const                     { return aTitleText; }
     475             : 
     476             :     sal_uInt16              Execute( Window* pWindow, const Point& rPopupPos );
     477             :     sal_uInt16              Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
     478             : 
     479             :     // Fuer das TestTool
     480             :     void                EndExecute( sal_uInt16 nSelect = 0 );
     481             :     void                SelectEntry( sal_uInt16 nId );
     482             :     void                SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
     483             : 
     484             :     static bool         IsInExecute();
     485             :     static PopupMenu*   GetActivePopupMenu();
     486             : 
     487             :     PopupMenu&          operator =( const PopupMenu& rMenu );
     488             : };
     489             : 
     490         675 : inline PopupMenu& PopupMenu::operator =( const PopupMenu& rMenu )
     491             : {
     492         675 :     Menu::operator =( rMenu );
     493         675 :     return *this;
     494             : }
     495             : 
     496             : #endif // INCLUDED_VCL_MENU_HXX
     497             : 
     498             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10