21#include <com/sun/star/util/URL.hpp>
22#include <com/sun/star/util/URLTransformer.hpp>
23#include <com/sun/star/util/XURLTransformer.hpp>
24#include <com/sun/star/frame/XController.hpp>
25#include <com/sun/star/frame/XDispatchProvider.hpp>
26#include <com/sun/star/lang/XUnoTunnel.hpp>
27#include <com/sun/star/frame/status/ItemStatus.hpp>
28#include <com/sun/star/awt/MouseButton.hpp>
56 sal_uInt16 nVCLMouseButtons( 0 );
58 if ( nAwtMouseButtons & awt::MouseButton::LEFT )
60 if ( nAwtMouseButtons & awt::MouseButton::RIGHT )
62 if ( nAwtMouseButtons & awt::MouseButton::MIDDLE )
65 return nVCLMouseButtons;
70 const uno::Reference< frame::XFrame >& rFrame,
73 const OUString& aCommandURL )
79 uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
83 uno::Reference < frame::XModel >
xModel;
162 OWeakObject::acquire();
167 OWeakObject::release();
181 uno::Reference < frame::XDispatchProvider > xProvider(
xController, uno::UNO_QUERY );
182 if ( xProvider.is() )
184 uno::Reference < frame::XDispatch > xDisp = xProvider->queryDispatch( rEvent.FeatureURL, OUString(), 0 );
188 pViewFrame = pDisp->GetDispatcher_Impl()->
GetFrame();
192 sal_uInt16 nSlotID = 0;
201 if ( rEvent.Requery )
206 std::unique_ptr<SfxPoolItem> pItem;
207 if ( rEvent.IsEnabled )
209 eState = SfxItemState::DEFAULT;
210 uno::Type aType = rEvent.State.getValueType();
215 eState = SfxItemState::UNKNOWN;
220 rEvent.State >>= bTemp ;
225 sal_uInt16 nTemp = 0;
226 rEvent.State >>= nTemp ;
231 sal_uInt32 nTemp = 0;
232 rEvent.State >>= nTemp ;
238 rEvent.State >>= sTemp ;
243 frame::status::ItemStatus aItemStatus;
244 rEvent.State >>= aItemStatus;
254 pItem->SetWhich( nSlotID );
255 pItem->PutValue( rEvent.State, 0 );
268 const awt::MouseEvent& rMouseEvent )
271 ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
274 static_cast<sal_uInt16
>(rMouseEvent.ClickCount),
275 MouseEventModifiers::NONE,
283 const awt::MouseEvent& rMouseEvent )
286 ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
289 static_cast<sal_uInt16
>(rMouseEvent.ClickCount),
290 MouseEventModifiers::NONE,
297 const ::awt::MouseEvent& rMouseEvent )
300 ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
303 static_cast<sal_uInt16
>(rMouseEvent.ClickCount),
304 MouseEventModifiers::NONE,
311 const awt::Point& rPos,
312 ::sal_Int32 nCommand,
314 const css::uno::Any& )
317 ::Point aPos( rPos.X, rPos.Y );
324 const uno::Reference< awt::XGraphics >& xGraphics,
325 const awt::Rectangle& rOutputRectangle,
335 Paint( aUserDrawEvent );
371 DBG_ASSERT(
pBar !=
nullptr,
"setting state to dangling StatusBar" );
374 if ( eState == SfxItemState::DEFAULT && pStr )
379 "wrong SfxPoolItem subclass in SfxStatusBarControl" );
380 pBar->SetItemText( nSID, OUString() );
486 css::uno::Sequence< css::beans::PropertyValue > aArgs;
527 const std::type_info* aSlotType = pSlotPool->
GetSlotType(nSlotID);
534 return pFact->
pCtor( nSlotID, nStbId, *
pBar );
539 return pFact->
pCtor( nSlotID, nStbId, *
pBar );
SfxApplication * SfxGetpApp()
const OUString & GetValue() const
SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule *, const SfxStbCtrlFactory &)
SAL_DLLPRIVATE SfxStbCtrlFactory * GetStbCtrlFactory(const std::type_info &rSlotType, sal_uInt16 nSlotID) const
SAL_DLLPRIVATE SfxStbCtrlFactory * GetStbCtrlFactory(const std::type_info &rSlotType, sal_uInt16 nSlotID) const
SfxSlotPool * GetSlotPool() const
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
SfxModule * GetModule() const
virtual bool IsVoidItem() const
static SfxSlotPool & GetSlotPool(SfxViewFrame *pFrame=nullptr)
const std::type_info * GetSlotType(sal_uInt16 nSlotId) const
const SfxSlot * GetUnoSlot(const OUString &rUnoName) const
sal_uInt16 GetSlotId() const
const SfxType * GetType() const
SFX2_DLLPUBLIC OUString GetCommand() const
virtual bool MouseButtonUp(const MouseEvent &)
virtual void Paint(const UserDrawEvent &rUDEvt)
virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState)
virtual void SAL_CALL click(const css::awt::Point &aPos) override
virtual void Command(const CommandEvent &rCEvt)
virtual bool MouseMove(const MouseEvent &)
static rtl::Reference< SfxStatusBarControl > CreateControl(sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule const *)
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL mouseButtonDown(const css::awt::MouseEvent &aMouseEvent) override
virtual void SAL_CALL acquire() noexcept override
static sal_uInt16 convertAwtToVCLMouseButtons(sal_Int16 nAwtMouseButtons)
virtual ~SfxStatusBarControl() override
virtual void SAL_CALL paint(const css::uno::Reference< css::awt::XGraphics > &xGraphics, const css::awt::Rectangle &rOutputRectangle, ::sal_Int32 nStyle) override
virtual sal_Bool SAL_CALL mouseButtonUp(const css::awt::MouseEvent &aMouseEvent) override
virtual bool MouseButtonDown(const MouseEvent &)
static void RegisterStatusBarControl(SfxModule *, const SfxStbCtrlFactory &)
virtual sal_Bool SAL_CALL mouseMove(const css::awt::MouseEvent &aMouseEvent) override
virtual void SAL_CALL command(const css::awt::Point &aPos, ::sal_Int32 nCommand, sal_Bool bMouseEvent, const css::uno::Any &aData) override
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
virtual void SAL_CALL doubleClick(const css::awt::Point &aPos) override
SfxStatusBarControl(sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar &rBar)
SfxFrame & GetFrame() const
void SetHelpId(sal_uInt16 nItemId, const OUString &rHelpId)
static OutputDevice * GetOutputDevice(const css::uno::Reference< css::awt::XDevice > &rxDevice)
css::uno::Reference< css::frame::XFrame > m_xFrame
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
void execute(const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
inline ::tools::Rectangle VCLRectangle(const css::awt::Rectangle &rAWTRect)
#define DBG_ASSERT(sCon, aError)
rtl::Reference< svt::StatusbarController > SfxStatusBarControllerFactory(const uno::Reference< frame::XFrame > &rFrame, StatusBar *pStatusBar, unsigned short nID, const OUString &aCommandURL)
SfxStatusBarControlCtor pCtor
std::unique_ptr< SfxPoolItem > CreateItem() const
Reference< XController > xController
Reference< XModel > xModel