22#include <com/sun/star/frame/XDesktop.hpp>
23#include <com/sun/star/document/XLinkTargetSupplier.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
35using ::com::sun::star::lang::IndexOutOfBoundsException;
39 sal_Int32
const nStt, sal_Int32
const nEnd)
41 , m_xParagraph(&rAccPara)
42 , m_nStartIndex( nStt )
56 if (rHint.
GetId() == SfxHintId::Dying)
83 throw lang::IndexOutOfBoundsException();
85 if (pINetFormat && !pINetFormat->
GetValue().isEmpty())
109 throw lang::IndexOutOfBoundsException();
114 return pINetFormat->GetValue();
120uno::Reference< XAccessibleKeyBinding > SAL_CALL
123 uno::Reference< XAccessibleKeyBinding > xKeyBinding;
128 new ::comphelper::OAccessibleKeyBindingHelper();
129 xKeyBinding = pKeyBindingHelper;
131 awt::KeyStroke aKeyStroke;
132 aKeyStroke.Modifiers = 0;
134 aKeyStroke.KeyChar = 0;
135 aKeyStroke.KeyFunc = 0;
136 pKeyBindingHelper->AddKeyBinding( aKeyStroke );
150 throw lang::IndexOutOfBoundsException();
163 throw lang::IndexOutOfBoundsException();
167 retText = pINetFormat->GetValue();
191 OUString
const sText(pINetFormat->GetValue());
192 sal_Int32
nPos = sText.indexOf(
"#");
195 uno::Reference< lang::XMultiServiceFactory >
xFactory( ::comphelper::getProcessServiceFactory() );
198 uno::Reference< css::frame::XDesktop > xDesktop(
xFactory->createInstance(
"com.sun.star.frame.Desktop" ),
202 uno::Reference< lang::XComponent > xComp = xDesktop->getCurrentComponent();
205 uno::Reference< css::document::XLinkTargetSupplier > xLTS(xComp, uno::UNO_QUERY);
209 uno::Reference< css::container::XNameAccess > xLinks = xLTS->getLinks();
210 uno::Reference< css::container::XNameAccess > xSubLinks;
211 const uno::Sequence< OUString > aNames( xLinks->getElementNames() );
213 for(
const OUString& aLink : aNames )
215 uno::Any aAny = xLinks->getByName( aLink );
217 if (xSubLinks->hasByName(sText.copy(1)) )
bool StartListening(SvtBroadcaster &rBroadcaster)
virtual sal_Bool SAL_CALL isValid() override
virtual ~SwAccessibleHyperlink() override
SwFormatINetFormat * m_pHyperlink
virtual css::uno::Any SAL_CALL getAccessibleActionAnchor(sal_Int32 nIndex) override
const SwFormatINetFormat * GetTextAttr() const
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
virtual sal_Int32 SAL_CALL getEndIndex() override
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
virtual css::uno::Any SAL_CALL getAccessibleActionObject(sal_Int32 nIndex) override
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
virtual void Notify(SfxHint const &rHint) override
virtual sal_Int32 SAL_CALL getStartIndex() override
::rtl::Reference< SwAccessibleParagraph > m_xParagraph
SwAccessibleHyperlink(const SwTextAttr &, SwAccessibleParagraph &, sal_Int32 nStt, sal_Int32 nEnd)
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
SwTextAttr subclass that tracks the location of the wrapped SwFormatURL.
SvtBroadcaster & GetNotifier()
Reference< XSingleServiceFactory > xFactory
constexpr sal_uInt16 KEY_RETURN
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)