LibreOffice Module framework (master) 1
|
#include <menubarmanager.hxx>
Classes | |
struct | MenuItemHandler |
Public Member Functions | |
MenuBarManager (const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Reference< css::util::XURLTransformer > &_xURLTransformer, const css::uno::Reference< css::frame::XDispatchProvider > &rDispatchProvider, const OUString &aModuleIdentifier, Menu *pMenu, bool bDelete, bool bHasMenuBar=true) | |
virtual | ~MenuBarManager () override |
virtual void SAL_CALL | statusChanged (const css::frame::FeatureStateEvent &Event) override |
virtual void SAL_CALL | frameAction (const css::frame::FrameActionEvent &Action) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &Source) override |
virtual void SAL_CALL | elementInserted (const css::ui::ConfigurationEvent &Event) override |
virtual void SAL_CALL | elementRemoved (const css::ui::ConfigurationEvent &Event) override |
virtual void SAL_CALL | elementReplaced (const css::ui::ConfigurationEvent &Event) override |
virtual css::uno::Any SAL_CALL | getMenuHandle (const css::uno::Sequence< sal_Int8 > &ProcessId, sal_Int16 SystemType) override |
DECL_LINK (Select, Menu *, bool) | |
Menu * | GetMenuBar () const |
void | FillMenuManager (Menu *pMenu, const css::uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Reference< css::frame::XDispatchProvider > &rDispatchProvider, const OUString &rModuleIdentifier, bool bDelete) |
void | SetItemContainer (const css::uno::Reference< css::container::XIndexAccess > &rItemContainer) |
void | GetPopupController (PopupControllerCache &rPopupController) |
Public Member Functions inherited from comphelper::WeakComponentImplHelper< css::frame::XStatusListener, css::frame::XFrameActionListener, css::ui::XUIConfigurationListener, css::awt::XSystemDependentMenuPeer > | |
virtual void SAL_CALL | acquire () noexcept override |
virtual void SAL_CALL | release () noexcept override |
virtual void SAL_CALL | dispose () noexcept final override |
virtual void SAL_CALL | addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override |
virtual void SAL_CALL | removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override |
virtual css::uno::Any SAL_CALL | queryInterface (css::uno::Type const &rType) override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () override |
Public Member Functions inherited from comphelper::WeakComponentImplHelperBase | |
virtual | ~WeakComponentImplHelperBase () override |
virtual void SAL_CALL | dispose () override |
virtual void SAL_CALL | addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override |
virtual void SAL_CALL | removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override |
virtual css::uno::Any SAL_CALL | queryInterface (css::uno::Type const &rType) override |
virtual void | disposing (std::unique_lock< std::mutex > &) |
Public Member Functions inherited from comphelper::UnoImplBase | |
virtual | ~UnoImplBase () |
Static Public Member Functions | |
static void | FillMenuWithConfiguration (sal_uInt16 &nId, Menu *pMenu, const OUString &rModuleIdentifier, const css::uno::Reference< css::container::XIndexAccess > &rItemContainer, const css::uno::Reference< css::util::XURLTransformer > &rTransformer) |
static void | FillMenu (sal_uInt16 &nId, Menu *pMenu, const OUString &rModuleIdentifier, const css::uno::Reference< css::container::XIndexAccess > &rItemContainer, const css::uno::Reference< css::frame::XDispatchProvider > &rDispatchProvider) |
Private Member Functions | |
DECL_LINK (Activate, Menu *, bool) | |
DECL_LINK (Deactivate, Menu *, bool) | |
DECL_LINK (AsyncSettingsHdl, Timer *, void) | |
void | disposing (std::unique_lock< std::mutex > &) override |
void | RemoveListener () |
void | RequestImages () |
void | RetrieveImageManagers () |
OUString | RetrieveLabelFromCommand (const OUString &rCmdURL) |
void | RetrieveShortcuts (std::vector< std::unique_ptr< MenuItemHandler > > &aMenuShortCuts) |
MenuItemHandler * | GetMenuItemHandler (sal_uInt16 nItemId) |
bool | CreatePopupMenuController (MenuItemHandler *pMenuItemHandler, const css::uno::Reference< css::frame::XDispatchProvider > &rDispatchProvider, const OUString &rModuleIdentifier) |
void | AddMenu (MenuBarManager *pSubMenuManager, const OUString &_sItemCommand, sal_uInt16 _nItemId) |
sal_uInt16 | FillItemCommand (OUString &_rItemCommand, Menu *_pMenu, sal_uInt16 _nIndex) const |
void | SetHdl () |
Static Private Member Functions | |
static bool | MustBeHidden (PopupMenu *pPopupMenu, const css::uno::Reference< css::util::XURLTransformer > &rTransformer) |
static void | FillMenuImages (css::uno::Reference< css::frame::XFrame > const &xFrame, Menu *_pMenu, bool bShowMenuImages) |
static void | impl_RetrieveShortcutsFromConfiguration (const css::uno::Reference< css::ui::XAcceleratorConfiguration > &rAccelCfg, const css::uno::Sequence< OUString > &rCommands, std::vector< std::unique_ptr< MenuItemHandler > > &aMenuShortCuts) |
static void | MergeAddonMenus (Menu *pMenuBar, const MergeMenuInstructionContainer &, const OUString &aModuleIdentifier) |
Private Attributes | |
bool | m_bDeleteMenu |
bool | m_bActive |
bool | m_bShowMenuImages |
bool | m_bRetrieveImages |
bool | m_bAcceleratorCfg |
bool | m_bHasMenuBar |
OUString | m_aModuleIdentifier |
VclPtr< Menu > | m_pVCLMenu |
css::uno::Reference< css::frame::XFrame > | m_xFrame |
css::uno::Reference< css::frame::XUIControllerFactory > | m_xPopupMenuControllerFactory |
::std::vector< std::unique_ptr< MenuItemHandler > > | m_aMenuItemHandlerVector |
css::uno::Reference< css::frame::XDispatchProvider > | m_xDispatchProvider |
css::uno::Reference< css::ui::XImageManager > | m_xDocImageManager |
css::uno::Reference< css::ui::XImageManager > | m_xModuleImageManager |
css::uno::Reference< css::ui::XAcceleratorConfiguration > | m_xDocAcceleratorManager |
css::uno::Reference< css::ui::XAcceleratorConfiguration > | m_xModuleAcceleratorManager |
css::uno::Reference< css::ui::XAcceleratorConfiguration > | m_xGlobalAcceleratorManager |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
css::uno::Reference< css::util::XURLTransformer > | m_xURLTransformer |
css::uno::Reference< css::container::XIndexAccess > | m_xDeferredItemContainer |
OUString | m_sIconTheme |
Timer | m_aAsyncSettingsTimer |
Additional Inherited Members | |
Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase | |
void | throwIfDisposed (std::unique_lock< std::mutex > &) |
Protected Attributes inherited from comphelper::WeakComponentImplHelperBase | |
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > | maEventListeners |
Protected Attributes inherited from comphelper::UnoImplBase | |
std::mutex | m_aMutex |
bool | m_bDisposed |
Definition at line 59 of file menubarmanager.hxx.
framework::MenuBarManager::MenuBarManager | ( | const css::uno::Reference< css::uno::XComponentContext > & | xContext, |
const css::uno::Reference< css::frame::XFrame > & | rFrame, | ||
const css::uno::Reference< css::util::XURLTransformer > & | _xURLTransformer, | ||
const css::uno::Reference< css::frame::XDispatchProvider > & | rDispatchProvider, | ||
const OUString & | aModuleIdentifier, | ||
Menu * | pMenu, | ||
bool | bDelete, | ||
bool | bHasMenuBar = true |
||
) |
Definition at line 84 of file menubarmanager.cxx.
References FillMenuManager(), m_xContext, and m_xPopupMenuControllerFactory.
Referenced by FillMenuManager().
|
overridevirtual |
Definition at line 131 of file menubarmanager.cxx.
References m_aAsyncSettingsTimer, m_xDeferredItemContainer, SAL_WARN_IF, and Task::Stop().
|
private |
Definition at line 1532 of file menubarmanager.cxx.
References m_aMenuItemHandlerVector, m_xFrame, and xDispatch.
Referenced by FillMenuManager().
|
private |
Definition at line 890 of file menubarmanager.cxx.
References framework::MenuBarManager::MenuItemHandler::aMenuItemURL, Any, aSeq, comphelper::InitAnyPropertySequence(), m_bHasMenuBar, m_xContext, m_xFrame, m_xPopupMenuControllerFactory, framework::MenuBarManager::MenuItemHandler::xPopupMenu, and framework::MenuBarManager::MenuItemHandler::xPopupMenuController.
Referenced by FillMenuManager().
|
private |
|
private |
|
private |
framework::MenuBarManager::DECL_LINK | ( | Select | , |
Menu * | , | ||
bool | |||
) |
|
overridevirtual |
|
overrideprivatevirtual |
Reimplemented from comphelper::WeakComponentImplHelperBase.
Definition at line 141 of file menubarmanager.cxx.
References VclPtr< class reference_type >::disposeAndClear(), Exception, m_aAsyncSettingsTimer, m_aMenuItemHandlerVector, m_bDeleteMenu, m_pVCLMenu, m_xContext, m_xDeferredItemContainer, m_xDocAcceleratorManager, m_xDocImageManager, m_xGlobalAcceleratorManager, m_xModuleAcceleratorManager, m_xModuleImageManager, m_xPopupMenuControllerFactory, RemoveListener(), and Task::Stop().
|
overridevirtual |
Definition at line 191 of file menubarmanager.cxx.
References comphelper::UnoImplBase::m_bDisposed, and RequestImages().
Referenced by elementRemoved(), and elementReplaced().
|
overridevirtual |
Definition at line 204 of file menubarmanager.cxx.
References elementInserted().
|
overridevirtual |
Definition at line 209 of file menubarmanager.cxx.
References elementInserted().
|
private |
Definition at line 1546 of file menubarmanager.cxx.
References Menu::GetItemCommand(), Menu::GetItemId(), and Menu::SetItemCommand().
Referenced by FillMenuManager().
|
static |
Definition at line 1289 of file menubarmanager.cxx.
References aLabel, aPropName, VclPtr< class reference_type >::Create(), framework::MenuAttributes::CreateAttribute(), Menu::EnableItem(), FillMenu(), Menu::GetItemBits(), Menu::HideItem(), Menu::InsertItem(), Menu::InsertSeparator(), vcl::CommandInfoProvider::IsExperimental(), n, nId, nType, framework::MenuAttributes::ReleaseAttribute(), Menu::SetHelpCommand(), Menu::SetItemBits(), Menu::SetItemCommand(), Menu::SetPopupMenu(), and Menu::SetUserValue().
Referenced by FillMenu(), and FillMenuWithConfiguration().
|
staticprivate |
Definition at line 1569 of file menubarmanager.cxx.
References vcl::CommandInfoProvider::GetImageForCommand(), Menu::GetItemBits(), Menu::GetItemCommand(), Menu::GetItemCount(), Menu::GetItemId(), Menu::GetItemType(), nId, nPos, and Menu::SetItemImage().
void framework::MenuBarManager::FillMenuManager | ( | Menu * | pMenu, |
const css::uno::Reference< css::frame::XFrame > & | rFrame, | ||
const css::uno::Reference< css::frame::XDispatchProvider > & | rDispatchProvider, | ||
const OUString & | rModuleIdentifier, | ||
bool | bDelete | ||
) |
Definition at line 925 of file menubarmanager.cxx.
References framework::aCmdHelpIndex, framework::aCmdHelpMenu, framework::aCmdToolsMenu, aCommand, AddMenu(), framework::MenuBarManager::MenuItemHandler::aMenuItemURL, aProperties, framework::aSpecialWindowCommand, framework::MenuAttributes::aTargetFrame, framework::AddonMenuManager::CreateAddonMenu(), CreatePopupMenuController(), VclPtr< class reference_type >::disposeAndClear(), FillItemCommand(), vcl::CommandInfoProvider::GetCommandProperties(), Menu::GetHelpCommand(), Menu::GetItemBits(), Menu::GetItemCommand(), Menu::GetItemCount(), Menu::GetItemId(), Menu::GetItemText(), Menu::GetItemType(), vcl::CommandInfoProvider::GetModuleIdentifier(), Menu::GetPopupMenu(), vcl::CommandInfoProvider::GetRealCommandForCommand(), Application::GetSettings(), AllSettings::GetStyleSettings(), StyleSettings::GetUseImagesInMenus(), Menu::GetUserValue(), framework::AddonMenuManager::HasAddonMenuElements(), i, Menu::IsMenuBar(), ITEMID_ADDONLIST, KEY_F1, framework::lcl_CheckForChildren(), m_aMenuItemHandlerVector, m_aModuleIdentifier, m_bActive, m_bDeleteMenu, m_bHasMenuBar, m_bRetrieveImages, m_bShowMenuImages, m_pVCLMenu, m_xContext, m_xDispatchProvider, m_xFrame, m_xPopupMenuControllerFactory, m_xURLTransformer, MenuBarManager(), framework::AddonMenuManager::MergeAddonHelpMenu(), framework::AddonMenuManager::MergeAddonPopupMenus(), nPos, RetrieveImageManagers(), RetrieveLabelFromCommand(), RetrieveShortcuts(), Menu::SetAccelKey(), SetHdl(), Menu::SetHelpCommand(), Menu::SetItemText(), Menu::SetPopupMenu(), xDispatch, framework::MenuAttributes::xDispatchProvider, framework::MenuBarManager::MenuItemHandler::xPopupMenu, and framework::MenuBarManager::MenuItemHandler::xPopupMenuController.
Referenced by MenuBarManager(), and SetItemContainer().
|
static |
Definition at line 1254 of file menubarmanager.cxx.
References FillMenu(), Menu::GetItemCount(), Menu::GetItemId(), Menu::GetPopupMenu(), SvtCommandOptions::HasEntriesDisabled(), Menu::HideItem(), i, MergeAddonMenus(), MustBeHidden(), nCount, and nId.
Referenced by framework::MenuBarWrapper::initialize(), and SetItemContainer().
|
overridevirtual |
Definition at line 215 of file menubarmanager.cxx.
References Action::Action(), aTargetURL, m_aMenuItemHandlerVector, comphelper::UnoImplBase::m_bDisposed, m_xURLTransformer, and URL.
|
inline |
Definition at line 98 of file menubarmanager.hxx.
References m_pVCLMenu.
Referenced by framework::IMPL_LINK(), framework::LayoutManager::implts_resetInplaceMenuBar(), framework::LayoutManager::implts_resetMenuBar(), and framework::LayoutManager::implts_updateUIElementsVisibleState().
|
overridevirtual |
Definition at line 103 of file menubarmanager.cxx.
References a, Any, comphelper::UnoImplBase::m_bDisposed, and m_pVCLMenu.
|
private |
Definition at line 358 of file menubarmanager.cxx.
References m_aMenuItemHandlerVector.
void framework::MenuBarManager::GetPopupController | ( | PopupControllerCache & | rPopupController | ) |
Definition at line 1491 of file menubarmanager.cxx.
References GetPopupController(), m_aMenuItemHandlerVector, and framework::PopupControllerEntry::m_xDispatchProvider.
Referenced by framework::MenuBarWrapper::fillPopupControllerCache(), and GetPopupController().
|
staticprivate |
Definition at line 1113 of file menubarmanager.cxx.
References i, and svt::AcceleratorExecute::st_AWTKey2VCLKey().
Referenced by RetrieveShortcuts().
|
staticprivate |
Definition at line 1404 of file menubarmanager.cxx.
References ADDONMENU_MERGE_ITEMID_START, framework::MergeMenuInstruction::aMergeCommand, framework::MergeMenuInstruction::aMergeCommandParameter, framework::MergeMenuInstruction::aMergeContext, framework::MergeMenuInstruction::aMergeFallback, framework::MergeMenuInstruction::aMergeMenu, framework::MergeMenuInstruction::aMergePoint, framework::ReferencePathInfo::eResult, framework::MenuBarMerger::FindReferencePath(), framework::MenuBarMerger::GetSubMenu(), i, framework::MenuBarMerger::IsCorrectContext(), nCount, framework::ReferencePathInfo::nPos, framework::ReferencePathInfo::pPopupMenu, framework::MenuBarMerger::ProcessFallbackOperation(), framework::MenuBarMerger::ProcessMergeOperation(), framework::MenuBarMerger::RetrieveReferencePath(), and framework::RP_OK.
Referenced by FillMenuWithConfiguration().
|
staticprivate |
Definition at line 838 of file menubarmanager.cxx.
References aTargetURL, Menu::GetItemCommand(), Menu::GetItemCount(), Menu::GetItemId(), Menu::GetPopupMenu(), Menu::HideItem(), i, SvtCommandOptions::LookupDisabled(), MustBeHidden(), nCount, nId, and URL.
Referenced by FillMenuWithConfiguration(), and MustBeHidden().
|
private |
Definition at line 387 of file menubarmanager.cxx.
References aTargetURL, Exception, m_aMenuItemHandlerVector, m_pVCLMenu, m_xFrame, m_xURLTransformer, and URL.
Referenced by disposing(), and SetItemContainer().
|
private |
Definition at line 372 of file menubarmanager.cxx.
References m_aMenuItemHandlerVector, m_bRetrieveImages, and RequestImages().
Referenced by elementInserted(), and RequestImages().
|
private |
Definition at line 1221 of file menubarmanager.cxx.
References m_aModuleIdentifier, m_xContext, m_xDocImageManager, m_xFrame, m_xModuleImageManager, xController, and xModel.
Referenced by FillMenuManager().
|
private |
Definition at line 879 of file menubarmanager.cxx.
References aProperties, vcl::CommandInfoProvider::GetCommandProperties(), vcl::CommandInfoProvider::GetMenuLabelForCommand(), vcl::CommandInfoProvider::GetPopupLabelForCommand(), m_aModuleIdentifier, and m_bHasMenuBar.
Referenced by FillMenuManager().
|
private |
Definition at line 1136 of file menubarmanager.cxx.
References aSeq, Exception, i, impl_RetrieveShortcutsFromConfiguration(), m_aModuleIdentifier, m_bAcceleratorCfg, m_xContext, m_xDocAcceleratorManager, m_xFrame, m_xGlobalAcceleratorManager, m_xModuleAcceleratorManager, nCount, SAL_WARN, xController, and xModel.
Referenced by FillMenuManager().
|
private |
Definition at line 1559 of file menubarmanager.cxx.
References LINK, m_pVCLMenu, m_xContext, m_xURLTransformer, and Select.
Referenced by FillMenuManager().
void framework::MenuBarManager::SetItemContainer | ( | const css::uno::Reference< css::container::XIndexAccess > & | rItemContainer | ) |
Definition at line 1458 of file menubarmanager.cxx.
References FillMenuManager(), FillMenuWithConfiguration(), m_aMenuItemHandlerVector, m_aModuleIdentifier, m_bActive, m_pVCLMenu, m_xDeferredItemContainer, m_xFrame, m_xURLTransformer, nId, RemoveListener(), and xFrame.
Referenced by framework::MenuBarWrapper::impl_fillNewData(), and framework::MenuBarWrapper::updateSettings().
|
overridevirtual |
Definition at line 241 of file menubarmanager.cxx.
References aURL, VclPtr< class reference_type >::clear(), FwkResId(), m_aMenuItemHandlerVector, m_aModuleIdentifier, comphelper::UnoImplBase::m_bDisposed, and m_pVCLMenu.
|
private |
Definition at line 189 of file menubarmanager.hxx.
Referenced by disposing(), and ~MenuBarManager().
|
private |
Definition at line 178 of file menubarmanager.hxx.
Referenced by AddMenu(), disposing(), FillMenuManager(), frameAction(), GetMenuItemHandler(), GetPopupController(), RemoveListener(), RequestImages(), SetItemContainer(), and statusChanged().
|
private |
Definition at line 174 of file menubarmanager.hxx.
Referenced by FillMenuManager(), RetrieveImageManagers(), RetrieveLabelFromCommand(), RetrieveShortcuts(), SetItemContainer(), and statusChanged().
|
private |
Definition at line 172 of file menubarmanager.hxx.
Referenced by RetrieveShortcuts().
|
private |
Definition at line 169 of file menubarmanager.hxx.
Referenced by FillMenuManager(), and SetItemContainer().
|
private |
Definition at line 168 of file menubarmanager.hxx.
Referenced by disposing(), and FillMenuManager().
|
private |
Definition at line 173 of file menubarmanager.hxx.
Referenced by CreatePopupMenuController(), FillMenuManager(), and RetrieveLabelFromCommand().
|
private |
Definition at line 171 of file menubarmanager.hxx.
Referenced by FillMenuManager(), and RequestImages().
|
private |
Definition at line 170 of file menubarmanager.hxx.
Referenced by FillMenuManager().
Definition at line 175 of file menubarmanager.hxx.
Referenced by disposing(), FillMenuManager(), GetMenuBar(), getMenuHandle(), RemoveListener(), SetHdl(), SetItemContainer(), and statusChanged().
|
private |
Definition at line 188 of file menubarmanager.hxx.
|
private |
Definition at line 185 of file menubarmanager.hxx.
Referenced by CreatePopupMenuController(), disposing(), FillMenuManager(), MenuBarManager(), RetrieveImageManagers(), RetrieveShortcuts(), and SetHdl().
|
private |
Definition at line 187 of file menubarmanager.hxx.
Referenced by disposing(), SetItemContainer(), and ~MenuBarManager().
|
private |
Definition at line 179 of file menubarmanager.hxx.
Referenced by FillMenuManager().
|
private |
Definition at line 182 of file menubarmanager.hxx.
Referenced by disposing(), and RetrieveShortcuts().
|
private |
Definition at line 180 of file menubarmanager.hxx.
Referenced by disposing(), and RetrieveImageManagers().
|
private |
Definition at line 176 of file menubarmanager.hxx.
Referenced by AddMenu(), CreatePopupMenuController(), FillMenuManager(), RemoveListener(), RetrieveImageManagers(), RetrieveShortcuts(), and SetItemContainer().
|
private |
Definition at line 184 of file menubarmanager.hxx.
Referenced by disposing(), and RetrieveShortcuts().
|
private |
Definition at line 183 of file menubarmanager.hxx.
Referenced by disposing(), and RetrieveShortcuts().
|
private |
Definition at line 181 of file menubarmanager.hxx.
Referenced by disposing(), and RetrieveImageManagers().
|
private |
Definition at line 177 of file menubarmanager.hxx.
Referenced by CreatePopupMenuController(), disposing(), FillMenuManager(), and MenuBarManager().
|
private |
Definition at line 186 of file menubarmanager.hxx.
Referenced by FillMenuManager(), frameAction(), RemoveListener(), SetHdl(), and SetItemContainer().