summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-11-17 01:57:33 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-11-19 18:12:23 +0100
commit0a626ba2073772940fd9a4610d447e00f9afa3f9 (patch)
treebf83c25a6cf671223c1dda7808a1a6dce5fc0d14 /include/vcl
parentf8730aed0a5481c970cca8bd9f4f217d37bfb856 (diff)
WIP: async popup menus
A first patch to get some feedback. Asnyc LO popup menus are still buggy, as I'm not sure where to call the PopupMenu::Finish for them. Also the XDialogClosedListener is currently just for convenience and might want some separate notifier. Fun fact, that ImplExecute / ImplPopup is called for submenu, but then doesn't execute. And generally the naming of some variables is IMHO wrong; I might also prefix Menu members with "m_" for easier readability. Change-Id: Id8b413aa6b4699201e58db0113649c6b224d33b6
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/menu.hxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 2442eef9202f..c71f4513e5a1 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -44,6 +44,7 @@ class Menu;
class MenuItemList;
class Image;
class PopupMenu;
+struct PopupMenuFinishState;
class KeyEvent;
class MenuFloatingWindow;
class SalMenu;
@@ -54,6 +55,7 @@ enum class FloatWinPopupFlags;
enum class VclEventId;
namespace com::sun::star::awt { class XPopupMenu; }
+namespace com::sun::star::ui::dialogs { class XDialogClosedListener; }
namespace com::sun::star::accessibility { class XAccessible; }
namespace vcl
@@ -499,11 +501,16 @@ class VCL_DLLPUBLIC PopupMenu final : public Menu
friend struct MenuItemData;
private:
+ struct PopupMenuFinishState* m_pState;
+
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 bool Run(const VclPtr<MenuFloatingWindow>&, bool bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, const tools::Rectangle& rRect,
+ const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* xListener);
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 bool ImplPopup(const VclPtr<vcl::Window>& pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst,
+ const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&);
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;
@@ -526,6 +533,12 @@ public:
sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE );
+ bool Popup(vcl::Window* pParentWin, const Point& rPopupPos,
+ const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&);
+ bool Popup(vcl::Window* pParentWin, const tools::Rectangle& rRect,
+ const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&, PopupMenuFlags = PopupMenuFlags::NONE);
+ void Finish();
+
// for the TestTool
void EndExecute();
virtual void SelectItem(sal_uInt16 nId) override;