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

#include <menu.hxx>

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

Public Member Functions

 PopupMenu ()
 
 PopupMenu (const PopupMenu &rMenu)
 
virtual ~PopupMenu () override
 
virtual bool IsMenuBar () const override
 
virtual void ClosePopup (Menu *pMenu) override
 Close the 'pStartedFrom' menu window. More...
 
void SetText (const OUString &rTitle)
 
sal_uInt16 Execute (vcl::Window *pWindow, const Point &rPopupPos)
 
sal_uInt16 Execute (vcl::Window *pWindow, const tools::Rectangle &rRect, PopupMenuFlags nFlags=PopupMenuFlags::NONE)
 
void EndExecute ()
 
virtual void SelectItem (sal_uInt16 nId) override
 
void SetSelectedEntry (sal_uInt16 nId)
 
void SetLOKNotifier (const vcl::ILibreOfficeKitNotifier *pNotifier)
 Interface to register for dialog / window tunneling. More...
 
PopupMenuoperator= (const PopupMenu &rMenu)
 
- Public Member Functions inherited from Menu
SAL_DLLPRIVATE void ImplKillLayoutData () const
 
SAL_DLLPRIVATE vcl::WindowImplGetWindow () const
 
virtual ~Menu () override
 
virtual void dispose () 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
 

Static Public Member Functions

static bool IsInExecute ()
 
static PopupMenuGetActivePopupMenu ()
 

Protected Member Functions

SAL_DLLPRIVATE sal_uInt16 ImplExecute (const VclPtr< vcl::Window > &pW, const tools::Rectangle &rRect, FloatWinPopupFlags nPopupModeFlags, Menu *pSFrom, bool bPreSelectFirst)
 
SAL_DLLPRIVATE void ImplFlushPendingSelect ()
 
SAL_DLLPRIVATE long ImplCalcHeight (sal_uInt16 nEntries) const
 
SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries (long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16 *pLastVisible=nullptr) const
 
- 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)
 
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 ()
 

Private Member Functions

SAL_DLLPRIVATE MenuFloatingWindowImplGetFloatingWindow () const
 

Private Attributes

const vcl::ILibreOfficeKitNotifiermpLOKNotifier
 To emit the LOK callbacks eg. for dialog tunneling. More...
 

Friends

class Menu
 
class MenuFloatingWindow
 
class MenuBarWindow
 
struct MenuItemData
 

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 482 of file menu.hxx.

Constructor & Destructor Documentation

PopupMenu::PopupMenu ( )
PopupMenu::PopupMenu ( const PopupMenu rMenu)
PopupMenu::~PopupMenu ( )
overridevirtual

Definition at line 2720 of file menu.cxx.

References VclReferenceBase::disposeOnce().

Member Function Documentation

void PopupMenu::ClosePopup ( Menu pMenu)
overridevirtual

Close the 'pStartedFrom' menu window.

Implements Menu.

Definition at line 2725 of file menu.cxx.

References Menu::ImplGetWindow(), and MenuFloatingWindow::KillActivePopup().

void PopupMenu::EndExecute ( )
sal_uInt16 PopupMenu::Execute ( vcl::Window pWindow,
const Point rPopupPos 
)
sal_uInt16 PopupMenu::Execute ( vcl::Window pWindow,
const tools::Rectangle rRect,
PopupMenuFlags  nFlags = PopupMenuFlags::NONE 
)
PopupMenu * PopupMenu::GetActivePopupMenu ( )
static
long PopupMenu::ImplCalcHeight ( sal_uInt16  nEntries) const
protected
sal_uInt16 PopupMenu::ImplCalcVisEntries ( long  nMaxHeight,
sal_uInt16  nStartEntry,
sal_uInt16 *  pLastVisible = nullptr 
) const
protected
sal_uInt16 PopupMenu::ImplExecute ( const VclPtr< vcl::Window > &  pW,
const tools::Rectangle rRect,
FloatWinPopupFlags  nPopupModeFlags,
Menu pSFrom,
bool  bPreSelectFirst 
)
protected

Definition at line 2830 of file menu.cxx.

References Menu::Activate(), AllMouseButtonClose, Menu::bCanceled, MenuItemData::bEnabled, Menu::bInCallback, MenuItemData::bIsTemporary, Menu::bKilled, tools::Rectangle::Bottom(), tools::Rectangle::BottomRight(), Cancel, MenuFloatingWindow::ChangeHighlightItem(), CloseAll, VclPtr< reference_type >::disposeAndClear(), MenuFloatingWindow::doShutdown(), MenuFloatingWindow::EnableScrollMenu(), FloatingWindow::EndPopupMode(), MenuItemData::eType, MenuFloatingWindow::Execute(), VclPtr< reference_type >::get(), MenuFloatingWindow::GetActivePopup(), Application::GetBestScreen(), vcl::Window::GetBorder(), vcl::Window::GetBorderStyle(), vcl::Window::GetDesktopRectPixel(), MenuFloatingWindow::GetFocusId(), tools::Rectangle::GetHeight(), Menu::GetItemCount(), vcl::Window::GetParent(), Application::GetScreenCount(), Application::GetScreenPosSizePixel(), Application::GetSettings(), tools::Rectangle::GetSize(), vcl::Window::GetSizePixel(), StyleSettings::GetSkipDisabledInMenus(), AllSettings::GetStyleSettings(), vcl::Window::GetWindow(), GrabFocus, Size::Height(), HideDisabledEntries, ImplCalcHeight(), Menu::ImplCalcSize(), ImplCalcVisEntries(), Menu::ImplCallEventListeners(), FloatingWindow::ImplEndPopupMode(), ImplFlushPendingSelect(), Menu::ImplGetFirstVisible(), ImplGetFloatingWindow(), Menu::ImplGetSalMenu(), ImplGetSVData(), Menu::ImplGetVisibleItemCount(), Menu::ImplGetWindow(), Menu::ImplIsSelectable(), Menu::ImplIsVisible(), comphelper::LibreOfficeKit::isActive(), vcl::Window::IsDisposed(), IsInExecute(), Menu::IsMenuBar(), Application::IsUnifiedDisplay(), ImplSVData::maNWFData, ImplSVData::maWinData, ImplSVNWFData::mbFlatMenu, ImplSVWinData::mbNoDeactivate, MENU, MenuSubmenuActivate, MenuSubmenuChanged, ImplSVWinData::mpFirstFloat, Menu::mpLayoutData, mpLOKNotifier, Menu::NbcInsertItem(), NewLevel, MenuItemData::nId, Menu::nMenuFlags, NOBORDER, NoHorzPlacement, NoKeyClose, NONE, nPos, Menu::nSelectedId, vcl::Window::OutputToAbsoluteScreenPixel(), vcl::Window::OutputToScreenPixel(), Menu::pItemList, Menu::pStartedFrom, Menu::pWindow, RealParent, SAL_WARN_IF, SEPARATOR, vcl::Window::SetBorderStyle(), MenuFloatingWindow::SetFocusId(), Size::setHeight(), vcl::Window::SetLOKNotifier(), MenuBarWindow::SetMBWHideAccel(), vcl::Window::SetOutputSizePixel(), vcl::Window::SetParentToDefaultWindow(), tools::Rectangle::SetPos(), MenuFloatingWindow::SetPosInParent(), SalMenu::ShowNativePopupMenu(), Menu::sSelectedIdent, FloatingWindow::StartPopupMode(), MenuFloatingWindow::StopExecute(), tools::Rectangle::Top(), tools::Rectangle::TopLeft(), VclResId(), WB_BORDER, and WB_SYSTEMWINDOW.

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

void PopupMenu::ImplFlushPendingSelect ( )
protected
MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow ( ) const
private
bool PopupMenu::IsInExecute ( )
static

Definition at line 2733 of file menu.cxx.

References GetActivePopupMenu().

Referenced by ImplExecute().

virtual bool PopupMenu::IsMenuBar ( ) const
inlineoverridevirtual

Implements Menu.

Definition at line 505 of file menu.hxx.

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

Definition at line 535 of file menu.hxx.

References Menu::operator=().

void PopupMenu::SelectItem ( sal_uInt16  nId)
overridevirtual
void PopupMenu::SetLOKNotifier ( const vcl::ILibreOfficeKitNotifier pNotifier)
inline

Interface to register for dialog / window tunneling.

Definition at line 527 of file menu.hxx.

void PopupMenu::SetSelectedEntry ( sal_uInt16  nId)

Definition at line 2781 of file menu.cxx.

References Menu::GetItemIdent(), Menu::nSelectedId, and Menu::sSelectedIdent.

Referenced by VclBuilder::insertMenuObject().

void PopupMenu::SetText ( const OUString &  rTitle)
inline

Definition at line 510 of file menu.hxx.

Friends And Related Function Documentation

friend class Menu
friend

Definition at line 484 of file menu.hxx.

friend class MenuBarWindow
friend

Definition at line 486 of file menu.hxx.

friend class MenuFloatingWindow
friend

Definition at line 485 of file menu.hxx.

friend struct MenuItemData
friend

Definition at line 487 of file menu.hxx.

Member Data Documentation

const vcl::ILibreOfficeKitNotifier* PopupMenu::mpLOKNotifier
private

To emit the LOK callbacks eg. for dialog tunneling.

Definition at line 490 of file menu.hxx.

Referenced by ImplExecute().


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