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

#include <toolbarmanager.hxx>

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

Classes

struct  ExecuteInfo
 

Public Types

enum  ExecuteCommand {
  EXEC_CMD_CLOSETOOLBAR ,
  EXEC_CMD_UNDOCKTOOLBAR ,
  EXEC_CMD_DOCKTOOLBAR ,
  EXEC_CMD_DOCKALLTOOLBARS
}
 
enum  ClickAction {
  Click ,
  DblClick ,
  Execute
}
 

Public Member Functions

 ToolBarManager (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &rFrame, OUString aResourceName, ToolBox *pToolBar)
 
 ToolBarManager (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &rFrame, OUString aResourceName, weld::Toolbar *pToolBar, weld::Builder *pBuilder)
 
virtual ~ToolBarManager () override
 
ToolBoxGetToolBar () const
 
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
 
void SAL_CALL dispose () override
 
void SAL_CALL addEventListener (const css::uno::Reference< XEventListener > &xListener) override
 
void SAL_CALL removeEventListener (const css::uno::Reference< XEventListener > &xListener) override
 
void CheckAndUpdateImages ()
 
void RequestImages ()
 
void FillToolbar (const css::uno::Reference< css::container::XIndexAccess > &rToolBarData, const css::uno::Reference< css::container::XIndexAccess > &rContextData, const OUString &rContextToolbarName)
 
void FillAddonToolbar (const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &rAddonToolbar)
 
void FillOverflowToolbar (ToolBox const *pParent)
 
void notifyRegisteredControllers (const OUString &aUIElementName, const OUString &aCommand)
 
void Destroy ()
 
void OnClick (bool bUseExecute=false)
 
void OnDropdownClick (bool bCreatePopupWindow=true)
 
 DECL_LINK (DropdownClick, ToolBox *, void)
 
 DECL_LINK (DoubleClick, ToolBox *, void)
 
 DECL_LINK (Select, ToolBox *, void)
 
 DECL_LINK (StateChanged, StateChangedType const *, void)
 
 DECL_LINK (DataChanged, DataChangedEvent const *, void)
 
 DECL_LINK (MiscOptionsChanged, LinkParamNone *, void)
 
 DECL_LINK (MenuButton, ToolBox *, void)
 
 DECL_LINK (MenuPreExecute, ToolBox *, void)
 
 DECL_LINK (MenuSelect, Menu *, bool)
 
 DECL_LINK (AsyncUpdateControllersHdl, Timer *, void)
 
 DECL_LINK (OverflowEventListener, VclWindowEvent &, void)
 
 DECL_STATIC_LINK (ToolBarManager, ExecuteHdl_Impl, void *, void)
 

Private Types

typedef std::unordered_map< ToolBoxItemId, css::uno::Reference< css::frame::XStatusListener > > ToolBarControllerMap
 
typedef ::std::vector< css::uno::Reference< css::frame::XSubToolbarController > > SubToolBarControllerVector
 
typedef std::unordered_map< OUString, SubToolBarControllerVectorSubToolBarToSubToolBarControllerMap
 

Private Member Functions

void Init ()
 
void FillToolbarFromContainer (const css::uno::Reference< css::container::XIndexAccess > &rItemContainer, const OUString &rResourceName, ToolBoxItemId &nId, ToolBoxItemId &nAddonId)
 
void ToggleButton (const OUString &rResourceName, std::u16string_view rCommand)
 
void AddCustomizeMenuItems (ToolBox const *pToolBar)
 
void InitImageManager ()
 
void RemoveControllers ()
 
void CreateControllers ()
 
void UpdateControllers ()
 
void UpdateController (const css::uno::Reference< css::frame::XToolbarController > &xController)
 
void AddFrameActionListener ()
 
void RefreshImages ()
 
ToolBoxItemBits ConvertStyleToToolboxItemBits (sal_Int32 nStyle)
 
css::uno::Reference< css::frame::XModel > GetModelFromFrame () const
 
bool IsPluginMode () const
 
void HandleClick (ClickAction eAction)
 
void setToolBarImage (const Image &_aImage, const CommandToInfoMap::const_iterator &_pIter)
 
void impl_elementChanged (bool _bRemove, const css::ui::ConfigurationEvent &Event)
 

Private Attributes

bool m_bDisposed: 1
 
bool m_bFrameActionRegistered: 1
 
bool m_bUpdateControllers: 1
 
sal_Int16 m_eSymbolSize
 
sal_uInt16 m_nContextMinPos
 
std::unique_ptr< ToolBarManagerImplm_pImpl
 
VclPtr< ToolBoxm_pToolBar
 
weld::Toolbarm_pWeldedToolBar
 
OUString m_aModuleIdentifier
 
OUString m_aResourceName
 
OUString m_aContextResourceName
 
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer
 
css::uno::Reference< css::frame::XFrame > m_xFrame
 
ToolBarControllerMap m_aControllerMap
 
std::mutex m_mutex
 
comphelper::OInterfaceContainerHelper4< XEventListener > m_aListenerContainer
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::frame::XUIControllerFactory > m_xToolbarControllerFactory
 
css::uno::Reference< css::ui::XImageManager > m_xModuleImageManager
 
css::uno::Reference< css::ui::XImageManager > m_xDocImageManager
 
CommandToInfoMap m_aCommandMap
 
SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap
 
Timer m_aAsyncUpdateControllersTimer
 
OUString m_sIconTheme
 
rtl::Reference< ToolBarManagerm_aOverflowManager
 
rtl::Reference< ImageOrientationControllerm_aImageController
 

Detailed Description

Definition at line 110 of file toolbarmanager.hxx.

Member Typedef Documentation

◆ SubToolBarControllerVector

typedef ::std::vector< css::uno::Reference< css::frame::XSubToolbarController > > framework::ToolBarManager::SubToolBarControllerVector
private

Definition at line 216 of file toolbarmanager.hxx.

◆ SubToolBarToSubToolBarControllerMap

Definition at line 217 of file toolbarmanager.hxx.

◆ ToolBarControllerMap

typedef std::unordered_map< ToolBoxItemId, css::uno::Reference< css::frame::XStatusListener > > framework::ToolBarManager::ToolBarControllerMap
private

Definition at line 215 of file toolbarmanager.hxx.

Member Enumeration Documentation

◆ ClickAction

Enumerator
Click 
DblClick 
Execute 

Definition at line 160 of file toolbarmanager.hxx.

◆ ExecuteCommand

Enumerator
EXEC_CMD_CLOSETOOLBAR 
EXEC_CMD_UNDOCKTOOLBAR 
EXEC_CMD_DOCKTOOLBAR 
EXEC_CMD_DOCKALLTOOLBARS 

Definition at line 152 of file toolbarmanager.hxx.

Constructor & Destructor Documentation

◆ ToolBarManager() [1/2]

framework::ToolBarManager::ToolBarManager ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::frame::XFrame > &  rFrame,
OUString  aResourceName,
ToolBox pToolBar 
)

◆ ToolBarManager() [2/2]

framework::ToolBarManager::ToolBarManager ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::frame::XFrame > &  rFrame,
OUString  aResourceName,
weld::Toolbar pToolBar,
weld::Builder pBuilder 
)

◆ ~ToolBarManager()

framework::ToolBarManager::~ToolBarManager ( )
overridevirtual

Definition at line 615 of file toolbarmanager.cxx.

References m_pToolBar.

Member Function Documentation

◆ AddCustomizeMenuItems()

void framework::ToolBarManager::AddCustomizeMenuItems ( ToolBox const *  pToolBar)
private

◆ addEventListener()

void SAL_CALL framework::ToolBarManager::addEventListener ( const css::uno::Reference< XEventListener > &  xListener)
override

Definition at line 889 of file toolbarmanager.cxx.

References m_bDisposed, and m_mutex.

◆ AddFrameActionListener()

void framework::ToolBarManager::AddFrameActionListener ( )
private

Definition at line 1223 of file toolbarmanager.cxx.

References m_xFrame.

◆ CheckAndUpdateImages()

void framework::ToolBarManager::CheckAndUpdateImages ( )

◆ ConvertStyleToToolboxItemBits()

ToolBoxItemBits framework::ToolBarManager::ConvertStyleToToolboxItemBits ( sal_Int32  nStyle)
private

Definition at line 1232 of file toolbarmanager.cxx.

◆ CreateControllers()

void framework::ToolBarManager::CreateControllers ( )
private

◆ DECL_LINK() [1/11]

framework::ToolBarManager::DECL_LINK ( AsyncUpdateControllersHdl  ,
Timer ,
void   
)

◆ DECL_LINK() [2/11]

framework::ToolBarManager::DECL_LINK ( DataChanged  ,
DataChangedEvent const *  ,
void   
)

◆ DECL_LINK() [3/11]

framework::ToolBarManager::DECL_LINK ( DoubleClick  ,
ToolBox ,
void   
)

◆ DECL_LINK() [4/11]

framework::ToolBarManager::DECL_LINK ( DropdownClick  ,
ToolBox ,
void   
)

◆ DECL_LINK() [5/11]

framework::ToolBarManager::DECL_LINK ( MenuButton  ,
ToolBox ,
void   
)

◆ DECL_LINK() [6/11]

framework::ToolBarManager::DECL_LINK ( MenuPreExecute  ,
ToolBox ,
void   
)

◆ DECL_LINK() [7/11]

framework::ToolBarManager::DECL_LINK ( MenuSelect  ,
Menu ,
bool   
)

◆ DECL_LINK() [8/11]

framework::ToolBarManager::DECL_LINK ( MiscOptionsChanged  ,
LinkParamNone ,
void   
)

◆ DECL_LINK() [9/11]

framework::ToolBarManager::DECL_LINK ( OverflowEventListener  ,
VclWindowEvent ,
void   
)

◆ DECL_LINK() [10/11]

framework::ToolBarManager::DECL_LINK ( Select  ,
ToolBox ,
void   
)

◆ DECL_LINK() [11/11]

framework::ToolBarManager::DECL_LINK ( StateChanged  ,
StateChangedType const *  ,
void   
)

◆ DECL_STATIC_LINK()

framework::ToolBarManager::DECL_STATIC_LINK ( ToolBarManager  ,
ExecuteHdl_Impl  ,
void *  ,
void   
)

◆ Destroy()

void framework::ToolBarManager::Destroy ( )

Definition at line 621 of file toolbarmanager.cxx.

References LINK, m_pImpl, and SvtMiscOptions::RemoveListenerLink().

◆ dispose()

void SAL_CALL framework::ToolBarManager::dispose ( void  )
override

◆ disposing()

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

Definition at line 770 of file toolbarmanager.cxx.

References Exception, m_bDisposed, m_xContext, m_xFrame, and Source.

◆ elementInserted()

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

Definition at line 908 of file toolbarmanager.cxx.

◆ elementRemoved()

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

Definition at line 913 of file toolbarmanager.cxx.

◆ elementReplaced()

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

Definition at line 986 of file toolbarmanager.cxx.

◆ FillAddonToolbar()

void framework::ToolBarManager::FillAddonToolbar ( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &  rAddonToolbar)

◆ FillOverflowToolbar()

void framework::ToolBarManager::FillOverflowToolbar ( ToolBox const *  pParent)

◆ FillToolbar()

void framework::ToolBarManager::FillToolbar ( const css::uno::Reference< css::container::XIndexAccess > &  rToolBarData,
const css::uno::Reference< css::container::XIndexAccess > &  rContextData,
const OUString &  rContextToolbarName 
)

◆ FillToolbarFromContainer()

void framework::ToolBarManager::FillToolbarFromContainer ( const css::uno::Reference< css::container::XIndexAccess > &  rItemContainer,
const OUString &  rResourceName,
ToolBoxItemId nId,
ToolBoxItemId nAddonId 
)
private

◆ frameAction()

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

Definition at line 759 of file toolbarmanager.cxx.

References Action::Action(), and m_bDisposed.

◆ GetModelFromFrame()

Reference< XModel > framework::ToolBarManager::GetModelFromFrame ( ) const
private

Definition at line 1788 of file toolbarmanager.cxx.

References m_xFrame, xController, and xModel.

◆ GetToolBar()

ToolBox * framework::ToolBarManager::GetToolBar ( ) const

◆ HandleClick()

void framework::ToolBarManager::HandleClick ( ClickAction  eAction)
private

Definition at line 1708 of file toolbarmanager.cxx.

References m_bDisposed, m_pImpl, nId, and xController.

◆ impl_elementChanged()

void framework::ToolBarManager::impl_elementChanged ( bool  _bRemove,
const css::ui::ConfigurationEvent &  Event 
)
private

Definition at line 917 of file toolbarmanager.cxx.

References aSeq, and m_bDisposed.

◆ Init()

void framework::ToolBarManager::Init ( void  )
private

◆ InitImageManager()

void framework::ToolBarManager::InitImageManager ( )
private

Definition at line 1255 of file toolbarmanager.cxx.

References Exception, m_xContext, m_xFrame, and xModel.

◆ IsPluginMode()

bool framework::ToolBarManager::IsPluginMode ( ) const
private

Definition at line 1798 of file toolbarmanager.cxx.

References aSeq, m_xFrame, utl::MediaDescriptor::PROP_VIEWONLY, and xModel.

◆ notifyRegisteredControllers()

void framework::ToolBarManager::notifyRegisteredControllers ( const OUString &  aUIElementName,
const OUString &  aCommand 
)

Definition at line 1670 of file toolbarmanager.cxx.

References aCommand, Exception, i, nCount, and xController.

Referenced by framework::ToolBarWrapper::functionExecute().

◆ OnClick()

void framework::ToolBarManager::OnClick ( bool  bUseExecute = false)

Definition at line 1741 of file toolbarmanager.cxx.

◆ OnDropdownClick()

void framework::ToolBarManager::OnDropdownClick ( bool  bCreatePopupWindow = true)

Definition at line 1754 of file toolbarmanager.cxx.

References m_bDisposed, m_pImpl, nId, and xController.

◆ RefreshImages()

void framework::ToolBarManager::RefreshImages ( )
private

◆ RemoveControllers()

void framework::ToolBarManager::RemoveControllers ( )
private

Definition at line 991 of file toolbarmanager.cxx.

References DBG_TESTSOLARMUTEX, Exception, i, m_bDisposed, and m_pImpl.

◆ removeEventListener()

void SAL_CALL framework::ToolBarManager::removeEventListener ( const css::uno::Reference< XEventListener > &  xListener)
override

Definition at line 901 of file toolbarmanager.cxx.

References m_mutex.

◆ RequestImages()

void framework::ToolBarManager::RequestImages ( )

◆ setToolBarImage()

void framework::ToolBarManager::setToolBarImage ( const Image _aImage,
const CommandToInfoMap::const_iterator &  _pIter 
)
private

Definition at line 975 of file toolbarmanager.cxx.

References m_pImpl.

◆ ToggleButton()

void framework::ToolBarManager::ToggleButton ( const OUString &  rResourceName,
std::u16string_view  rCommand 
)
private

◆ UpdateController()

void framework::ToolBarManager::UpdateController ( const css::uno::Reference< css::frame::XToolbarController > &  xController)
private

Definition at line 737 of file toolbarmanager.cxx.

References Exception, and xController.

◆ UpdateControllers()

void framework::ToolBarManager::UpdateControllers ( )
private

Definition at line 696 of file toolbarmanager.cxx.

References a, Any, Exception, m_pImpl, m_xFrame, and SAL_MAX_INT32.

Member Data Documentation

◆ m_aAsyncUpdateControllersTimer

Timer framework::ToolBarManager::m_aAsyncUpdateControllersTimer
private

Definition at line 246 of file toolbarmanager.hxx.

◆ m_aCommandMap

CommandToInfoMap framework::ToolBarManager::m_aCommandMap
private

Definition at line 244 of file toolbarmanager.hxx.

◆ m_aContextResourceName

OUString framework::ToolBarManager::m_aContextResourceName
private

Definition at line 232 of file toolbarmanager.hxx.

◆ m_aControllerMap

ToolBarControllerMap framework::ToolBarManager::m_aControllerMap
private

Definition at line 236 of file toolbarmanager.hxx.

◆ m_aImageController

rtl::Reference< ImageOrientationController > framework::ToolBarManager::m_aImageController
private

Definition at line 250 of file toolbarmanager.hxx.

◆ m_aListenerContainer

comphelper::OInterfaceContainerHelper4<XEventListener> framework::ToolBarManager::m_aListenerContainer
private

Definition at line 238 of file toolbarmanager.hxx.

◆ m_aModuleIdentifier

OUString framework::ToolBarManager::m_aModuleIdentifier
private

Definition at line 230 of file toolbarmanager.hxx.

◆ m_aOverflowManager

rtl::Reference< ToolBarManager > framework::ToolBarManager::m_aOverflowManager
private

Definition at line 249 of file toolbarmanager.hxx.

◆ m_aResourceName

OUString framework::ToolBarManager::m_aResourceName
private

Definition at line 231 of file toolbarmanager.hxx.

◆ m_aSubToolBarControllerMap

SubToolBarToSubToolBarControllerMap framework::ToolBarManager::m_aSubToolBarControllerMap
private

Definition at line 245 of file toolbarmanager.hxx.

◆ m_bDisposed

bool framework::ToolBarManager::m_bDisposed
private

Definition at line 219 of file toolbarmanager.hxx.

◆ m_bFrameActionRegistered

bool framework::ToolBarManager::m_bFrameActionRegistered
private

Definition at line 220 of file toolbarmanager.hxx.

◆ m_bUpdateControllers

bool framework::ToolBarManager::m_bUpdateControllers
private

Definition at line 221 of file toolbarmanager.hxx.

◆ m_eSymbolSize

sal_Int16 framework::ToolBarManager::m_eSymbolSize
private

Definition at line 223 of file toolbarmanager.hxx.

◆ m_mutex

std::mutex framework::ToolBarManager::m_mutex
private

Definition at line 237 of file toolbarmanager.hxx.

◆ m_nContextMinPos

sal_uInt16 framework::ToolBarManager::m_nContextMinPos
private

Definition at line 224 of file toolbarmanager.hxx.

◆ m_pImpl

std::unique_ptr<ToolBarManagerImpl> framework::ToolBarManager::m_pImpl
private

Definition at line 226 of file toolbarmanager.hxx.

◆ m_pToolBar

VclPtr<ToolBox> framework::ToolBarManager::m_pToolBar
private

Definition at line 227 of file toolbarmanager.hxx.

◆ m_pWeldedToolBar

weld::Toolbar* framework::ToolBarManager::m_pWeldedToolBar
private

Definition at line 228 of file toolbarmanager.hxx.

◆ m_sIconTheme

OUString framework::ToolBarManager::m_sIconTheme
private

Definition at line 247 of file toolbarmanager.hxx.

◆ m_xContext

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

Definition at line 239 of file toolbarmanager.hxx.

◆ m_xDocImageManager

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

Definition at line 242 of file toolbarmanager.hxx.

◆ m_xFrame

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

Definition at line 235 of file toolbarmanager.hxx.

◆ m_xModuleImageManager

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

Definition at line 241 of file toolbarmanager.hxx.

◆ m_xToolbarControllerFactory

css::uno::Reference< css::frame::XUIControllerFactory > framework::ToolBarManager::m_xToolbarControllerFactory
private

Definition at line 240 of file toolbarmanager.hxx.

◆ m_xURLTransformer

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

Definition at line 234 of file toolbarmanager.hxx.


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