LibreOffice Module framework (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
framework::MenuBarManager Class Referencefinal

#include <menubarmanager.hxx>

Inheritance diagram for framework::MenuBarManager:
[legend]
Collaboration diagram for framework::MenuBarManager:
[legend]

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)
 
MenuGetMenuBar () 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)
 
MenuItemHandlerGetMenuItemHandler (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< Menum_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
 

Detailed Description

Definition at line 59 of file menubarmanager.hxx.

Constructor & Destructor Documentation

◆ MenuBarManager()

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().

◆ ~MenuBarManager()

framework::MenuBarManager::~MenuBarManager ( )
overridevirtual

Member Function Documentation

◆ AddMenu()

void framework::MenuBarManager::AddMenu ( MenuBarManager pSubMenuManager,
const OUString &  _sItemCommand,
sal_uInt16  _nItemId 
)
private

Definition at line 1532 of file menubarmanager.cxx.

References m_aMenuItemHandlerVector, m_xFrame, and xDispatch.

Referenced by FillMenuManager().

◆ CreatePopupMenuController()

bool framework::MenuBarManager::CreatePopupMenuController ( MenuItemHandler pMenuItemHandler,
const css::uno::Reference< css::frame::XDispatchProvider > &  rDispatchProvider,
const OUString &  rModuleIdentifier 
)
private

◆ DECL_LINK() [1/4]

framework::MenuBarManager::DECL_LINK ( Activate  ,
Menu ,
bool   
)
private

◆ DECL_LINK() [2/4]

framework::MenuBarManager::DECL_LINK ( AsyncSettingsHdl  ,
Timer ,
void   
)
private

◆ DECL_LINK() [3/4]

framework::MenuBarManager::DECL_LINK ( Deactivate  ,
Menu ,
bool   
)
private

◆ DECL_LINK() [4/4]

framework::MenuBarManager::DECL_LINK ( Select  ,
Menu ,
bool   
)

◆ disposing() [1/2]

virtual void SAL_CALL framework::MenuBarManager::disposing ( const css::lang::EventObject &  Source)
overridevirtual

◆ disposing() [2/2]

void framework::MenuBarManager::disposing ( std::unique_lock< std::mutex > &  )
overrideprivatevirtual

◆ elementInserted()

void SAL_CALL framework::MenuBarManager::elementInserted ( const css::ui::ConfigurationEvent &  Event)
overridevirtual

Definition at line 191 of file menubarmanager.cxx.

References comphelper::UnoImplBase::m_bDisposed, and RequestImages().

Referenced by elementRemoved(), and elementReplaced().

◆ elementRemoved()

void SAL_CALL framework::MenuBarManager::elementRemoved ( const css::ui::ConfigurationEvent &  Event)
overridevirtual

Definition at line 204 of file menubarmanager.cxx.

References elementInserted().

◆ elementReplaced()

void SAL_CALL framework::MenuBarManager::elementReplaced ( const css::ui::ConfigurationEvent &  Event)
overridevirtual

Definition at line 209 of file menubarmanager.cxx.

References elementInserted().

◆ FillItemCommand()

sal_uInt16 framework::MenuBarManager::FillItemCommand ( OUString &  _rItemCommand,
Menu _pMenu,
sal_uInt16  _nIndex 
) const
private

Definition at line 1546 of file menubarmanager.cxx.

References Menu::GetItemCommand(), Menu::GetItemId(), and Menu::SetItemCommand().

Referenced by FillMenuManager().

◆ FillMenu()

void framework::MenuBarManager::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 
)
static

◆ FillMenuImages()

void framework::MenuBarManager::FillMenuImages ( css::uno::Reference< css::frame::XFrame > const &  xFrame,
Menu _pMenu,
bool  bShowMenuImages 
)
staticprivate

◆ FillMenuManager()

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().

◆ FillMenuWithConfiguration()

void framework::MenuBarManager::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

◆ frameAction()

void SAL_CALL framework::MenuBarManager::frameAction ( const css::frame::FrameActionEvent &  Action)
overridevirtual

◆ GetMenuBar()

Menu * framework::MenuBarManager::GetMenuBar ( ) const
inline

◆ getMenuHandle()

Any SAL_CALL framework::MenuBarManager::getMenuHandle ( const css::uno::Sequence< sal_Int8 > &  ProcessId,
sal_Int16  SystemType 
)
overridevirtual

Definition at line 103 of file menubarmanager.cxx.

References a, Any, comphelper::UnoImplBase::m_bDisposed, and m_pVCLMenu.

◆ GetMenuItemHandler()

MenuBarManager::MenuItemHandler * framework::MenuBarManager::GetMenuItemHandler ( sal_uInt16  nItemId)
private

Definition at line 358 of file menubarmanager.cxx.

References m_aMenuItemHandlerVector.

◆ GetPopupController()

void framework::MenuBarManager::GetPopupController ( PopupControllerCache rPopupController)

◆ impl_RetrieveShortcutsFromConfiguration()

void framework::MenuBarManager::impl_RetrieveShortcutsFromConfiguration ( const css::uno::Reference< css::ui::XAcceleratorConfiguration > &  rAccelCfg,
const css::uno::Sequence< OUString > &  rCommands,
std::vector< std::unique_ptr< MenuItemHandler > > &  aMenuShortCuts 
)
staticprivate

Definition at line 1113 of file menubarmanager.cxx.

References i, and svt::AcceleratorExecute::st_AWTKey2VCLKey().

Referenced by RetrieveShortcuts().

◆ MergeAddonMenus()

void framework::MenuBarManager::MergeAddonMenus ( Menu pMenuBar,
const MergeMenuInstructionContainer aMergeInstructionContainer,
const OUString &  aModuleIdentifier 
)
staticprivate

◆ MustBeHidden()

bool framework::MenuBarManager::MustBeHidden ( PopupMenu pPopupMenu,
const css::uno::Reference< css::util::XURLTransformer > &  rTransformer 
)
staticprivate

◆ RemoveListener()

void framework::MenuBarManager::RemoveListener ( )
private

◆ RequestImages()

void framework::MenuBarManager::RequestImages ( )
private

Definition at line 372 of file menubarmanager.cxx.

References m_aMenuItemHandlerVector, m_bRetrieveImages, and RequestImages().

Referenced by elementInserted(), and RequestImages().

◆ RetrieveImageManagers()

void framework::MenuBarManager::RetrieveImageManagers ( )
private

◆ RetrieveLabelFromCommand()

OUString framework::MenuBarManager::RetrieveLabelFromCommand ( const OUString &  rCmdURL)
private

◆ RetrieveShortcuts()

void framework::MenuBarManager::RetrieveShortcuts ( std::vector< std::unique_ptr< MenuItemHandler > > &  aMenuShortCuts)
private

◆ SetHdl()

void framework::MenuBarManager::SetHdl ( )
private

Definition at line 1559 of file menubarmanager.cxx.

References LINK, m_pVCLMenu, m_xContext, m_xURLTransformer, and Select.

Referenced by FillMenuManager().

◆ SetItemContainer()

void framework::MenuBarManager::SetItemContainer ( const css::uno::Reference< css::container::XIndexAccess > &  rItemContainer)

◆ statusChanged()

void SAL_CALL framework::MenuBarManager::statusChanged ( const css::frame::FeatureStateEvent &  Event)
overridevirtual

Member Data Documentation

◆ m_aAsyncSettingsTimer

Timer framework::MenuBarManager::m_aAsyncSettingsTimer
private

Definition at line 189 of file menubarmanager.hxx.

Referenced by disposing(), and ~MenuBarManager().

◆ m_aMenuItemHandlerVector

::std::vector< std::unique_ptr<MenuItemHandler> > framework::MenuBarManager::m_aMenuItemHandlerVector
private

◆ m_aModuleIdentifier

OUString framework::MenuBarManager::m_aModuleIdentifier
private

◆ m_bAcceleratorCfg

bool framework::MenuBarManager::m_bAcceleratorCfg
private

Definition at line 172 of file menubarmanager.hxx.

Referenced by RetrieveShortcuts().

◆ m_bActive

bool framework::MenuBarManager::m_bActive
private

Definition at line 169 of file menubarmanager.hxx.

Referenced by FillMenuManager(), and SetItemContainer().

◆ m_bDeleteMenu

bool framework::MenuBarManager::m_bDeleteMenu
private

Definition at line 168 of file menubarmanager.hxx.

Referenced by disposing(), and FillMenuManager().

◆ m_bHasMenuBar

bool framework::MenuBarManager::m_bHasMenuBar
private

◆ m_bRetrieveImages

bool framework::MenuBarManager::m_bRetrieveImages
private

Definition at line 171 of file menubarmanager.hxx.

Referenced by FillMenuManager(), and RequestImages().

◆ m_bShowMenuImages

bool framework::MenuBarManager::m_bShowMenuImages
private

Definition at line 170 of file menubarmanager.hxx.

Referenced by FillMenuManager().

◆ m_pVCLMenu

VclPtr<Menu> framework::MenuBarManager::m_pVCLMenu
private

◆ m_sIconTheme

OUString framework::MenuBarManager::m_sIconTheme
private

Definition at line 188 of file menubarmanager.hxx.

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > framework::MenuBarManager::m_xContext
private

◆ m_xDeferredItemContainer

css::uno::Reference< css::container::XIndexAccess > framework::MenuBarManager::m_xDeferredItemContainer
private

Definition at line 187 of file menubarmanager.hxx.

Referenced by disposing(), SetItemContainer(), and ~MenuBarManager().

◆ m_xDispatchProvider

css::uno::Reference< css::frame::XDispatchProvider > framework::MenuBarManager::m_xDispatchProvider
private

Definition at line 179 of file menubarmanager.hxx.

Referenced by FillMenuManager().

◆ m_xDocAcceleratorManager

css::uno::Reference< css::ui::XAcceleratorConfiguration > framework::MenuBarManager::m_xDocAcceleratorManager
private

Definition at line 182 of file menubarmanager.hxx.

Referenced by disposing(), and RetrieveShortcuts().

◆ m_xDocImageManager

css::uno::Reference< css::ui::XImageManager > framework::MenuBarManager::m_xDocImageManager
private

Definition at line 180 of file menubarmanager.hxx.

Referenced by disposing(), and RetrieveImageManagers().

◆ m_xFrame

css::uno::Reference< css::frame::XFrame > framework::MenuBarManager::m_xFrame
private

◆ m_xGlobalAcceleratorManager

css::uno::Reference< css::ui::XAcceleratorConfiguration > framework::MenuBarManager::m_xGlobalAcceleratorManager
private

Definition at line 184 of file menubarmanager.hxx.

Referenced by disposing(), and RetrieveShortcuts().

◆ m_xModuleAcceleratorManager

css::uno::Reference< css::ui::XAcceleratorConfiguration > framework::MenuBarManager::m_xModuleAcceleratorManager
private

Definition at line 183 of file menubarmanager.hxx.

Referenced by disposing(), and RetrieveShortcuts().

◆ m_xModuleImageManager

css::uno::Reference< css::ui::XImageManager > framework::MenuBarManager::m_xModuleImageManager
private

Definition at line 181 of file menubarmanager.hxx.

Referenced by disposing(), and RetrieveImageManagers().

◆ m_xPopupMenuControllerFactory

css::uno::Reference< css::frame::XUIControllerFactory > framework::MenuBarManager::m_xPopupMenuControllerFactory
private

◆ m_xURLTransformer

css::uno::Reference< css::util::XURLTransformer > framework::MenuBarManager::m_xURLTransformer
private

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