19#ifndef INCLUDED_SFX2_TBXCTRL_HXX
20#define INCLUDED_SFX2_TBXCTRL_HXX
50 const std::type_info& nTheTypeId, sal_uInt16 nTheSlotId ):
58#define SFX_DECL_TOOLBOX_CONTROL() \
59 static rtl::Reference<SfxToolBoxControl> CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ); \
60 static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=nullptr)
76 std::unique_ptr< SfxToolBoxControl_Impl>
pImpl;
81 virtual void Select( sal_uInt16 nSelectModifier );
83 virtual void DoubleClick();
85 virtual void CreatePopupWindow();
90 virtual void SAL_CALL
dispose()
override;
94 virtual void SAL_CALL
statusChanged(
const css::frame::FeatureStateEvent& Event )
override;
97 virtual void SAL_CALL
execute( sal_Int16 KeyModifier )
override;
98 virtual void SAL_CALL
click()
override;
100 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL
createPopupWindow()
override;
101 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL
createItemWindow(
const css::uno::Reference< css::awt::XWindow >& rParent )
override;
111 unsigned short GetSlotId()
const;
113 void Dispatch(
const OUString& aCommand,
114 css::uno::Sequence< css::beans::PropertyValue >
const & aArgs );
115 static void Dispatch(
const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider,
116 const OUString& rCommand,
117 css::uno::Sequence< css::beans::PropertyValue >
const & aArgs );
124#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
125 rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ) \
126 { return new Class( nSlotId, nId, rTbx ); } \
127 void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
128 { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
129 Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
131#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
132 rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ) \
133 { return new Class( nSlotId, nId, rTbx, Arg); } \
134 void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
135 { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
136 Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
virtual sal_uInt32 GetId() const override
SfxTbxCtrlFactory(SfxToolBoxControlCtor pTheCtor, const std::type_info &nTheTypeId, sal_uInt16 nTheSlotId)
SfxToolBoxControlCtor pCtor
const std::type_info & nTypeId
rtl::Reference< SfxToolBoxControl >(* SfxToolBoxControlCtor)(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rBox)
rtl::Reference< svt::ToolboxController > SfxToolBoxControllerFactory(const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBox *pToolbox, ToolBoxItemId nID, const OUString &aCommandURL)