22#include <com/sun/star/view/XSelectionSupplier.hpp>
29using namespace css::uno;
34 std::function<OUString()> aSelectionChangeCallback,
35 const Reference<css::frame::XController>& rxController,
37 : maSelectionChangeCallback(
std::move(aSelectionChangeCallback)),
38 mxController(rxController),
39 meDefaultContext(eDefaultContext),
52 if (maSelectionChangeCallback)
77void SelectionChangeHandler::Connect()
79 uno::Reference<view::XSelectionSupplier> xSupplier (
mxController, uno::UNO_QUERY);
83 xSupplier->addSelectionChangeListener(
this);
88void SelectionChangeHandler::Disconnect()
90 uno::Reference<view::XSelectionSupplier> xSupplier (
mxController, uno::UNO_QUERY);
93 mbIsConnected =
false;
94 xSupplier->removeSelectionChangeListener(
this);
static void NotifyContextChange(const css::uno::Reference< css::frame::XController > &rxController, const vcl::EnumContext::Context eContext)
Notify the activation of a context.
virtual void SAL_CALL disposing(const css::lang::EventObject &) override
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &) override
~SelectionChangeHandler()
css::uno::Reference< css::frame::XController > mxController
static Context GetContextEnum(const OUString &rsContextName)