LibreOffice Module vcl (master) 1
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Friends | List of all members
Menu Class Referenceabstract

#include <menu.hxx>

Inheritance diagram for Menu:
[legend]
Collaboration diagram for Menu:
[legend]

Public Member Functions

SAL_DLLPRIVATE void ImplKillLayoutData () const
 
SAL_DLLPRIVATE vcl::WindowImplGetWindow () const
 
virtual ~Menu () override
 
virtual void dispose () override
 
void Activate ()
 
void Deactivate ()
 
void Select ()
 
void InsertItem (sal_uInt16 nItemId, const OUString &rStr, MenuItemBits nItemBits=MenuItemBits::NONE, const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
 
void InsertItem (sal_uInt16 nItemId, const Image &rImage, MenuItemBits nItemBits=MenuItemBits::NONE, const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
 
void InsertItem (sal_uInt16 nItemId, const OUString &rString, const Image &rImage, MenuItemBits nItemBits=MenuItemBits::NONE, const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
 
void InsertSeparator (const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
 
void RemoveItem (sal_uInt16 nPos)
 
void Clear ()
 
void CreateAutoMnemonics ()
 
void SetMenuFlags (MenuFlags nFlags)
 
MenuFlags GetMenuFlags () const
 
bool HasValidEntries (bool bCheckPopups) const
 
sal_uInt16 GetItemCount () const
 
sal_uInt16 GetItemId (sal_uInt16 nPos) const
 
sal_uInt16 GetItemId (std::u16string_view rIdent) const
 
sal_uInt16 GetItemPos (sal_uInt16 nItemId) const
 
OUString GetItemIdent (sal_uInt16 nItemId) const
 
MenuItemType GetItemType (sal_uInt16 nPos) const
 
sal_uInt16 GetCurItemId () const
 
OUString const & GetCurItemIdent () const
 
void SetItemBits (sal_uInt16 nItemId, MenuItemBits nBits)
 
MenuItemBits GetItemBits (sal_uInt16 nItemId) const
 
void SetUserValue (sal_uInt16 nItemId, void *nUserValue, MenuUserDataReleaseFunction aFunc=nullptr)
 
void * GetUserValue (sal_uInt16 nItemId) const
 
void SetPopupMenu (sal_uInt16 nItemId, PopupMenu *pMenu)
 
PopupMenuGetPopupMenu (sal_uInt16 nItemId) const
 
void SetAccelKey (sal_uInt16 nItemId, const vcl::KeyCode &rKeyCode)
 
vcl::KeyCode GetAccelKey (sal_uInt16 nItemId) const
 
void CheckItem (sal_uInt16 nItemId, bool bCheck=true)
 
void CheckItem (std::u16string_view rIdent, bool bCheck=true)
 
bool IsItemChecked (sal_uInt16 nItemId) const
 
virtual void SelectItem (sal_uInt16 nItemId)=0
 
void EnableItem (sal_uInt16 nItemId, bool bEnable=true)
 
void EnableItem (std::u16string_view rIdent, bool bEnable=true)
 
bool IsItemEnabled (sal_uInt16 nItemId) const
 
void ShowItem (sal_uInt16 nItemId, bool bVisible=true)
 
void HideItem (sal_uInt16 nItemId)
 
bool IsItemPosVisible (sal_uInt16 nItemPos) const
 
bool IsMenuVisible () const
 
virtual bool IsMenuBar () const =0
 
void RemoveDisabledEntries (bool bRemoveEmptyPopups=false)
 
void UpdateNativeMenu ()
 
void SetItemText (sal_uInt16 nItemId, const OUString &rStr)
 
OUString GetItemText (sal_uInt16 nItemId) const
 
void SetItemImage (sal_uInt16 nItemId, const Image &rImage)
 
Image GetItemImage (sal_uInt16 nItemId) const
 
void SetItemCommand (sal_uInt16 nItemId, const OUString &rCommand)
 
OUString GetItemCommand (sal_uInt16 nItemId) const
 
void SetHelpText (sal_uInt16 nItemId, const OUString &rString)
 
OUString GetHelpText (sal_uInt16 nItemId) const
 
void SetTipHelpText (sal_uInt16 nItemId, const OUString &rString)
 
OUString GetTipHelpText (sal_uInt16 nItemId) const
 
void SetHelpCommand (sal_uInt16 nItemId, const OUString &rString)
 
OUString GetHelpCommand (sal_uInt16 nItemId) const
 
void SetHelpId (sal_uInt16 nItemId, const OUString &rHelpId)
 
OUString GetHelpId (sal_uInt16 nItemId) const
 
void SetHelpId (const OUString &rHelpId)
 
OUString GetHelpId () const
 
void SetActivateHdl (const Link< Menu *, bool > &rLink)
 
void SetDeactivateHdl (const Link< Menu *, bool > &rLink)
 
void SetSelectHdl (const Link< Menu *, bool > &rLink)
 
sal_uInt16 GetTitleHeight () const
 
void AddEventListener (const Link< VclMenuEvent &, void > &rEventListener)
 
void RemoveEventListener (const Link< VclMenuEvent &, void > &rEventListener)
 
Menuoperator= (const Menu &rMenu)
 
MenuItemListGetItemList () const
 
void GetSystemMenuData (SystemMenuData *pData) const
 
tools::Rectangle GetCharacterBounds (sal_uInt16 nItemId, tools::Long nIndex) const
 
tools::Long GetIndexForPoint (const Point &rPoint, sal_uInt16 &rItemID) const
 
tools::Rectangle GetBoundingRectangle (sal_uInt16 nItemPos) const
 
css::uno::Reference< css::accessibility::XAccessible > GetAccessible ()
 
void SetAccessible (const css::uno::Reference< css::accessibility::XAccessible > &rxAccessible)
 
KeyEvent GetActivationKey (sal_uInt16 nItemId) const
 
vcl::WindowGetWindow () const
 
void SetAccessibleName (sal_uInt16 nItemId, const OUString &rStr)
 
OUString GetAccessibleName (sal_uInt16 nItemId) const
 
void SetAccessibleDescription (sal_uInt16 nItemId, const OUString &rStr)
 
OUString GetAccessibleDescription (sal_uInt16 nItemId) const
 
bool IsHighlighted (sal_uInt16 nItemPos) const
 
void HighlightItem (sal_uInt16 nItemPos)
 
void DeHighlight ()
 
bool HandleMenuCommandEvent (Menu *pMenu, sal_uInt16 nEventId) const
 
bool HandleMenuActivateEvent (Menu *pMenu) const
 
bool HandleMenuDeActivateEvent (Menu *pMenu) const
 
void set_id (const OUString &rID)
 Sets an ID. More...
 
const OUString & get_id () const
 Get the ID of the window. More...
 
- Public Member Functions inherited from VclReferenceBase
void acquire () const
 
void release () const
 
sal_Int32 getRefCount () const
 
void disposeOnce ()
 
bool isDisposed () const
 

Protected Member Functions

SAL_DLLPRIVATE MenuImplGetStartMenu ()
 
SAL_DLLPRIVATE MenuImplFindSelectMenu ()
 
SAL_DLLPRIVATE MenuImplFindMenu (sal_uInt16 nId)
 
SAL_DLLPRIVATE Size ImplCalcSize (vcl::Window *pWin)
 
SAL_DLLPRIVATE bool ImplIsVisible (sal_uInt16 nPos) const
 
SAL_DLLPRIVATE bool ImplCurrentlyHiddenOnGUI (sal_uInt16 nPos) const
 
SAL_DLLPRIVATE bool ImplIsSelectable (sal_uInt16 nPos) const
 
SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount () const
 
SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible () const
 
SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible (sal_uInt16 nPos) const
 
SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible (sal_uInt16 nPos) const
 
SAL_DLLPRIVATE void ImplPaint (vcl::RenderContext &rRenderContext, Size const &rSize, sal_uInt16 nBorder, tools::Long nOffY=0, MenuItemData const *pThisDataOnly=nullptr, bool bHighlighted=false, bool bLayout=false, bool bRollover=false) const
 
SAL_DLLPRIVATE void ImplPaintMenuTitle (vcl::RenderContext &, const tools::Rectangle &rRect) const
 
SAL_DLLPRIVATE void ImplSelect ()
 
SAL_DLLPRIVATE void ImplCallHighlight (sal_uInt16 nHighlightItem)
 
SAL_DLLPRIVATE void ImplCallEventListeners (VclEventId nEvent, sal_uInt16 nPos)
 
 DECL_DLLPRIVATE_LINK (ImplCallSelect, void *, void)
 
SAL_DLLPRIVATE void ImplFillLayoutData () const
 
SAL_DLLPRIVATE SalMenuImplGetSalMenu ()
 
SAL_DLLPRIVATE OUString ImplGetHelpText (sal_uInt16 nItemId) const
 
SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize (vcl::RenderContext const &rRenderContext, tools::Long &rCheckHeight, tools::Long &rRadioHeight) const
 
SAL_DLLPRIVATE void ImplAddDel (ImplMenuDelData &rDel)
 
SAL_DLLPRIVATE void ImplRemoveDel (ImplMenuDelData &rDel)
 
SAL_DLLPRIVATE MenuItemDataNbcInsertItem (sal_uInt16 nId, MenuItemBits nBits, const OUString &rStr, Menu *pMenu, size_t nPos, const OUString &rIdent)
 
virtual void ClosePopup (Menu *pMenu)=0
 Close the 'pStartedFrom' menu window. More...
 
virtual void MenuBarKeyInput (const KeyEvent &rEvent)
 Forward the KeyInput call to the MenuBar. More...
 
 Menu ()
 The Menu constructor is protected. More...
 
- Protected Member Functions inherited from VclReferenceBase
 VclReferenceBase ()
 
virtual ~VclReferenceBase ()
 
virtual void dispose ()
 

Static Protected Member Functions

static SAL_DLLPRIVATE bool ImplGetNativeSubmenuArrowSize (vcl::RenderContext const &rRenderContext, Size &rArrowSize, tools::Long &rArrowSpacing)
 

Private Attributes

ImplMenuDelDatampFirstDel
 
std::unique_ptr< MenuItemListpItemList
 
VclPtr< MenupStartedFrom
 
VclPtr< vcl::WindowpWindow
 
Link< Menu *, bool > aActivateHdl
 
Link< Menu *, bool > aDeactivateHdl
 
Link< Menu *, bool > aSelectHdl
 
std::list< Link< VclMenuEvent &, void > > maEventListeners
 
OUString maID
 
OUString aTitleText
 
sal_uInt16 nTitleHeight
 
ImplSVEventnEventId
 
sal_uInt16 mnHighlightedItemPos
 
MenuFlags nMenuFlags
 
sal_uInt16 nSelectedId
 
OUString sSelectedIdent
 
sal_uInt16 nImgOrChkPos
 
sal_uInt16 nTextPos
 
bool bCanceled: 1
 Terminated during a callback. More...
 
bool bInCallback: 1
 In Activate/Deactivate. More...
 
bool bKilled: 1
 Killed. More...
 
css::uno::Reference< css::accessibility::XAccessible > mxAccessible
 
std::unique_ptr< vcl::MenuLayoutDatampLayoutData
 
std::unique_ptr< SalMenumpSalMenu
 
OUString m_sMenuHelpId
 

Friends

class MenuBar
 
class MenuBarWindow
 
class MenuButton
 
class MenuFloatingWindow
 
class PopupMenu
 
class SystemWindow
 
struct ImplMenuDelData
 

Detailed Description

Definition at line 115 of file menu.hxx.

Constructor & Destructor Documentation

◆ Menu()

Menu::Menu ( )
protected

The Menu constructor is protected.

The callers are supposed to instantiate either PopupMenu or MenuBar, but not a Menu directly.

Definition at line 158 of file menu.cxx.

References NONE.

◆ ~Menu()

Menu::~Menu ( )
overridevirtual

Definition at line 176 of file menu.cxx.

References VclReferenceBase::disposeOnce().

Member Function Documentation

◆ Activate()

void Menu::Activate ( )

◆ AddEventListener()

void Menu::AddEventListener ( const Link< VclMenuEvent &, void > &  rEventListener)

Definition at line 407 of file menu.cxx.

References maEventListeners.

Referenced by ToolBox::ExecuteCustomMenu().

◆ CheckItem() [1/2]

void Menu::CheckItem ( sal_uInt16  nItemId,
bool  bCheck = true 
)

◆ CheckItem() [2/2]

void Menu::CheckItem ( std::u16string_view  rIdent,
bool  bCheck = true 
)

Definition at line 903 of file menu.cxx.

References CheckItem(), and GetItemId().

◆ Clear()

void Menu::Clear ( )

◆ ClosePopup()

virtual void Menu::ClosePopup ( Menu pMenu)
protectedpure virtual

Close the 'pStartedFrom' menu window.

Implemented in MenuBar, and PopupMenu.

◆ CreateAutoMnemonics()

void Menu::CreateAutoMnemonics ( )

◆ Deactivate()

void Menu::Deactivate ( )

◆ DECL_DLLPRIVATE_LINK()

Menu::DECL_DLLPRIVATE_LINK ( ImplCallSelect  ,
void *  ,
void   
)
protected

◆ DeHighlight()

void Menu::DeHighlight ( )
inline

Definition at line 389 of file menu.hxx.

◆ dispose()

void Menu::dispose ( void  )
overridevirtual

◆ EnableItem() [1/2]

void Menu::EnableItem ( sal_uInt16  nItemId,
bool  bEnable = true 
)

◆ EnableItem() [2/2]

void Menu::EnableItem ( std::u16string_view  rIdent,
bool  bEnable = true 
)
inline

Definition at line 283 of file menu.hxx.

◆ get_id()

const OUString & Menu::get_id ( ) const
inline

Get the ID of the window.

Definition at line 403 of file menu.hxx.

Referenced by PopupMenu::PrepareRun().

◆ GetAccelKey()

KeyCode Menu::GetAccelKey ( sal_uInt16  nItemId) const

Definition at line 803 of file menu.cxx.

References pData, and pItemList.

◆ GetAccessible()

css::uno::Reference< css::accessibility::XAccessible > Menu::GetAccessible ( )

◆ GetAccessibleDescription()

OUString Menu::GetAccessibleDescription ( sal_uInt16  nItemId) const

Definition at line 2326 of file menu.cxx.

References GetHelpText(), pData, and pItemList.

◆ GetAccessibleName()

OUString Menu::GetAccessibleName ( sal_uInt16  nItemId) const

Definition at line 2308 of file menu.cxx.

References pData, and pItemList.

◆ GetActivationKey()

KeyEvent Menu::GetActivationKey ( sal_uInt16  nItemId) const

Definition at line 813 of file menu.cxx.

References KEY_0, KEY_A, KEY_MOD2, nPos, pData, and pItemList.

◆ GetBoundingRectangle()

tools::Rectangle Menu::GetBoundingRectangle ( sal_uInt16  nItemPos) const

Definition at line 2281 of file menu.cxx.

References ImplFillLayoutData(), mpLayoutData, and nPos.

◆ GetCharacterBounds()

tools::Rectangle Menu::GetCharacterBounds ( sal_uInt16  nItemId,
tools::Long  nIndex 
) const

Definition at line 2238 of file menu.cxx.

References i, ImplFillLayoutData(), mpLayoutData, nIndex, and nItemID.

◆ GetCurItemId()

sal_uInt16 Menu::GetCurItemId ( ) const
inline

◆ GetCurItemIdent()

OUString const & Menu::GetCurItemIdent ( ) const
inline

◆ GetHelpCommand()

OUString Menu::GetHelpCommand ( sal_uInt16  nItemId) const

Definition at line 1081 of file menu.cxx.

References pData, and pItemList.

◆ GetHelpId() [1/2]

OUString Menu::GetHelpId ( ) const
inline

Definition at line 322 of file menu.hxx.

◆ GetHelpId() [2/2]

OUString Menu::GetHelpId ( sal_uInt16  nItemId) const

Definition at line 1156 of file menu.cxx.

References pData, and pItemList.

Referenced by MenuWindow::ImplHandleHelpEvent().

◆ GetHelpText()

OUString Menu::GetHelpText ( sal_uInt16  nItemId) const

Definition at line 1125 of file menu.cxx.

References ImplGetHelpText().

Referenced by GetAccessibleDescription(), and MenuWindow::ImplHandleHelpEvent().

◆ GetIndexForPoint()

tools::Long Menu::GetIndexForPoint ( const Point rPoint,
sal_uInt16 &  rItemID 
) const

Definition at line 2257 of file menu.cxx.

References i, ImplFillLayoutData(), mpLayoutData, and nIndex.

◆ GetItemBits()

MenuItemBits Menu::GetItemBits ( sal_uInt16  nItemId) const

Definition at line 711 of file menu.cxx.

References NONE, pData, and pItemList.

◆ GetItemCommand()

OUString Menu::GetItemCommand ( sal_uInt16  nItemId) const

Definition at line 1063 of file menu.cxx.

References pData, and pItemList.

Referenced by MenuWindow::ImplHandleHelpEvent().

◆ GetItemCount()

sal_uInt16 Menu::GetItemCount ( ) const

◆ GetItemId() [1/2]

sal_uInt16 Menu::GetItemId ( sal_uInt16  nPos) const

◆ GetItemId() [2/2]

sal_uInt16 Menu::GetItemId ( std::u16string_view  rIdent) const

Definition at line 651 of file menu.cxx.

References MENU_ITEM_NOTFOUND, n, pData, and pItemList.

◆ GetItemIdent()

OUString Menu::GetItemIdent ( sal_uInt16  nItemId) const

◆ GetItemImage()

Image Menu::GetItemImage ( sal_uInt16  nItemId) const

Definition at line 1044 of file menu.cxx.

References pData, and pItemList.

◆ GetItemList()

MenuItemList * Menu::GetItemList ( ) const
inline

◆ GetItemPos()

sal_uInt16 Menu::GetItemPos ( sal_uInt16  nItemId) const

◆ GetItemText()

OUString Menu::GetItemText ( sal_uInt16  nItemId) const

◆ GetItemType()

MenuItemType Menu::GetItemType ( sal_uInt16  nPos) const

Definition at line 673 of file menu.cxx.

References DONTKNOW, nPos, pData, and pItemList.

Referenced by CollectMenuItemIds(), ImplCopyItem(), and RemoveDisabledEntries().

◆ GetMenuFlags()

MenuFlags Menu::GetMenuFlags ( ) const
inline

Definition at line 253 of file menu.hxx.

◆ GetPopupMenu()

PopupMenu * Menu::GetPopupMenu ( sal_uInt16  nItemId) const

Definition at line 775 of file menu.cxx.

References pData, and pItemList.

Referenced by CollectMenuItemIds(), GetAccessible(), ImplCopyItem(), and MenuBarWindow::ImplCreatePopup().

◆ GetSystemMenuData()

void Menu::GetSystemMenuData ( SystemMenuData pData) const

Definition at line 2336 of file menu.cxx.

References SalMenu::GetSystemMenuData(), ImplGetSalMenu(), and pData.

◆ GetTipHelpText()

OUString Menu::GetTipHelpText ( sal_uInt16  nItemId) const

Definition at line 1138 of file menu.cxx.

References pData, and pItemList.

Referenced by MenuWindow::ImplHandleHelpEvent().

◆ GetTitleHeight()

sal_uInt16 Menu::GetTitleHeight ( ) const
inline

Definition at line 339 of file menu.hxx.

Referenced by MenuFloatingWindow::ImplGetStartY().

◆ GetUserValue()

void * Menu::GetUserValue ( sal_uInt16  nItemId) const

Definition at line 732 of file menu.cxx.

References pData, and pItemList.

◆ GetWindow()

vcl::Window * Menu::GetWindow ( ) const
inline

◆ HandleMenuActivateEvent()

bool Menu::HandleMenuActivateEvent ( Menu pMenu) const

Definition at line 2563 of file menu.cxx.

References Activate(), bInCallback, ImplMenuDelData::isDeleted(), and pStartedFrom.

Referenced by ImplHandleMenuEvent().

◆ HandleMenuCommandEvent()

bool Menu::HandleMenuCommandEvent ( Menu pMenu,
sal_uInt16  nEventId 
) const

Definition at line 2619 of file menu.cxx.

References GetItemIdent(), ImplFindMenu(), ImplSelect(), nSelectedId, pStartedFrom, and sSelectedIdent.

Referenced by ImplHandleMenuEvent().

◆ HandleMenuDeActivateEvent()

bool Menu::HandleMenuDeActivateEvent ( Menu pMenu) const

Definition at line 2579 of file menu.cxx.

References bInCallback, Deactivate(), ImplMenuDelData::isDeleted(), and pStartedFrom.

Referenced by ImplHandleMenuEvent().

◆ HasValidEntries()

bool Menu::HasValidEntries ( bool  bCheckPopups) const

◆ HideItem()

void Menu::HideItem ( sal_uInt16  nItemId)
inline

Definition at line 290 of file menu.hxx.

Referenced by VclBuilder::insertMenuObject().

◆ HighlightItem()

void Menu::HighlightItem ( sal_uInt16  nItemPos)

◆ ImplAddDel()

void Menu::ImplAddDel ( ImplMenuDelData rDel)
protected

Definition at line 1401 of file menu.cxx.

References mpFirstDel, ImplMenuDelData::mpMenu, ImplMenuDelData::mpNext, and SAL_WARN_IF.

◆ ImplCalcSize()

Size Menu::ImplCalcSize ( vcl::Window pWin)
protected

◆ ImplCallEventListeners()

void Menu::ImplCallEventListeners ( VclEventId  nEvent,
sal_uInt16  nPos 
)
protected

◆ ImplCallHighlight()

void Menu::ImplCallHighlight ( sal_uInt16  nHighlightItem)
protected

◆ ImplCurrentlyHiddenOnGUI()

bool Menu::ImplCurrentlyHiddenOnGUI ( sal_uInt16  nPos) const
protected

Definition at line 1197 of file menu.cxx.

References MenuItemData::bHiddenOnGUI, nPos, pData, and pItemList.

Referenced by MenuBarWindow::HandleKeyEvent().

◆ ImplFillLayoutData()

void Menu::ImplFillLayoutData ( ) const
protected

◆ ImplFindMenu()

Menu * Menu::ImplFindMenu ( sal_uInt16  nId)
protected

◆ ImplFindSelectMenu()

Menu * Menu::ImplFindSelectMenu ( )
protected

Definition at line 2138 of file menu.cxx.

References MenuItemList::GetDataFromPos(), GetItemList(), n, nEventId, pData, and size.

Referenced by PopupMenu::ImplFlushPendingSelect().

◆ ImplGetFirstVisible()

sal_uInt16 Menu::ImplGetFirstVisible ( ) const
protected

Definition at line 611 of file menu.cxx.

References ImplIsVisible(), ITEMPOS_INVALID, n, and pItemList.

Referenced by PopupMenu::PrepareRun().

◆ ImplGetHelpText()

OUString Menu::ImplGetHelpText ( sal_uInt16  nItemId) const
protected

Definition at line 1099 of file menu.cxx.

References Application::GetHelp(), Help::GetHelpText(), pData, and pItemList.

Referenced by GetHelpText().

◆ ImplGetNativeCheckAndRadioSize()

Size Menu::ImplGetNativeCheckAndRadioSize ( vcl::RenderContext const &  rRenderContext,
tools::Long rCheckHeight,
tools::Long rRadioHeight 
) const
protected

◆ ImplGetNativeSubmenuArrowSize()

bool Menu::ImplGetNativeSubmenuArrowSize ( vcl::RenderContext const &  rRenderContext,
Size rArrowSize,
tools::Long rArrowSpacing 
)
staticprotected

◆ ImplGetNextVisible()

sal_uInt16 Menu::ImplGetNextVisible ( sal_uInt16  nPos) const
protected

Definition at line 631 of file menu.cxx.

References ImplIsVisible(), ITEMPOS_INVALID, n, nPos, and pItemList.

Referenced by MenuFloatingWindow::ImplScroll().

◆ ImplGetPrevVisible()

sal_uInt16 Menu::ImplGetPrevVisible ( sal_uInt16  nPos) const
protected

Definition at line 621 of file menu.cxx.

References ImplIsVisible(), ITEMPOS_INVALID, n, and nPos.

Referenced by MenuFloatingWindow::ImplScroll().

◆ ImplGetSalMenu()

SAL_DLLPRIVATE SalMenu * Menu::ImplGetSalMenu ( )
inlineprotected

◆ ImplGetStartMenu()

Menu * Menu::ImplGetStartMenu ( )
protected

◆ ImplGetVisibleItemCount()

sal_uInt16 Menu::ImplGetVisibleItemCount ( ) const
protected

Definition at line 600 of file menu.cxx.

References ImplIsVisible(), n, and pItemList.

Referenced by PopupMenu::PrepareRun().

◆ ImplGetWindow()

SAL_DLLPRIVATE vcl::Window * Menu::ImplGetWindow ( ) const
inline

◆ ImplIsSelectable()

bool Menu::ImplIsSelectable ( sal_uInt16  nPos) const
protected

◆ ImplIsVisible()

bool Menu::ImplIsVisible ( sal_uInt16  nPos) const
protected

◆ ImplKillLayoutData()

void Menu::ImplKillLayoutData ( ) const

◆ ImplPaint()

void Menu::ImplPaint ( vcl::RenderContext rRenderContext,
Size const &  rSize,
sal_uInt16  nBorder,
tools::Long  nOffY = 0,
MenuItemData const *  pThisDataOnly = nullptr,
bool  bHighlighted = false,
bool  bLayout = false,
bool  bRollover = false 
) const
protected

Definition at line 1728 of file menu.cxx.

References Point::AdjustX(), Point::AdjustY(), CHECKMARK, Disable, OutputDevice::DrawCtrlText(), DecorationView::DrawFrame(), OutputDevice::DrawImage(), OutputDevice::DrawLine(), OutputDevice::DrawNativeControl(), DecorationView::DrawSymbol(), ENABLED, Entire, psp::eSymbol, tools::Rectangle::GetHeight(), StyleSettings::GetLightColor(), StyleSettings::GetMenuBarColor(), StyleSettings::GetMenuBarHighlightTextColor(), StyleSettings::GetMenuBarRolloverTextColor(), StyleSettings::GetMenuBarTextColor(), StyleSettings::GetMenuColor(), StyleSettings::GetMenuHighlightTextColor(), StyleSettings::GetMenuTextColor(), OutputDevice::GetSettings(), StyleSettings::GetShadowColor(), getShortenedString(), Image::GetSizePixel(), AllSettings::GetStyleSettings(), OutputDevice::GetTextColor(), OutputDevice::GetTextHeight(), OutputDevice::GetTextWidth(), tools::Rectangle::GetWidth(), Group, GUTTERBORDER, Size::Height(), IMAGE, ImplAccelDisabled(), ImplGetNativeCheckAndRadioSize(), ImplGetNativeSubmenuArrowSize(), ImplGetSVData(), ImplIsVisible(), ImplPaintCheckBackground(), ImplPaintMenuTitle(), OutputDevice::IsBackground(), vcl::Window::IsEnabled(), IsMenuBar(), OutputDevice::IsNativeControlSupported(), tools::Rectangle::Left(), ImplSVData::maNWFData, MenuItemCheckMark, MenuItemRadioMark, MenuPopup, Mnemonic, ImplSVNWFData::mnMenuFormatBorderX, mpLayoutData, n, nBorder, nCount, nImgOrChkPos, NONE, nState, nTextPos, nTitleHeight, pData, pItemList, POPUPSELECT, PRESSED, pWindow, RADIOCHECK, RADIOCHECKMARK, SELECTED, SEPARATOR, Separator, OutputDevice::SetBackground(), OutputDevice::SetLineColor(), OutputDevice::SetTextColor(), Size::setWidth(), Point::setX(), Point::setY(), SPIN_RIGHT, STRING, STRINGIMAGE, SubmenuArrow, tools::Rectangle::Top(), tools::Rectangle::TopLeft(), Size::Width(), Point::X(), and Point::Y().

Referenced by MenuBarWindow::HighlightItem(), ImplFillLayoutData(), MenuBarWindow::Paint(), MenuFloatingWindow::Paint(), and MenuFloatingWindow::RenderHighlightItem().

◆ ImplPaintMenuTitle()

void Menu::ImplPaintMenuTitle ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 
) const
protected

◆ ImplRemoveDel()

void Menu::ImplRemoveDel ( ImplMenuDelData rDel)
protected

Definition at line 1412 of file menu.cxx.

References mpFirstDel, ImplMenuDelData::mpMenu, ImplMenuDelData::mpNext, pData, and SAL_WARN_IF.

◆ ImplSelect()

void Menu::ImplSelect ( )
protected

◆ InsertItem() [1/3]

void Menu::InsertItem ( sal_uInt16  nItemId,
const Image rImage,
MenuItemBits  nItemBits = MenuItemBits::NONE,
const OUString &  rIdent = {},
sal_uInt16  nPos = MENU_APPEND 
)

Definition at line 457 of file menu.cxx.

References InsertItem(), nPos, and SetItemImage().

◆ InsertItem() [2/3]

void Menu::InsertItem ( sal_uInt16  nItemId,
const OUString &  rStr,
MenuItemBits  nItemBits = MenuItemBits::NONE,
const OUString &  rIdent = {},
sal_uInt16  nPos = MENU_APPEND 
)

◆ InsertItem() [3/3]

void Menu::InsertItem ( sal_uInt16  nItemId,
const OUString &  rString,
const Image rImage,
MenuItemBits  nItemBits = MenuItemBits::NONE,
const OUString &  rIdent = {},
sal_uInt16  nPos = MENU_APPEND 
)

Definition at line 464 of file menu.cxx.

References InsertItem(), nPos, and SetItemImage().

◆ InsertSeparator()

void Menu::InsertSeparator ( const OUString &  rIdent = {},
sal_uInt16  nPos = MENU_APPEND 
)

◆ IsHighlighted()

bool Menu::IsHighlighted ( sal_uInt16  nItemPos) const

Definition at line 2345 of file menu.cxx.

References VclPtr< reference_type >::get(), IsMenuBar(), and pWindow.

◆ IsItemChecked()

bool Menu::IsItemChecked ( sal_uInt16  nItemId) const

Definition at line 908 of file menu.cxx.

References nPos, pData, and pItemList.

Referenced by CheckItem(), SalInstanceMenu::get_active(), ImplCopyItem(), and ImplSelect().

◆ IsItemEnabled()

bool Menu::IsItemEnabled ( sal_uInt16  nItemId) const

Definition at line 953 of file menu.cxx.

References nPos, pData, and pItemList.

Referenced by SalInstanceMenu::get_sensitive(), and ImplCopyItem().

◆ IsItemPosVisible()

bool Menu::IsItemPosVisible ( sal_uInt16  nItemPos) const

Definition at line 1285 of file menu.cxx.

References ImplIsVisible(), and IsMenuVisible().

◆ IsMenuBar()

virtual bool Menu::IsMenuBar ( ) const
pure virtual

◆ IsMenuVisible()

bool Menu::IsMenuVisible ( ) const

Definition at line 1290 of file menu.cxx.

References vcl::Window::IsReallyVisible(), and pWindow.

Referenced by IsItemPosVisible().

◆ MenuBarKeyInput()

void Menu::MenuBarKeyInput ( const KeyEvent rEvent)
protectedvirtual

Forward the KeyInput call to the MenuBar.

Reimplemented in MenuBar.

Definition at line 2211 of file menu.cxx.

Referenced by MenuFloatingWindow::KeyInput().

◆ NbcInsertItem()

MenuItemData * Menu::NbcInsertItem ( sal_uInt16  nId,
MenuItemBits  nBits,
const OUString &  rStr,
Menu pMenu,
size_t  nPos,
const OUString &  rIdent 
)
protected

Definition at line 417 of file menu.cxx.

References ImplGetSalMenu(), SalMenu::InsertItem(), nId, nPos, pData, pItemList, and STRING.

Referenced by InsertItem(), and PopupMenu::PrepareRun().

◆ operator=()

Menu & Menu::operator= ( const Menu rMenu)

◆ RemoveDisabledEntries()

void Menu::RemoveDisabledEntries ( bool  bRemoveEmptyPopups = false)

◆ RemoveEventListener()

void Menu::RemoveEventListener ( const Link< VclMenuEvent &, void > &  rEventListener)

Definition at line 412 of file menu.cxx.

References maEventListeners.

Referenced by ToolBox::ExecuteCustomMenu().

◆ RemoveItem()

void Menu::RemoveItem ( sal_uInt16  nPos)

◆ Select()

void Menu::Select ( )

◆ SelectItem()

virtual void Menu::SelectItem ( sal_uInt16  nItemId)
pure virtual

Implemented in MenuBar, and PopupMenu.

◆ set_id()

void Menu::set_id ( const OUString &  rID)
inline

Sets an ID.

Definition at line 398 of file menu.hxx.

Referenced by VclBuilder::handleMenu().

◆ SetAccelKey()

void Menu::SetAccelKey ( sal_uInt16  nItemId,
const vcl::KeyCode rKeyCode 
)

◆ SetAccessible()

void Menu::SetAccessible ( const css::uno::Reference< css::accessibility::XAccessible > &  rxAccessible)

Definition at line 1339 of file menu.cxx.

References mxAccessible.

◆ SetAccessibleDescription()

void Menu::SetAccessibleDescription ( sal_uInt16  nItemId,
const OUString &  rStr 
)

Definition at line 2318 of file menu.cxx.

References pData, and pItemList.

Referenced by VclBuilder::insertMenuObject().

◆ SetAccessibleName()

void Menu::SetAccessibleName ( sal_uInt16  nItemId,
const OUString &  rStr 
)

◆ SetActivateHdl()

void Menu::SetActivateHdl ( const Link< Menu *, bool > &  rLink)
inline

Definition at line 324 of file menu.hxx.

◆ SetDeactivateHdl()

void Menu::SetDeactivateHdl ( const Link< Menu *, bool > &  rLink)
inline

Definition at line 329 of file menu.hxx.

◆ SetHelpCommand()

void Menu::SetHelpCommand ( sal_uInt16  nItemId,
const OUString &  rString 
)

Definition at line 1073 of file menu.cxx.

References pData, and pItemList.

Referenced by ImplCopyItem(), and MenuBarWindow::ImplCreatePopup().

◆ SetHelpId() [1/2]

void Menu::SetHelpId ( const OUString &  rHelpId)
inline

Definition at line 321 of file menu.hxx.

◆ SetHelpId() [2/2]

void Menu::SetHelpId ( sal_uInt16  nItemId,
const OUString &  rHelpId 
)

◆ SetHelpText()

void Menu::SetHelpText ( sal_uInt16  nItemId,
const OUString &  rString 
)

Definition at line 1091 of file menu.cxx.

References pData, and pItemList.

Referenced by ImplCopyItem(), and MenuBarWindow::ImplCreatePopup().

◆ SetItemBits()

void Menu::SetItemBits ( sal_uInt16  nItemId,
MenuItemBits  nBits 
)

◆ SetItemCommand()

void Menu::SetItemCommand ( sal_uInt16  nItemId,
const OUString &  rCommand 
)

◆ SetItemImage()

void Menu::SetItemImage ( sal_uInt16  nItemId,
const Image rImage 
)

◆ SetItemText()

void Menu::SetItemText ( sal_uInt16  nItemId,
const OUString &  rStr 
)

◆ SetMenuFlags()

void Menu::SetMenuFlags ( MenuFlags  nFlags)
inline

◆ SetPopupMenu()

void Menu::SetPopupMenu ( sal_uInt16  nItemId,
PopupMenu pMenu 
)

◆ SetSelectHdl()

void Menu::SetSelectHdl ( const Link< Menu *, bool > &  rLink)
inline

◆ SetTipHelpText()

void Menu::SetTipHelpText ( sal_uInt16  nItemId,
const OUString &  rString 
)

Definition at line 1130 of file menu.cxx.

References pData, and pItemList.

Referenced by VclBuilder::insertMenuObject().

◆ SetUserValue()

void Menu::SetUserValue ( sal_uInt16  nItemId,
void *  nUserValue,
MenuUserDataReleaseFunction  aFunc = nullptr 
)

Definition at line 720 of file menu.cxx.

References pData, and pItemList.

◆ ShowItem()

void Menu::ShowItem ( sal_uInt16  nItemId,
bool  bVisible = true 
)

◆ UpdateNativeMenu()

void Menu::UpdateNativeMenu ( )

Definition at line 2205 of file menu.cxx.

References ImplGetSalMenu(), and SalMenu::Update().

Friends And Related Function Documentation

◆ ImplMenuDelData

friend struct ImplMenuDelData
friend

Definition at line 123 of file menu.hxx.

◆ MenuBar

friend class MenuBar
friend

Definition at line 117 of file menu.hxx.

◆ MenuBarWindow

friend class MenuBarWindow
friend

Definition at line 118 of file menu.hxx.

◆ MenuButton

friend class MenuButton
friend

Definition at line 119 of file menu.hxx.

◆ MenuFloatingWindow

friend class MenuFloatingWindow
friend

Definition at line 120 of file menu.hxx.

◆ PopupMenu

friend class PopupMenu
friend

Definition at line 121 of file menu.hxx.

◆ SystemWindow

friend class SystemWindow
friend

Definition at line 122 of file menu.hxx.

Member Data Documentation

◆ aActivateHdl

Link<Menu*, bool> Menu::aActivateHdl
private

Definition at line 130 of file menu.hxx.

Referenced by Activate(), and operator=().

◆ aDeactivateHdl

Link<Menu*, bool> Menu::aDeactivateHdl
private

Definition at line 131 of file menu.hxx.

Referenced by Deactivate(), and operator=().

◆ aSelectHdl

Link<Menu*, bool> Menu::aSelectHdl
private

Definition at line 132 of file menu.hxx.

Referenced by operator=(), and Select().

◆ aTitleText

OUString Menu::aTitleText
private

Definition at line 138 of file menu.hxx.

Referenced by ImplCalcSize(), ImplPaintMenuTitle(), and operator=().

◆ bCanceled

bool Menu::bCanceled
private

Terminated during a callback.

Definition at line 151 of file menu.hxx.

Referenced by MenuBarWindow::KillActivePopup(), MenuFloatingWindow::KillActivePopup(), and PopupMenu::PrepareRun().

◆ bInCallback

bool Menu::bInCallback
private

◆ bKilled

bool Menu::bKilled
private

Killed.

Definition at line 153 of file menu.hxx.

Referenced by dispose(), and PopupMenu::PrepareRun().

◆ m_sMenuHelpId

OUString Menu::m_sMenuHelpId
private

Definition at line 160 of file menu.hxx.

◆ maEventListeners

std::list<Link<VclMenuEvent&,void> > Menu::maEventListeners
private

Definition at line 134 of file menu.hxx.

Referenced by AddEventListener(), ImplCallEventListeners(), and RemoveEventListener().

◆ maID

OUString Menu::maID
private

Definition at line 136 of file menu.hxx.

◆ mnHighlightedItemPos

sal_uInt16 Menu::mnHighlightedItemPos
private

Definition at line 142 of file menu.hxx.

Referenced by MenuBar::HandleMenuHighlightEvent().

◆ mpFirstDel

ImplMenuDelData* Menu::mpFirstDel
private

Definition at line 125 of file menu.hxx.

Referenced by dispose(), ImplAddDel(), and ImplRemoveDel().

◆ mpLayoutData

std::unique_ptr<vcl::MenuLayoutData> Menu::mpLayoutData
mutableprivate

◆ mpSalMenu

std::unique_ptr<SalMenu> Menu::mpSalMenu
private

◆ mxAccessible

css::uno::Reference<css::accessibility::XAccessible > Menu::mxAccessible
private

Definition at line 155 of file menu.hxx.

Referenced by dispose(), GetAccessible(), and SetAccessible().

◆ nEventId

ImplSVEvent* Menu::nEventId
private

◆ nImgOrChkPos

sal_uInt16 Menu::nImgOrChkPos
private

Definition at line 148 of file menu.hxx.

Referenced by ImplCalcSize(), and ImplPaint().

◆ nMenuFlags

MenuFlags Menu::nMenuFlags
private

Definition at line 143 of file menu.hxx.

Referenced by Activate(), ImplIsVisible(), and PopupMenu::PrepareRun().

◆ nSelectedId

sal_uInt16 Menu::nSelectedId
private

◆ nTextPos

sal_uInt16 Menu::nTextPos
private

◆ nTitleHeight

sal_uInt16 Menu::nTitleHeight
private

Definition at line 139 of file menu.hxx.

Referenced by ImplCalcSize(), ImplPaint(), ImplPaintMenuTitle(), and operator=().

◆ pItemList

std::unique_ptr<MenuItemList> Menu::pItemList
private

Definition at line 126 of file menu.hxx.

Referenced by MenuBarWindow::ChangeHighlightItem(), MenuFloatingWindow::ChangeHighlightItem(), CheckItem(), CreateAutoMnemonics(), Deactivate(), dispose(), MenuFloatingWindow::doShutdown(), EnableItem(), GetAccelKey(), GetAccessibleDescription(), GetAccessibleName(), GetActivationKey(), GetHelpCommand(), GetHelpId(), GetItemBits(), GetItemCommand(), GetItemCount(), GetItemId(), GetItemIdent(), GetItemImage(), GetItemPos(), GetItemText(), GetItemType(), GetPopupMenu(), GetTipHelpText(), GetUserValue(), HasValidEntries(), MenuBarWindow::HighlightItem(), PopupMenu::ImplCalcHeight(), ImplCalcSize(), PopupMenu::ImplCalcVisEntries(), ImplCallHighlight(), MenuBarWindow::ImplCreatePopup(), ImplCurrentlyHiddenOnGUI(), MenuBarWindow::ImplFindEntry(), ImplGetFirstVisible(), ImplGetHelpText(), MenuBarWindow::ImplGetItemRect(), MenuFloatingWindow::ImplGetItemRect(), ImplGetNextVisible(), ImplGetVisibleItemCount(), MenuFloatingWindow::ImplHighlightItem(), ImplIsSelectable(), ImplIsVisible(), ImplPaint(), InsertItem(), InsertSeparator(), MenuFloatingWindow::InvalidateItem(), IsItemChecked(), IsItemEnabled(), MenuFloatingWindow::MouseMove(), NbcInsertItem(), PopupMenu::PrepareRun(), RemoveDisabledEntries(), RemoveItem(), MenuFloatingWindow::RenderHighlightItem(), PopupMenu::Run(), SetAccelKey(), SetAccessibleDescription(), SetAccessibleName(), SetHelpCommand(), SetHelpId(), SetHelpText(), SetItemBits(), SetItemCommand(), SetItemImage(), SetItemText(), SetPopupMenu(), SetTipHelpText(), SetUserValue(), and ShowItem().

◆ pStartedFrom

VclPtr<Menu> Menu::pStartedFrom
private

◆ pWindow

VclPtr<vcl::Window> Menu::pWindow
private

◆ sSelectedIdent

OUString Menu::sSelectedIdent
private

The documentation for this class was generated from the following files: