24#include <unordered_map>
28#include <com/sun/star/frame/XFrame.hpp>
29#include <com/sun/star/frame/XDispatch.hpp>
30#include <com/sun/star/frame/XDispatchProvider.hpp>
31#include <com/sun/star/frame/FeatureStateEvent.hpp>
32#include <com/sun/star/frame/XFrameActionListener.hpp>
33#include <com/sun/star/frame/XPopupMenuController.hpp>
34#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
35#include <com/sun/star/container/XIndexAccess.hpp>
36#include <com/sun/star/frame/XUIControllerFactory.hpp>
37#include <com/sun/star/ui/XUIConfigurationListener.hpp>
38#include <com/sun/star/ui/XImageManager.hpp>
39#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
40#include <com/sun/star/util/XURLTransformer.hpp>
42#include <rtl/ustring.hxx>
61 css::frame::XStatusListener,
62 css::frame::XFrameActionListener,
63 css::ui::XUIConfigurationListener,
64 css::awt::XSystemDependentMenuPeer>
68 const css::uno::Reference< css::uno::XComponentContext >& xContext,
69 const css::uno::Reference< css::frame::XFrame >& rFrame,
70 const css::uno::Reference< css::util::XURLTransformer >& _xURLTransformer,
71 const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider,
72 const OUString& aModuleIdentifier,
75 bool bHasMenuBar =
true );
80 virtual void SAL_CALL
statusChanged(
const css::frame::FeatureStateEvent& Event )
override;
83 virtual void SAL_CALL
frameAction(
const css::frame::FrameActionEvent&
Action )
override;
86 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
89 virtual void SAL_CALL
elementInserted(
const css::ui::ConfigurationEvent& Event )
override;
90 virtual void SAL_CALL
elementRemoved(
const css::ui::ConfigurationEvent& Event )
override;
91 virtual void SAL_CALL
elementReplaced(
const css::ui::ConfigurationEvent& Event )
override;
94 virtual css::uno::Any SAL_CALL
getMenuHandle(
const css::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType )
override;
102 const OUString& rModuleIdentifier,
103 const css::uno::Reference< css::container::XIndexAccess >& rItemContainer,
104 const css::uno::Reference< css::util::XURLTransformer >& rTransformer );
105 static void FillMenu( sal_uInt16& nId,
107 const OUString& rModuleIdentifier,
108 const css::uno::Reference< css::container::XIndexAccess >& rItemContainer,
109 const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider );
112 const css::uno::Reference< css::frame::XFrame >& rFrame,
113 const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider,
114 const OUString& rModuleIdentifier,
116 void SetItemContainer(
const css::uno::Reference< css::container::XIndexAccess >& rItemContainer );
124 void disposing(std::unique_lock<std::mutex>&)
override;
128 static bool MustBeHidden(
PopupMenu* pPopupMenu,
const css::uno::Reference< css::util::XURLTransformer >& rTransformer );
134 css::uno::Reference< css::frame::XStatusListener > xManager,
135 css::uno::Reference< css::frame::XDispatch > xDispatch ) :
153 void RetrieveShortcuts( std::vector< std::unique_ptr<MenuItemHandler> >& aMenuShortCuts );
154 static void FillMenuImages( css::uno::Reference< css::frame::XFrame >
const & xFrame,
Menu* _pMenu,
bool bShowMenuImages );
156 const css::uno::Sequence< OUString >& rCommands,
157 std::vector< std::unique_ptr<MenuItemHandler> >& aMenuShortCuts );
162 const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider,
163 const OUString& rModuleIdentifier );
165 sal_uInt16
FillItemCommand(OUString& _rItemCommand,
Menu* _pMenu,sal_uInt16 _nIndex)
const;
176 css::uno::Reference< css::frame::XFrame >
m_xFrame;
185 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
Reference< XDispatch > xDispatch
::std::vector< MergeMenuInstruction > MergeMenuInstructionContainer
std::unordered_map< OUString, PopupControllerEntry > PopupControllerCache
css::uno::Reference< css::frame::XDispatch > xMenuItemDispatch
MenuItemHandler(sal_uInt16 aItemId, css::uno::Reference< css::frame::XStatusListener > xManager, css::uno::Reference< css::frame::XDispatch > xDispatch)
css::uno::Reference< css::frame::XStatusListener > xSubMenuManager
css::uno::Reference< css::frame::XPopupMenuController > xPopupMenuController
css::uno::Reference< css::awt::XPopupMenu > xPopupMenu