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

#include <menu.hxx>

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

Classes

struct  MenuBarButtonCallbackArg
 

Public Member Functions

 MenuBar ()
 
 MenuBar (const MenuBar &rMenu)
 
virtual ~MenuBar () override
 
virtual void dispose () override
 
MenuBaroperator= (const MenuBar &rMenu)
 
virtual bool IsMenuBar () const override
 
virtual void ClosePopup (Menu *pMenu) override
 Close the 'pStartedFrom' menu window. More...
 
virtual void MenuBarKeyInput (const KeyEvent &rEvent) override
 Forward the KeyInput call to the MenuBar. More...
 
void ShowCloseButton (bool bShow)
 
bool HasCloseButton () const
 
bool HasFloatButton () const
 
bool HasHideButton () const
 
void ShowButtons (bool bClose, bool bFloat, bool bHide)
 
virtual void SelectItem (sal_uInt16 nId) override
 
bool HandleMenuHighlightEvent (Menu *pMenu, sal_uInt16 nEventId) const
 
bool HandleMenuButtonEvent (sal_uInt16 nEventId)
 
void SetCloseButtonClickHdl (const Link< void *, void > &rLink)
 
const Link< void *, void > & GetCloseButtonClickHdl () const
 
void SetDisplayable (bool bDisplayable)
 
bool IsDisplayable () const
 
sal_uInt16 AddMenuBarButton (const Image &, const Link< MenuBar::MenuBarButtonCallbackArg &, bool > &, const OUString &)
 
void SetMenuBarButtonHighlightHdl (sal_uInt16 nId, const Link< MenuBar::MenuBarButtonCallbackArg &, bool > &)
 
tools::Rectangle GetMenuBarButtonRectPixel (sal_uInt16 nId)
 
void RemoveMenuBarButton (sal_uInt16 nId)
 
void LayoutChanged ()
 
int GetMenuBarHeight () const
 
- Public Member Functions inherited from Menu
SAL_DLLPRIVATE void ImplKillLayoutData () const
 
SAL_DLLPRIVATE vcl::WindowImplGetWindow () const
 
virtual ~Menu () override
 
void Activate ()
 
void Deactivate ()
 
virtual 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 InsertItem (const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame)
 
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 (const OString &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)
 
voidGetUserValue (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 (const OString &rIdent, bool bCheck=true)
 
bool IsItemChecked (sal_uInt16 nItemId) const
 
void EnableItem (sal_uInt16 nItemId, bool bEnable=true)
 
void EnableItem (const OString &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
 
void RemoveDisabledEntries (bool bCheckPopups=true, 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, long nIndex) const
 
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
 
OUString GetAccessibleName (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
 
- Public Member Functions inherited from VclReferenceBase
void acquire () const
 
void release () const
 
sal_Int32 getRefCount () const
 
void disposeOnce ()
 
bool isDisposed () const
 

Protected Member Functions

MenuBarWindowgetMenuBarWindow ()
 Return the MenuBarWindow. More...
 
- Protected Member Functions inherited from Menu
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, 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 void ImplClearSalMenu ()
 
SAL_DLLPRIVATE OUString ImplGetHelpText (sal_uInt16 nItemId) const
 
SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize (vcl::RenderContext const &rRenderContext, long &rCheckHeight, 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)
 
 Menu ()
 The Menu constructor is protected. More...
 
- Protected Member Functions inherited from VclReferenceBase
 VclReferenceBase ()
 
virtual ~VclReferenceBase ()
 

Private Member Functions

SAL_DLLPRIVATE bool ImplHandleKeyEvent (const KeyEvent &rKEvent)
 
SAL_DLLPRIVATE bool ImplHandleCmdEvent (const CommandEvent &rCEvent)
 

Static Private Member Functions

static SAL_DLLPRIVATE VclPtr< vcl::WindowImplCreate (vcl::Window *pParent, vcl::Window *pWindow, MenuBar *pMenu)
 
static SAL_DLLPRIVATE void ImplDestroy (MenuBar *pMenu, bool bDelete)
 

Private Attributes

Link< void *, voidmaCloseHdl
 
bool mbCloseBtnVisible: 1
 
bool mbFloatBtnVisible: 1
 
bool mbHideBtnVisible: 1
 
bool mbDisplayable: 1
 

Friends

class Application
 
class Menu
 
class MenuBarWindow
 
class MenuFloatingWindow
 
class SystemWindow
 

Additional Inherited Members

- Static Protected Member Functions inherited from Menu
static SAL_DLLPRIVATE bool ImplGetNativeSubmenuArrowSize (vcl::RenderContext const &rRenderContext, Size &rArrowSize, long &rArrowSpacing)
 

Detailed Description

Definition at line 392 of file menu.hxx.

Constructor & Destructor Documentation

MenuBar::MenuBar ( )
MenuBar::MenuBar ( const MenuBar rMenu)
MenuBar::~MenuBar ( )
overridevirtual

Definition at line 2397 of file menu.cxx.

References VclReferenceBase::disposeOnce().

Member Function Documentation

sal_uInt16 MenuBar::AddMenuBarButton ( const Image i_rImage,
const Link< MenuBar::MenuBarButtonCallbackArg &, bool > &  i_rLink,
const OUString &  i_rToolTip 
)

Definition at line 2651 of file menu.cxx.

References MenuBarWindow::AddMenuBarButton(), and getMenuBarWindow().

void MenuBar::ClosePopup ( Menu pMenu)
overridevirtual

Close the 'pStartedFrom' menu window.

Implements Menu.

Definition at line 2408 of file menu.cxx.

References getMenuBarWindow(), and MenuBarWindow::PopupClosed().

void MenuBar::dispose ( void  )
overridevirtual

Reimplemented from Menu.

Definition at line 2402 of file menu.cxx.

References Menu::dispose(), and ImplDestroy().

const Link<void*,void>& MenuBar::GetCloseButtonClickHdl ( ) const
inline

Definition at line 443 of file menu.hxx.

tools::Rectangle MenuBar::GetMenuBarButtonRectPixel ( sal_uInt16  nId)

Definition at line 2673 of file menu.cxx.

References MenuBarWindow::GetMenuBarButtonRectPixel(), and getMenuBarWindow().

int MenuBar::GetMenuBarHeight ( ) const
MenuBarWindow * MenuBar::getMenuBarWindow ( )
protected
bool MenuBar::HandleMenuButtonEvent ( sal_uInt16  nEventId)

Definition at line 2679 of file menu.cxx.

References getMenuBarWindow(), and MenuBarWindow::HandleMenuButtonEvent().

Referenced by ImplHandleMenuEvent().

bool MenuBar::HandleMenuHighlightEvent ( Menu pMenu,
sal_uInt16  nEventId 
) const
bool MenuBar::HasCloseButton ( ) const
inline

Definition at line 433 of file menu.hxx.

Referenced by MenuBarWindow::SetMenu().

bool MenuBar::HasFloatButton ( ) const
inline

Definition at line 434 of file menu.hxx.

Referenced by MenuBarWindow::SetMenu().

bool MenuBar::HasHideButton ( ) const
inline

Definition at line 435 of file menu.hxx.

Referenced by MenuBarWindow::SetMenu().

VclPtr< vcl::Window > MenuBar::ImplCreate ( vcl::Window pParent,
vcl::Window pWindow,
MenuBar pMenu 
)
staticprivate
void MenuBar::ImplDestroy ( MenuBar pMenu,
bool  bDelete 
)
staticprivate
bool MenuBar::ImplHandleCmdEvent ( const CommandEvent rCEvent)
private
bool MenuBar::ImplHandleKeyEvent ( const KeyEvent rKEvent)
private
bool MenuBar::IsDisplayable ( ) const
inline

Definition at line 450 of file menu.hxx.

Referenced by ImplCreate(), ImplHandleCmdEvent(), and ImplHandleKeyEvent().

virtual bool MenuBar::IsMenuBar ( ) const
inlineoverridevirtual

Implements Menu.

Definition at line 424 of file menu.hxx.

void MenuBar::LayoutChanged ( )

Definition at line 2441 of file menu.cxx.

References getMenuBarWindow(), and MenuBarWindow::LayoutChanged().

Referenced by SetDisplayable().

void MenuBar::MenuBarKeyInput ( const KeyEvent rEvent)
overridevirtual

Forward the KeyInput call to the MenuBar.

Reimplemented from Menu.

Definition at line 2416 of file menu.cxx.

References vcl::Window::KeyInput(), and Menu::pWindow.

MenuBar & MenuBar::operator= ( const MenuBar rMenu)
inline

Definition at line 476 of file menu.hxx.

References Menu::operator=().

void MenuBar::RemoveMenuBarButton ( sal_uInt16  nId)

Definition at line 2665 of file menu.cxx.

References getMenuBarWindow(), and MenuBarWindow::RemoveMenuBarButton().

void MenuBar::SelectItem ( sal_uInt16  nId)
overridevirtual
void MenuBar::SetCloseButtonClickHdl ( const Link< void *, void > &  rLink)
inline

Definition at line 442 of file menu.hxx.

void MenuBar::SetDisplayable ( bool  bDisplayable)
void MenuBar::SetMenuBarButtonHighlightHdl ( sal_uInt16  nId,
const Link< MenuBar::MenuBarButtonCallbackArg &, bool > &  rLink 
)

Definition at line 2657 of file menu.cxx.

References getMenuBarWindow(), and MenuBarWindow::SetMenuBarButtonHighlightHdl().

void MenuBar::ShowButtons ( bool  bClose,
bool  bFloat,
bool  bHide 
)
void MenuBar::ShowCloseButton ( bool  bShow)

Definition at line 2421 of file menu.cxx.

References mbFloatBtnVisible, mbHideBtnVisible, and ShowButtons().

Friends And Related Function Documentation

friend class Application
friend

Definition at line 400 of file menu.hxx.

friend class Menu
friend

Definition at line 401 of file menu.hxx.

friend class MenuBarWindow
friend

Definition at line 402 of file menu.hxx.

friend class MenuFloatingWindow
friend

Definition at line 403 of file menu.hxx.

friend class SystemWindow
friend

Definition at line 404 of file menu.hxx.

Member Data Documentation

Link<void*,void> MenuBar::maCloseHdl
private

Definition at line 394 of file menu.hxx.

bool MenuBar::mbCloseBtnVisible
private

Definition at line 395 of file menu.hxx.

Referenced by ShowButtons().

bool MenuBar::mbDisplayable
private

Definition at line 398 of file menu.hxx.

Referenced by SetDisplayable().

bool MenuBar::mbFloatBtnVisible
private

Definition at line 396 of file menu.hxx.

Referenced by ShowButtons(), and ShowCloseButton().

bool MenuBar::mbHideBtnVisible
private

Definition at line 397 of file menu.hxx.

Referenced by ShowButtons(), and ShowCloseButton().


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