LibreOffice Module vcl (master) 1
|
#include <menu.hxx>
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) |
css::uno::Reference< css::awt::XPopupMenu > | CreateMenuInterface () |
PopupMenu & | operator= (const PopupMenu &rMenu) |
Public Member Functions inherited from Menu | |
SAL_DLLPRIVATE void | ImplKillLayoutData () const |
SAL_DLLPRIVATE vcl::Window * | ImplGetWindow () 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) |
PopupMenu * | GetPopupMenu (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) |
Menu & | operator= (const Menu &rMenu) |
MenuItemList * | GetItemList () 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::Window * | GetWindow () 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 |
Static Public Member Functions | |
static PopupMenu * | GetActivePopupMenu () |
Private Member Functions | |
SAL_DLLPRIVATE MenuFloatingWindow * | ImplGetFloatingWindow () const |
SAL_DLLPRIVATE bool | PrepareRun (const VclPtr< vcl::Window > &pParentWin, tools::Rectangle &rRect, FloatWinPopupFlags &nPopupModeFlags, Menu *pSFrom, bool &bRealExecute, VclPtr< MenuFloatingWindow > &) |
SAL_DLLPRIVATE bool | Run (const VclPtr< MenuFloatingWindow > &, bool bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu *pSFrom, const tools::Rectangle &rRect) |
SAL_DLLPRIVATE void | FinishRun (const VclPtr< MenuFloatingWindow > &, const VclPtr< vcl::Window > &pParentWin, bool bRealExecute, bool bIsNativeMenu) |
SAL_DLLPRIVATE sal_uInt16 | ImplExecute (const VclPtr< vcl::Window > &pParentWin, const tools::Rectangle &rRect, FloatWinPopupFlags nPopupModeFlags, Menu *pSFrom, bool bPreSelectFirst) |
SAL_DLLPRIVATE void | ImplFlushPendingSelect () |
SAL_DLLPRIVATE tools::Long | ImplCalcHeight (sal_uInt16 nEntries) const |
SAL_DLLPRIVATE sal_uInt16 | ImplCalcVisEntries (tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16 *pLastVisible=nullptr) const |
Friends | |
class | Menu |
class | MenuFloatingWindow |
class | MenuBarWindow |
struct | MenuItemData |
Additional Inherited Members | |
Protected Member Functions inherited from Menu | |
SAL_DLLPRIVATE Menu * | ImplGetStartMenu () |
SAL_DLLPRIVATE Menu * | ImplFindSelectMenu () |
SAL_DLLPRIVATE Menu * | ImplFindMenu (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 SalMenu * | ImplGetSalMenu () |
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 MenuItemData * | NbcInsertItem (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 inherited from Menu | |
static SAL_DLLPRIVATE bool | ImplGetNativeSubmenuArrowSize (vcl::RenderContext const &rRenderContext, Size &rArrowSize, tools::Long &rArrowSpacing) |
PopupMenu::PopupMenu | ( | ) |
Definition at line 2690 of file menu.cxx.
References SalInstance::CreateMenu(), ImplGetSVData(), ImplSVData::mpDefInst, and Menu::mpSalMenu.
PopupMenu::PopupMenu | ( | const PopupMenu & | rMenu | ) |
Definition at line 2695 of file menu.cxx.
References SalInstance::CreateMenu(), ImplGetSVData(), ImplSVData::mpDefInst, and Menu::mpSalMenu.
|
overridevirtual |
Definition at line 2701 of file menu.cxx.
References VclReferenceBase::disposeOnce().
|
overridevirtual |
Close the 'pStartedFrom' menu window.
Implements Menu.
Definition at line 2706 of file menu.cxx.
References Menu::ImplGetWindow(), and p.
css::uno::Reference< css::awt::XPopupMenu > PopupMenu::CreateMenuInterface | ( | ) |
Definition at line 3104 of file menu.cxx.
References UnoWrapperBase::CreateMenuInterface(), and UnoWrapperBase::GetUnoWrapper().
Referenced by ManagedMenuButton::Activate().
void PopupMenu::EndExecute | ( | ) |
Definition at line 2728 of file menu.cxx.
References MenuFloatingWindow::EndExecute(), ImplGetFloatingWindow(), and Menu::ImplGetWindow().
Referenced by MenuButton::CancelMenu(), and MenuButtonUIObject::execute().
sal_uInt16 PopupMenu::Execute | ( | vcl::Window * | pWindow, |
const Point & | rPopupPos | ||
) |
Definition at line 2771 of file menu.cxx.
References Execute(), and ExecuteDown.
Referenced by Edit::Command(), TextWindow::Command(), Execute(), ToolBox::ExecuteCustomMenu(), MenuButton::ExecuteMenu(), and SalInstanceMenu::popup_at_rect().
sal_uInt16 PopupMenu::Execute | ( | vcl::Window * | pWindow, |
const tools::Rectangle & | rRect, | ||
PopupMenuFlags | nFlags = PopupMenuFlags::NONE |
||
) |
Definition at line 2794 of file menu.cxx.
References ENSURE_OR_RETURN, ImplExecute(), and lcl_TranslateFlags().
|
private |
Definition at line 3011 of file menu.cxx.
References VclPtr< reference_type >::disposeAndClear(), FloatingWindow::EndPopupMode(), MenuFloatingWindow::GetActivePopup(), ImplFlushPendingSelect(), ImplGetFloatingWindow(), NONE, Menu::nSelectedId, and Menu::pWindow.
Referenced by ImplExecute().
|
static |
Definition at line 2722 of file menu.cxx.
References ImplGetSVData(), ImplSVData::maAppData, and ImplSVAppData::mpActivePopupMenu.
Referenced by SalInstanceToolbar::get_menu_item_active(), MenuButton::InPopupMode(), and vcl::IsInPopupMenuExecute().
|
private |
Definition at line 3084 of file menu.cxx.
References MenuFloatingWindow::GetScrollerHeight(), ImplGetFloatingWindow(), Menu::ImplIsVisible(), n, pData, Menu::pItemList, and size.
Referenced by PrepareRun().
|
private |
Definition at line 3056 of file menu.cxx.
References MenuFloatingWindow::GetScrollerHeight(), ImplGetFloatingWindow(), Menu::ImplIsVisible(), n, pData, and Menu::pItemList.
Referenced by PrepareRun().
|
private |
Definition at line 3041 of file menu.cxx.
References FinishRun(), Menu::nSelectedId, PrepareRun(), and Run().
Referenced by Execute(), and MenuBarWindow::ImplCreatePopup().
|
private |
Definition at line 2800 of file menu.cxx.
References Menu::ImplFindSelectMenu(), Menu::nEventId, Application::RemoveUserEvent(), and Menu::Select().
Referenced by FinishRun().
|
private |
Definition at line 2686 of file menu.cxx.
References Menu::ImplGetWindow().
Referenced by EndExecute(), FinishRun(), ImplCalcHeight(), ImplCalcVisEntries(), MenuBarWindow::ImplCreatePopup(), MenuFloatingWindow::KeyInput(), MenuBarWindow::KillActivePopup(), MenuFloatingWindow::KillActivePopup(), MenuFloatingWindow::MenuInHierarchyHasFocus(), MenuFloatingWindow::MouseMove(), and SelectItem().
|
inlineoverridevirtual |
Definition at line 541 of file menu.hxx.
References Menu::operator=().
|
private |
Definition at line 2813 of file menu.cxx.
References Menu::Activate(), AllMouseButtonClose, Menu::bCanceled, Menu::bInCallback, Menu::bKilled, tools::Rectangle::Bottom(), tools::Rectangle::BottomRight(), Cancel, CloseAll, FloatingWindow::EndPopupMode(), Menu::get_id(), Application::GetBestScreen(), vcl::Window::GetBorder(), tools::Rectangle::GetHeight(), Menu::GetItemCount(), vcl::Window::GetLOKNotifier(), vcl::Window::GetParent(), vcl::Window::GetParentWithLOKNotifier(), Application::GetScreenCount(), Application::GetScreenPosSizePixel(), tools::Rectangle::GetSize(), vcl::Window::GetSizePixel(), vcl::Window::GetWindow(), GrabFocus, Size::Height(), HideDisabledEntries, ImplCalcHeight(), Menu::ImplCalcSize(), ImplCalcVisEntries(), Menu::ImplCallEventListeners(), Menu::ImplGetFirstVisible(), ImplGetSVData(), Menu::ImplGetVisibleItemCount(), Menu::ImplGetWindow(), comphelper::LibreOfficeKit::isActive(), VclReferenceBase::isDisposed(), vcl::IsInPopupMenuExecute(), Menu::IsMenuBar(), ImplSVData::maNWFData, ImplSVNWFData::mbFlatMenu, ImplSVWinData::mbNoDeactivate, MENU, MenuSubmenuChanged, ImplSVWinData::mpFirstFloat, Menu::mpLayoutData, ImplSVData::mpWinData, Menu::NbcInsertItem(), NewLevel, Menu::nMenuFlags, NOBORDER, NoHorzPlacement, NoKeyClose, NONE, nPos, Menu::nSelectedId, vcl::Window::OutputToAbsoluteScreenPixel(), vcl::Window::OutputToScreenPixel(), pData, Menu::pItemList, Menu::pStartedFrom, Menu::pWindow, RealParent, SAL_WARN_IF, Size::setHeight(), tools::Rectangle::SetPos(), Menu::sSelectedIdent, tools::Rectangle::Top(), tools::Rectangle::TopLeft(), VclResId(), WB_BORDER, and WB_SYSTEMWINDOW.
Referenced by ImplExecute().
|
private |
Definition at line 2966 of file menu.cxx.
References VclPtr< reference_type >::get(), Menu::GetItemCount(), Application::GetSettings(), StyleSettings::GetSkipDisabledInMenus(), AllSettings::GetStyleSettings(), Menu::ImplCallEventListeners(), Menu::ImplGetSalMenu(), Menu::ImplIsSelectable(), Menu::ImplIsVisible(), Menu::IsMenuBar(), MenuSubmenuActivate, n, pData, Menu::pItemList, Menu::pWindow, SEPARATOR, and SalMenu::ShowNativePopupMenu().
Referenced by ImplExecute().
|
overridevirtual |
Implements Menu.
Definition at line 2734 of file menu.cxx.
References MenuFloatingWindow::ChangeHighlightItem(), MenuFloatingWindow::EndExecute(), MenuItemList::GetData(), MenuItemList::GetDataFromPos(), Menu::GetItemList(), vcl::Window::GrabFocus(), ImplGetFloatingWindow(), Menu::ImplGetWindow(), ITEMPOS_INVALID, MenuFloatingWindow::KillActivePopup(), nId, nPos, pData, and MenuItemList::size().
void PopupMenu::SetSelectedEntry | ( | sal_uInt16 | nId | ) |
Definition at line 2765 of file menu.cxx.
References Menu::GetItemIdent(), nId, Menu::nSelectedId, and Menu::sSelectedIdent.
Referenced by MenuButtonUIObject::execute().
|
friend |
|
friend |
|
friend |