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 OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
 
void InsertItem (sal_uInt16 nItemId, const Image &rImage, MenuItemBits nItemBits=MenuItemBits::NONE, const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
 
void InsertItem (sal_uInt16 nItemId, const OUString &rString, const Image &rImage, MenuItemBits nItemBits=MenuItemBits::NONE, const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
 
void InsertSeparator (const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
 
void RemoveItem (sal_uInt16 nPos)
 
void Clear ()
 
void CreateAutoMnemonics ()
 
void SetMenuFlags (MenuFlags nFlags)
 
MenuFlags GetMenuFlags () const
 
sal_uInt16 GetItemCount () const
 
sal_uInt16 GetItemId (sal_uInt16 nPos) const
 
sal_uInt16 GetItemId (std::string_view rIdent) const
 
sal_uInt16 GetItemPos (sal_uInt16 nItemId) const
 
OString GetItemIdent (sal_uInt16 nItemId) const
 
MenuItemType GetItemType (sal_uInt16 nPos) const
 
sal_uInt16 GetCurItemId () const
 
OString 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::string_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::string_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 OString &rHelpId)
 
OString GetHelpId (sal_uInt16 nItemId) 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 SalMenuGetNativeMenuBar ()
 
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 OString &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
 
OString 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
 

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::string_view  rIdent,
bool  bCheck = true 
)

Definition at line 878 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 384 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::string_view  rIdent,
bool  bEnable = true 
)
inline

Definition at line 281 of file menu.hxx.

◆ get_id()

const OUString & Menu::get_id ( ) const
inline

Get the ID of the window.

Definition at line 398 of file menu.hxx.

Referenced by PopupMenu::PrepareRun().

◆ GetAccelKey()

KeyCode Menu::GetAccelKey ( sal_uInt16  nItemId) const

Definition at line 778 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 2303 of file menu.cxx.

References GetHelpText(), pData, and pItemList.

◆ GetAccessibleName()

OUString Menu::GetAccessibleName ( sal_uInt16  nItemId) const

Definition at line 2285 of file menu.cxx.

References pData, and pItemList.

◆ GetActivationKey()

KeyEvent Menu::GetActivationKey ( sal_uInt16  nItemId) const

Definition at line 788 of file menu.cxx.

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

◆ GetBoundingRectangle()

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

Definition at line 2258 of file menu.cxx.

References ImplFillLayoutData(), mpLayoutData, and nPos.

◆ GetCharacterBounds()

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

Definition at line 2215 of file menu.cxx.

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

◆ GetCurItemId()

sal_uInt16 Menu::GetCurItemId ( ) const
inline

◆ GetCurItemIdent()

OString const & Menu::GetCurItemIdent ( ) const
inline

◆ GetHelpCommand()

OUString Menu::GetHelpCommand ( sal_uInt16  nItemId) const

Definition at line 1056 of file menu.cxx.

References pData, and pItemList.

◆ GetHelpId()

OString Menu::GetHelpId ( sal_uInt16  nItemId) const

Definition at line 1128 of file menu.cxx.

References OUStringToOString(), pData, and pItemList.

Referenced by MenuWindow::ImplHandleHelpEvent().

◆ GetHelpText()

OUString Menu::GetHelpText ( sal_uInt16  nItemId) const

Definition at line 1097 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 2234 of file menu.cxx.

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

◆ GetItemBits()

MenuItemBits Menu::GetItemBits ( sal_uInt16  nItemId) const

Definition at line 686 of file menu.cxx.

References NONE, pData, and pItemList.

◆ GetItemCommand()

OUString Menu::GetItemCommand ( sal_uInt16  nItemId) const

Definition at line 1038 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::string_view  rIdent) const

Definition at line 633 of file menu.cxx.

References MENU_ITEM_NOTFOUND, n, pData, and pItemList.

◆ GetItemIdent()

OString Menu::GetItemIdent ( sal_uInt16  nItemId) const

◆ GetItemImage()

Image Menu::GetItemImage ( sal_uInt16  nItemId) const

Definition at line 1019 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 655 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 252 of file menu.hxx.

◆ GetNativeMenuBar()

SalMenu * Menu::GetNativeMenuBar ( )
protected

◆ GetPopupMenu()

PopupMenu * Menu::GetPopupMenu ( sal_uInt16  nItemId) const

Definition at line 750 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 2313 of file menu.cxx.

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

◆ GetTipHelpText()

OUString Menu::GetTipHelpText ( sal_uInt16  nItemId) const

Definition at line 1110 of file menu.cxx.

References pData, and pItemList.

Referenced by MenuWindow::ImplHandleHelpEvent().

◆ GetTitleHeight()

sal_uInt16 Menu::GetTitleHeight ( ) const
inline

Definition at line 334 of file menu.hxx.

Referenced by MenuFloatingWindow::ImplGetStartY().

◆ GetUserValue()

void * Menu::GetUserValue ( sal_uInt16  nItemId) const

Definition at line 707 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 2535 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 2591 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 2551 of file menu.cxx.

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

Referenced by ImplHandleMenuEvent().

◆ HideItem()

void Menu::HideItem ( sal_uInt16  nItemId)
inline

Definition at line 288 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 1373 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 1169 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 2110 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 593 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 1074 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 613 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 603 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 582 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 1700 of file menu.cxx.

References 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, Point, POPUPSELECT, PRESSED, pWindow, RADIOCHECK, RADIOCHECKMARK, SELECTED, SEPARATOR, Separator, OutputDevice::SetBackground(), OutputDevice::SetLineColor(), OutputDevice::SetTextColor(), Size::setWidth(), SPIN_RIGHT, STRING, STRINGIMAGE, SubmenuArrow, tools::Rectangle::Top(), tools::Rectangle::TopLeft(), and Size::Width().

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 1384 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 OString &  rIdent = OString(),
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 OString &  rIdent = OString(),
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 OString &  rIdent = OString(),
sal_uInt16  nPos = MENU_APPEND 
)

Definition at line 464 of file menu.cxx.

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

◆ InsertSeparator()

void Menu::InsertSeparator ( const OString &  rIdent = OString(),
sal_uInt16  nPos = MENU_APPEND 
)

◆ IsHighlighted()

bool Menu::IsHighlighted ( sal_uInt16  nItemPos) const

Definition at line 2322 of file menu.cxx.

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

◆ IsItemChecked()

bool Menu::IsItemChecked ( sal_uInt16  nItemId) const

Definition at line 883 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 928 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 1257 of file menu.cxx.

References ImplIsVisible(), and IsMenuVisible().

◆ IsMenuBar()

virtual bool Menu::IsMenuBar ( ) const
pure virtual

◆ IsMenuVisible()

bool Menu::IsMenuVisible ( ) const

Definition at line 1262 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 2183 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 OString &  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 393 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 1311 of file menu.cxx.

References mxAccessible.

◆ SetAccessibleDescription()

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

Definition at line 2295 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 319 of file menu.hxx.

◆ SetDeactivateHdl()

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

Definition at line 324 of file menu.hxx.

◆ SetHelpCommand()

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

Definition at line 1048 of file menu.cxx.

References pData, and pItemList.

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

◆ SetHelpId()

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

Definition at line 1120 of file menu.cxx.

References pData, and pItemList.

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

◆ SetHelpText()

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

Definition at line 1066 of file menu.cxx.

References pData, and pItemList.

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

◆ SetItemBits()

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

Definition at line 671 of file menu.cxx.

References ImplGetSalMenu(), nPos, pData, pItemList, and SalMenu::SetItemBits().

◆ 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 1102 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 695 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 2177 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().

◆ 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(), 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

OString Menu::sSelectedIdent
private

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