28 mpDrawModel( pDrawModel )
53 const css::uno::Reference< css::drawing::XShape >& xShape,
54 const uno::Reference< document::XShapeEventListener >& xListener )
56 assert(xShape.is() &&
"no shape?");
59 assert(rv.second &&
"duplicate listener?");
64 const css::uno::Reference< css::drawing::XShape >& xShape,
65 const uno::Reference< document::XShapeEventListener >& xListener )
71 assert(it->second == xListener &&
"removing wrong listener?");
80 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
84 document::EventObject
aEvent;
90 [&
aEvent](
const css::uno::Reference<document::XEventListener>& xListener)
92 xListener->notifyEvent(
aEvent);
97 if (pSdrHint->
GetKind() == SdrHintKind::ObjectChange)
100 uno::Reference<drawing::XShape> xShape(pSdrObject->getUnoShape(), uno::UNO_QUERY);
103 it->second->notifyShapeEvent(
aEvent);
virtual ~ScDrawModelBroadcaster() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::document::XEventListener > &xListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::document::XEventListener > &xListener) override
ScDrawModelBroadcaster(SdrModel *pDrawModel)
std::mutex maListenerMutex
std::unordered_map< css::uno::Reference< css::drawing::XShape >, css::uno::Reference< css::document::XShapeEventListener > > maShapeListeners
::comphelper::OInterfaceContainerHelper4< css::document::XEventListener > maEventListeners
virtual void SAL_CALL removeShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::document::XShapeEventListener > &xListener) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void SAL_CALL addShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::document::XShapeEventListener > &xListener) override
SdrHintKind GetKind() const
const SdrObject * GetObject() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
static bool createEvent(const SdrModel *pDoc, const SdrHint *pSdrHint, css::document::EventObject &aEvent)
void forEach(std::unique_lock< std::mutex > &rGuard, FuncT const &func) const
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)