20#include <com/sun/star/accessibility/AccessibleRole.hpp>
21#include <com/sun/star/accessibility/AccessibleEventId.hpp>
22#include <com/sun/star/accessibility/AccessibleStateType.hpp>
23#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
24#include <com/sun/star/lang/DisposedException.hpp>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30#include <osl/mutex.hxx>
40#include <svx/strings.hrc>
46using namespace ::
cppu;
111 Reference<XAccessible> xAccessibleShape;
116 ShapesMapType::const_iterator iter =
mxShapes.find( pObj );
121 xAccessibleShape = (*iter).second.get();
126 Reference< XShape > xShape( Reference< XShape >::query(
const_cast<SdrObject*
>(pObj)->getUnoShape() ) );
129 AccessibleShapeInfo aShapeInfo (xShape,xParent);
133 xAccessibleShape = pAcc.get();
141 CommitChange( AccessibleEventId::CHILD,
Any( xAccessibleShape ),
Any( Reference<XAccessible>() ) );
145 return xAccessibleShape;
159 return (rPoint.X >= 0)
160 && (rPoint.X < aSize.Width)
162 && (rPoint.Y < aSize.Height);
168 ::osl::MutexGuard aGuard(
m_aMutex );
170 Reference< XAccessible > xAccessible;
174 throw DisposedException();
177 Point aPnt( rPoint.X, rPoint.Y );
198 throw DisposedException();
204 aRet.X = aOutPos.
X();
205 aRet.Y = aOutPos.
Y();
206 aRet.Width = aOutSize.
Width();
207 aRet.Height = aOutSize.
Height();
217 throw DisposedException();
219 const awt::Rectangle aRect(
getBounds() );
233 throw DisposedException();
235 awt::Point aScreenLoc(0, 0);
240 css::uno::Reference<css::accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
241 css::uno::Reference<css::accessibility::XAccessibleComponent> xParentComponent(xParentContext, css::uno::UNO_QUERY);
242 OSL_ENSURE( xParentComponent.is(),
"ValueSetAcc::getLocationOnScreen: no parent component!" );
243 if ( xParentComponent.is() )
245 awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
247 aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
248 aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
260 throw DisposedException();
262 const awt::Rectangle aRect(
getBounds() );
265 aRet.Width = aRect.Width;
266 aRet.Height = aRect.Height;
277 throw DisposedException();
289 throw DisposedException();
292 throw lang::IndexOutOfBoundsException();
304 AccessibleEventObject
aEvent (
326 throw DisposedException();
340 Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
341 if( xParentContext.is() )
343 sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
344 for( sal_Int64
i = 0 ;
i < nChildCount ; ++
i )
346 Reference< XAccessible > xChild( xParentContext->getAccessibleChild(
i ) );
349 Reference< XAccessibleContext > xChildContext = xChild->getAccessibleContext();
350 if( xChildContext ==
static_cast<XAccessibleContext*
>(
this) )
365 return AccessibleRole::PANEL;
388 return Reference< XAccessibleRelationSet >();
396 sal_Int64 nStateSet = 0;
400 nStateSet |= AccessibleStateType::DEFUNC;
404 nStateSet |= AccessibleStateType::FOCUSABLE;
406 nStateSet |= AccessibleStateType::FOCUSED;
407 nStateSet |= AccessibleStateType::OPAQUE;
408 nStateSet |= AccessibleStateType::SHOWING;
409 nStateSet |= AccessibleStateType::VISIBLE;
423 Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
424 if( xParentContext.is() )
425 return xParentContext->getLocale();
429 throw IllegalAccessibleComponentStateException();
453 if ( !nListenerCount )
469 throw DisposedException();
478 return static_cast<sal_Int32
>(nColor);
484 return static_cast<sal_Int32
>(nColor);
490 return "com.sun.star.comp.ui.SvxGraphCtrlAccessibleContext";
500 return {
"com.sun.star.accessibility.Accessible",
501 "com.sun.star.accessibility.AccessibleContext",
502 "com.sun.star.drawing.AccessibleGraphControl" };
508 return css::uno::Sequence<sal_Int8>();
514 return "com.sun.star.accessibility.AccessibleContext";
523 throw DisposedException();
526 throw lang::IndexOutOfBoundsException();
540 throw DisposedException();
543 throw lang::IndexOutOfBoundsException();
554 throw DisposedException();
565 throw DisposedException();
576 throw DisposedException();
589 Reference< XAccessible > xAccessible;
621 for(
size_t nMark = 0; nMark <
nCount; ++nMark )
632 throw lang::IndexOutOfBoundsException();
682 Reference< XComponent > xComp( pAcc.get(), UNO_QUERY );
700 if (rHint.
GetId() == SfxHintId::ThisIsAnSdrHint)
715 pShape->CommitChange( AccessibleEventId::VISIBLE_DATA_CHANGED,
uno::Any(),
uno::Any(), -1 );
736 if(rHint.
GetId() == SfxHintId::Dying)
constexpr OUStringLiteral sServiceName
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
SdrModel * GetSdrModel() const
Point GetPositionInDialog() const
SdrView * GetSdrView() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
virtual vcl::Window * GetOwnerWindow() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
SdrHintKind GetKind() const
const SdrObject * GetObject() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
bool IsObjMarked(SdrObject const *pObj) const
const SdrMarkList & GetMarkedObjectList() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
void MarkAllObj(SdrPageView *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
sal_uInt32 PaintWindowCount() const
SdrPageView * GetSdrPageView() const
tools::Rectangle GetVisibleArea() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
sal_uInt32 mnClientId
client id in the AccessibleEventNotifier queue
void setModelAndView(SdrModel *pModel, SdrView *pView)
This method is used by the graph control to tell the accessibility object about a new model and view.
void checkChildIndexOnSelection(sal_Int64 nIndexOfChild)
virtual OUString SAL_CALL getAccessibleDescription() override
SdrObject * getSdrObject(sal_Int64 nIndex)
returns the SdrObject at index nIndex from the model of this graph
virtual tools::Rectangle GetVisibleArea() const override
Returns the area of the underlying document that is visible in the corresponding window.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
virtual void SAL_CALL disposing() final override
css::uno::Reference< css::accessibility::XAccessible > getAccessible(const SdrObject *pObj)
returns the XAccessible interface for a given SdrObject.
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual void SAL_CALL grabFocus() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
OUString msDescription
Description of this object.
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual OUString SAL_CALL getAccessibleName() override
virtual css::lang::Locale SAL_CALL getLocale() override
OUString msName
Name of this object.
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &rPoint) override
virtual Point LogicToPixel(const Point &rPoint) const override
Transform the specified point from internal coordinates in 100th of mm to an absolute screen position...
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
void CommitChange(sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
sends an AccessibleEventObject to all added XAccessibleEventListeners
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Return the XAccessibleContext.
virtual void SAL_CALL clearAccessibleSelection() override
virtual css::awt::Point SAL_CALL getLocation() override
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return empty reference to indicate that the relation set is not supported.
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
virtual ~SvxGraphCtrlAccessibleContext() override
on destruction, this component is disposed and all dispose listeners are called, except if this compo...
void Notify(SfxBroadcaster &aBC, const SfxHint &aHint) override
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
SvxGraphCtrlAccessibleContext(GraphCtrl &rRepresentation)
initialize this component and set default values
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual OUString SAL_CALL getServiceName() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
::accessibility::AccessibleShapeTreeInfo maTreeInfo
virtual css::awt::Size SAL_CALL getSize() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
The view forwarder allows the transformation between internal and pixel coordinates and can be asked ...
void SetSdrView(SdrView *pView)
Set the view that will be used to construct SvxTextEditSources which in turn are used to create acces...
void SetWindow(vcl::Window *pWindow)
Set the window that is used to construct SvxTextEditSources which in turn is used to create accessibl...
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static TClientId registerClient()
static void revokeClient(const TClientId _nClient)
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
mutable::osl::Mutex m_aMutex
virtual OutputDevice & get_ref_device()=0
virtual a11yref get_accessible_parent()=0
OUString SvxResId(TranslateId aId)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
SdrObject * SdrObjListPrimitiveHit(const SdrObjList &rList, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly)