LibreOffice Module svx (master) 1
AccessibleShape.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22#include <com/sun/star/accessibility/AccessibleRole.hpp>
23#include <com/sun/star/accessibility/AccessibleStateType.hpp>
24#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
25#include <com/sun/star/accessibility/AccessibleEventId.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/drawing/XShapes.hpp>
28#include <com/sun/star/document/XShapeEventBroadcaster.hpp>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30#include <com/sun/star/drawing/FillStyle.hpp>
31#include <com/sun/star/text/XText.hpp>
32#include <sal/log.hxx>
33#include <editeng/unoedsrc.hxx>
38#include <svx/unoshtxt.hxx>
39#include <svx/svdobj.hxx>
40#include <svx/unoapi.hxx>
41#include <svx/svdpage.hxx>
43#include <svx/SvxShapeTypes.hxx>
44
45#include <vcl/svapp.hxx>
46#include <vcl/window.hxx>
48#include <svx/svdview.hxx>
53
54#include <algorithm>
55#include <memory>
56
57using namespace ::com::sun::star;
58using namespace ::com::sun::star::accessibility;
59using ::com::sun::star::uno::Reference;
60using ::com::sun::star::lang::IndexOutOfBoundsException;
61using ::com::sun::star::uno::RuntimeException;
62
63namespace accessibility {
64
65namespace {
66
67OUString GetOptionalProperty (
68 const Reference<beans::XPropertySet>& rxSet,
69 const OUString& rsPropertyName)
70{
71 OUString sValue;
72
73 if (rxSet.is())
74 {
75 const Reference<beans::XPropertySetInfo> xInfo (rxSet->getPropertySetInfo());
76 if ( ! xInfo.is() || xInfo->hasPropertyByName(rsPropertyName))
77 {
78 try
79 {
80 rxSet->getPropertyValue(rsPropertyName) >>= sValue;
81 }
82 catch (beans::UnknownPropertyException&)
83 {
84 // This exception should only be thrown when the property
85 // does not exits (of course) and the XPropertySetInfo is
86 // not available.
87 }
88 }
89 }
90 return sValue;
91}
92
93} // end of anonymous namespace
94
95// internal
97 const AccessibleShapeInfo& rShapeInfo,
98 const AccessibleShapeTreeInfo& rShapeTreeInfo)
99 : AccessibleContextBase (rShapeInfo.mxParent,AccessibleRole::SHAPE),
100 mxShape (rShapeInfo.mxShape),
101 maShapeTreeInfo (rShapeTreeInfo),
102 m_nIndexInParent(-1),
103 mpParent (rShapeInfo.mpChildrenManager)
104{
107}
108
110{
111 mpChildrenManager.reset();
112 mpText.reset();
113 SAL_INFO("svx", "~AccessibleShape");
114
115 // Unregistering from the various broadcasters should be unnecessary
116 // since this destructor would not have been called if one of the
117 // broadcasters would still hold a strong reference to this object.
118}
119
121{
122 // Update the OPAQUE and SELECTED shape.
123 UpdateStates ();
124
125 // Create a children manager when this shape has children of its own.
126 Reference<drawing::XShapes> xShapes (mxShape, uno::UNO_QUERY);
127 if (xShapes.is() && xShapes->getCount() > 0)
129 this, xShapes, maShapeTreeInfo, *this) );
130 if (mpChildrenManager != nullptr)
131 mpChildrenManager->Update();
132
133 // Register at model as document::XEventListener.
135 maShapeTreeInfo.GetModelBroadcaster()->addShapeEventListener(mxShape,
136 static_cast<document::XShapeEventListener*>(this));
137
138 // Beware! Here we leave the paths of the UNO API and descend into the
139 // depths of the core. Necessary for making the edit engine
140 // accessible.
141 Reference<text::XText> xText (mxShape, uno::UNO_QUERY);
142 if (!xText.is())
143 return;
144
146 const vcl::Window* pWindow = maShapeTreeInfo.GetWindow ();
147 if (!(pView != nullptr && pWindow != nullptr && mxShape.is()))
148 return;
149
150 // #107948# Determine whether shape text is empty
152 if( !pSdrObject )
153 return;
154
155 SdrTextObj* pTextObj = DynCastSdrTextObj( pSdrObject );
156 const bool hasOutlinerParaObject = (pTextObj && pTextObj->CanCreateEditOutlinerParaObject()) || (pSdrObject->GetOutlinerParaObject() != nullptr);
157
158 // create AccessibleTextHelper to handle this shape's text
159 if( !hasOutlinerParaObject )
160 {
161 // empty text -> use proxy edit source to delay creation of EditEngine
162 mpText.reset( new AccessibleTextHelper( std::make_unique<AccessibleEmptyEditSource >(*pSdrObject, *pView, *pWindow->GetOutDev()) ) );
163 }
164 else
165 {
166 // non-empty text -> use full-fledged edit source right away
167 mpText.reset( new AccessibleTextHelper( std::make_unique<SvxTextEditSource >(*pSdrObject, nullptr, *pView, *pWindow->GetOutDev()) ) );
168 }
169 if( pWindow->HasFocus() )
170 mpText->SetFocus();
171
172 mpText->SetEventSource(this);
173}
174
175
177{
178 // Set the opaque state for certain shape types when their fill style is
179 // solid.
180 bool bShapeIsOpaque = false;
181 switch (ShapeTypeHandler::Instance().GetTypeId (mxShape))
182 {
183 case DRAWING_PAGE:
185 case DRAWING_TEXT:
186 {
187 uno::Reference<beans::XPropertySet> xSet (mxShape, uno::UNO_QUERY);
188 if (xSet.is())
189 {
190 try
191 {
192 drawing::FillStyle aFillStyle;
193 bShapeIsOpaque = ( xSet->getPropertyValue ("FillStyle") >>= aFillStyle)
194 && aFillStyle == drawing::FillStyle_SOLID;
195 }
196 catch (css::beans::UnknownPropertyException&)
197 {
198 // Ignore.
199 }
200 }
201 }
202 }
203 if (bShapeIsOpaque)
204 mnStateSet |= AccessibleStateType::OPAQUE;
205 else
206 mnStateSet &= ~AccessibleStateType::OPAQUE;
207
208 // Set the selected state.
209 bool bShapeIsSelected = false;
210 // XXX fix_me this has to be done with an extra interface later on
212 {
213 bShapeIsSelected = maShapeTreeInfo.GetSdrView()->IsObjMarked(m_pShape);
214 }
215
216 if (bShapeIsSelected)
217 mnStateSet |= AccessibleStateType::SELECTED;
218 else
219 mnStateSet &= ~AccessibleStateType::SELECTED;
220}
221
223{
225}
226
227bool AccessibleShape::SetState (sal_Int64 aState)
228{
229 bool bStateHasChanged = false;
230
231 if (aState == AccessibleStateType::FOCUSED && mpText != nullptr)
232 {
233 // Offer FOCUSED state to edit engine and detect whether the state
234 // changes.
235 bool bIsFocused = mpText->HaveFocus ();
236 mpText->SetFocus();
237 bStateHasChanged = (bIsFocused != mpText->HaveFocus ());
238 }
239 else
240 bStateHasChanged = AccessibleContextBase::SetState (aState);
241
242 return bStateHasChanged;
243}
244
245
246bool AccessibleShape::ResetState (sal_Int64 aState)
247{
248 bool bStateHasChanged = false;
249
250 if (aState == AccessibleStateType::FOCUSED && mpText != nullptr)
251 {
252 // Try to remove FOCUSED state from the edit engine and detect
253 // whether the state changes.
254 bool bIsFocused = mpText->HaveFocus ();
255 mpText->SetFocus (false);
256 bStateHasChanged = (bIsFocused != mpText->HaveFocus ());
257 }
258 else
259 bStateHasChanged = AccessibleContextBase::ResetState (aState);
260
261 return bStateHasChanged;
262}
263
264
265bool AccessibleShape::GetState (sal_Int64 aState)
266{
267 if (aState == AccessibleStateType::FOCUSED && mpText != nullptr)
268 {
269 // Just delegate the call to the edit engine. The state is not
270 // merged into the state set.
271 return mpText->HaveFocus();
272 }
273 else
274 return AccessibleContextBase::GetState (aState);
275}
276
277// OverWrite the parent's getAccessibleName method
279{
281 if (m_pShape && !m_pShape->GetTitle().isEmpty())
282 return CreateAccessibleName() + " " + m_pShape->GetTitle();
283 else
284 return CreateAccessibleName();
285}
286
288{
290 if( m_pShape && !m_pShape->GetDescription().isEmpty())
291 return m_pShape->GetDescription() ;
292 else
293 return " ";
294}
295
296// XAccessibleContext
300sal_Int64 SAL_CALL
302{
303 if (IsDisposed())
304 {
305 return 0;
306 }
307
308 sal_Int64 nChildCount = 0;
309
310 // Add the number of shapes that are children of this shape.
311 if (mpChildrenManager != nullptr)
312 nChildCount += mpChildrenManager->GetChildCount ();
313 // Add the number text paragraphs.
314 if (mpText != nullptr)
315 nChildCount += mpText->GetChildCount ();
316
317 return nChildCount;
318}
319
320
324uno::Reference<XAccessible> SAL_CALL
326{
328
329 uno::Reference<XAccessible> xChild;
330
331 // Depending on the index decide whether to delegate this call to the
332 // children manager or the edit engine.
333 if ((mpChildrenManager != nullptr)
334 && (nIndex < mpChildrenManager->GetChildCount()))
335 {
336 xChild = mpChildrenManager->GetChild (nIndex);
337 }
338 else if (mpText != nullptr)
339 {
340 sal_Int64 nI = nIndex;
341 if (mpChildrenManager != nullptr)
342 nI -= mpChildrenManager->GetChildCount();
343 xChild = mpText->GetChild (nI);
344 }
345 else
346 throw lang::IndexOutOfBoundsException (
347 "shape has no child with index " + OUString::number(nIndex),
348 getXWeak());
349
350 return xChild;
351}
352
353uno::Reference<XAccessibleRelationSet> SAL_CALL
355{
356 ::osl::MutexGuard aGuard (m_aMutex);
357 if (mpParent == nullptr)
358 return uno::Reference<XAccessibleRelationSet>();
359
361
362 //this mxshape is the captioned shape
363 uno::Sequence< uno::Reference< uno::XInterface > > aSequence { mpParent->GetAccessibleCaption(mxShape) };
364 if(aSequence[0])
365 {
366 pRelationSet->AddRelation(
367 AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) );
368 }
369 return pRelationSet;
370}
371
378sal_Int64 SAL_CALL
380{
381 ::osl::MutexGuard aGuard (m_aMutex);
382
383 if (IsDisposed())
384 {
385 // Return a minimal state set that only contains the DEFUNC state.
387 }
388
389 // Merge current FOCUSED state from edit engine.
390 if (mpText)
391 {
392 if (mpText->HaveFocus())
393 mnStateSet |= AccessibleStateType::FOCUSED;
394 else
395 mnStateSet &= ~AccessibleStateType::FOCUSED;
397 //Just when the document is not read-only,set states EDITABLE,RESIZABLE,MOVEABLE
398 css::uno::Reference<XAccessible> xTempAcc = getAccessibleParent();
399 if( xTempAcc.is() )
400 {
401 css::uno::Reference<XAccessibleContext>
402 xTempAccContext = xTempAcc->getAccessibleContext();
403 if( xTempAccContext.is() )
404 {
405 sal_Int64 nState = xTempAccContext->getAccessibleStateSet();
406 if (nState & AccessibleStateType::EDITABLE)
407 {
408 mnStateSet |= AccessibleStateType::EDITABLE;
409 mnStateSet |= AccessibleStateType::RESIZABLE;
410 mnStateSet |= AccessibleStateType::MOVEABLE;
411 }
412 }
413 }
414
415 sal_Int64 nRetStateSet = mnStateSet;
416
418 {
419 nRetStateSet |= AccessibleStateType::SELECTED;
420 }
421
422 return nRetStateSet;
423}
424
425// XAccessibleComponent
434uno::Reference<XAccessible > SAL_CALL
436 const awt::Point& aPoint)
437{
438 ::osl::MutexGuard aGuard (m_aMutex);
439
440 sal_Int64 nChildCount = getAccessibleChildCount ();
441 for (sal_Int64 i = 0; i < nChildCount; ++i)
442 {
443 Reference<XAccessible> xChild (getAccessibleChild (i));
444 if (xChild.is())
445 {
446 Reference<XAccessibleComponent> xChildComponent (
447 xChild->getAccessibleContext(), uno::UNO_QUERY);
448 if (xChildComponent.is())
449 {
450 awt::Rectangle aBBox (xChildComponent->getBounds());
451 if ( (aPoint.X >= aBBox.X)
452 && (aPoint.Y >= aBBox.Y)
453 && (aPoint.X < aBBox.X+aBBox.Width)
454 && (aPoint.Y < aBBox.Y+aBBox.Height) )
455 return xChild;
456 }
457 }
458 }
459
460 // Have not found a child under the given point. Returning empty
461 // reference to indicate this.
462 return uno::Reference<XAccessible>();
463}
464
465
466awt::Rectangle SAL_CALL AccessibleShape::getBounds()
467{
468 SolarMutexGuard aSolarGuard;
469 ::osl::MutexGuard aGuard (m_aMutex);
470
472 awt::Rectangle aBoundingBox;
473 if ( mxShape.is() )
474 {
475
476 static constexpr OUStringLiteral sBoundRectName = u"BoundRect";
477 static constexpr OUStringLiteral sAnchorPositionName = u"AnchorPosition";
478
479 // Get the shape's bounding box in internal coordinates (in 100th of
480 // mm). Use the property BoundRect. Only if that is not supported ask
481 // the shape for its position and size directly.
482 Reference<beans::XPropertySet> xSet (mxShape, uno::UNO_QUERY);
483 Reference<beans::XPropertySetInfo> xSetInfo;
484 bool bFoundBoundRect = false;
485 if (xSet.is())
486 {
487 xSetInfo = xSet->getPropertySetInfo ();
488 if (xSetInfo.is())
489 {
490 if (xSetInfo->hasPropertyByName (sBoundRectName))
491 {
492 try
493 {
494 uno::Any aValue = xSet->getPropertyValue (sBoundRectName);
495 aValue >>= aBoundingBox;
496 bFoundBoundRect = true;
497 }
498 catch (beans::UnknownPropertyException const&)
499 {
500 // Handled below (bFoundBoundRect stays false).
501 }
502 }
503 else
504 SAL_WARN("svx", "no property BoundRect");
505 }
506 }
507
508 // Fallback when there is no BoundRect Property.
509 if ( ! bFoundBoundRect )
510 {
511 awt::Point aPosition (mxShape->getPosition());
512 awt::Size aSize (mxShape->getSize());
513 aBoundingBox = awt::Rectangle (
514 aPosition.X, aPosition.Y,
515 aSize.Width, aSize.Height);
516
517 // While BoundRects have absolute positions, the position returned
518 // by XPosition::getPosition is relative. Get the anchor position
519 // (usually not (0,0) for Writer shapes).
520 if (xSetInfo.is())
521 {
522 if (xSetInfo->hasPropertyByName (sAnchorPositionName))
523 {
524 uno::Any aPos = xSet->getPropertyValue (sAnchorPositionName);
525 awt::Point aAnchorPosition;
526 aPos >>= aAnchorPosition;
527 aBoundingBox.X += aAnchorPosition.X;
528 aBoundingBox.Y += aAnchorPosition.Y;
529 }
530 }
531 }
532
533 // Transform coordinates from internal to pixel.
534 if (maShapeTreeInfo.GetViewForwarder() == nullptr)
535 throw uno::RuntimeException (
536 "AccessibleShape has no valid view forwarder",
537 getXWeak());
539 ::Size (aBoundingBox.Width, aBoundingBox.Height));
541 ::Point (aBoundingBox.X, aBoundingBox.Y));
542
543 // Clip the shape's bounding box with the bounding box of its parent.
544 Reference<XAccessibleComponent> xParentComponent (
545 getAccessibleParent(), uno::UNO_QUERY);
546 if (xParentComponent.is())
547 {
548 // Make the coordinates relative to the parent.
549 awt::Point aParentLocation (xParentComponent->getLocationOnScreen());
550 int x = aPixelPosition.getX() - aParentLocation.X;
551 int y = aPixelPosition.getY() - aParentLocation.Y;
552
553 // Clip with parent (with coordinates relative to itself).
554 ::tools::Rectangle aBBox (
555 x, y, x + aPixelSize.getWidth(), y + aPixelSize.getHeight());
556 awt::Size aParentSize (xParentComponent->getSize());
557 ::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height);
558 aBBox = aBBox.GetIntersection (aParentBBox);
559 aBoundingBox = awt::Rectangle (
560 aBBox.Left(),
561 aBBox.Top(),
562 aBBox.getOpenWidth(),
563 aBBox.getOpenHeight());
564 }
565 else
566 {
567 SAL_INFO("svx", "parent does not support component");
568 aBoundingBox = awt::Rectangle (
569 aPixelPosition.getX(), aPixelPosition.getY(),
570 aPixelSize.getWidth(), aPixelSize.getHeight());
571 }
572 }
573
574 return aBoundingBox;
575}
576
577
578awt::Point SAL_CALL AccessibleShape::getLocation()
579{
581 awt::Rectangle aBoundingBox (getBounds());
582 return awt::Point (aBoundingBox.X, aBoundingBox.Y);
583}
584
585
587{
589
590 // Get relative position...
591 awt::Point aLocation (getLocation ());
592
593 // ... and add absolute position of the parent.
594 uno::Reference<XAccessibleComponent> xParentComponent (
595 getAccessibleParent(), uno::UNO_QUERY);
596 if (xParentComponent.is())
597 {
598 awt::Point aParentLocation (xParentComponent->getLocationOnScreen());
599 aLocation.X += aParentLocation.X;
600 aLocation.Y += aParentLocation.Y;
601 }
602 else
603 SAL_WARN("svx", "parent does not support XAccessibleComponent");
604 return aLocation;
605}
606
607
608awt::Size SAL_CALL AccessibleShape::getSize()
609{
611 awt::Rectangle aBoundingBox (getBounds());
612 return awt::Size (aBoundingBox.Width, aBoundingBox.Height);
613}
614
615
617{
619 sal_Int32 nColor (0x0ffffffL);
620
621 try
622 {
623 uno::Reference<beans::XPropertySet> aSet (mxShape, uno::UNO_QUERY);
624 if (aSet.is())
625 {
626 uno::Any aColor;
627 aColor = aSet->getPropertyValue ("LineColor");
628 aColor >>= nColor;
629 }
630 }
631 catch (const css::beans::UnknownPropertyException &)
632 {
633 // Ignore exception and return default color.
634 }
635 return nColor;
636}
637
638
640{
642 Color nColor;
643
644 try
645 {
646 uno::Reference<beans::XPropertySet> aSet (mxShape, uno::UNO_QUERY);
647 if (aSet.is())
648 {
649 uno::Any aColor;
650 aColor = aSet->getPropertyValue ("FillColor");
651 aColor >>= nColor;
652 aColor = aSet->getPropertyValue ("FillTransparence");
653 short nTrans=0;
654 aColor >>= nTrans;
655 Color crBk(nColor);
656 if (nTrans == 0 )
657 {
658 crBk.SetAlpha(0);
659 }
660 else
661 {
662 nTrans = short(256 - nTrans / 100. * 256);
663 crBk.SetAlpha(255 - sal_uInt8(nTrans));
664 }
665 nColor = crBk;
666 }
667 }
668 catch (const css::beans::UnknownPropertyException &)
669 {
670 // Ignore exception and return default color.
671 }
672 return sal_Int32(nColor);
673}
674
675// XAccessibleEventBroadcaster
677 const Reference<XAccessibleEventListener >& rxListener)
678{
679 if (rBHelper.bDisposed || rBHelper.bInDispose)
680 {
681 uno::Reference<uno::XInterface> xThis (
682 static_cast<lang::XComponent *>(this), uno::UNO_QUERY);
683 rxListener->disposing (lang::EventObject (xThis));
684 }
685 else
686 {
688 if (mpText != nullptr)
689 mpText->AddEventListener (rxListener);
690 }
691}
692
693
695 const Reference<XAccessibleEventListener >& rxListener)
696{
698 if (mpText != nullptr)
699 mpText->RemoveEventListener (rxListener);
700}
701
702// XInterface
703css::uno::Any SAL_CALL
704 AccessibleShape::queryInterface (const css::uno::Type & rType)
705{
706 css::uno::Any aReturn = AccessibleContextBase::queryInterface (rType);
707 if ( ! aReturn.hasValue())
708 aReturn = ::cppu::queryInterface (rType,
709 static_cast<XAccessibleComponent*>(this),
710 static_cast<XAccessibleExtendedComponent*>(this),
711 static_cast< css::accessibility::XAccessibleSelection* >(this),
712 static_cast< css::accessibility::XAccessibleExtendedAttributes* >(this),
713 static_cast<document::XShapeEventListener*>(this),
714 static_cast<lang::XUnoTunnel*>(this),
715 static_cast<XAccessibleGroupPosition*>(this),
716 static_cast<XAccessibleHypertext*>(this)
717 );
718 return aReturn;
719}
720
721
722void SAL_CALL
724 noexcept
725{
726 AccessibleContextBase::acquire ();
727}
728
729
730void SAL_CALL
732 noexcept
733{
734 AccessibleContextBase::release ();
735}
736
737// XAccessibleSelection
739{
740}
741
742
744{
745 uno::Reference<XAccessible> xAcc = getAccessibleChild( nChildIndex );
746 uno::Reference<XAccessibleContext> xContext;
747 if( xAcc.is() )
748 {
749 xContext = xAcc->getAccessibleContext();
750 }
751
752 if( xContext.is() )
753 {
754 if( xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
755 {
756 uno::Reference< css::accessibility::XAccessibleText >
757 xText(xAcc, uno::UNO_QUERY);
758 if( xText.is() )
759 {
760 if( xText->getSelectionStart() >= 0 ) return true;
761 }
762 }
763 else if( xContext->getAccessibleRole() == AccessibleRole::SHAPE )
764 {
765 sal_Int64 pRState = xContext->getAccessibleStateSet();
766
767 return bool(pRState & AccessibleStateType::SELECTED);
768 }
769 }
770
771 return false;
772}
773
774
776{
777}
778
779
781{
782}
783
784
786{
787 sal_Int64 nCount = 0;
788 sal_Int64 TotalCount = getAccessibleChildCount();
789 for( sal_Int64 i = 0; i < TotalCount; i++ )
791
792 return nCount;
793}
794
795
796Reference<XAccessible> SAL_CALL AccessibleShape::getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex )
797{
798 if ( nSelectedChildIndex > getSelectedAccessibleChildCount() )
799 throw IndexOutOfBoundsException();
800 for (sal_Int64 i1 = 0, i2 = 0; i1 < getAccessibleChildCount(); i1++)
802 {
803 if( i2 == nSelectedChildIndex )
804 return getAccessibleChild( i1 );
805 i2++;
806 }
807 return Reference<XAccessible>();
808}
809
810
812{
813
814}
815
816// XAccessibleExtendedAttributes
818{
819 uno::Any strRet;
820 OUString style;
821 if( getAccessibleRole() != AccessibleRole::SHAPE ) return strRet;
822 if( m_pShape )
823 {
824 style = "style:" + GetStyle();
825 }
826 style += ";";
827 strRet <<= style;
828 return strRet;
829}
830
831// XServiceInfo
832OUString SAL_CALL
834{
835 return "AccessibleShape";
836}
837
838
839uno::Sequence<OUString> SAL_CALL
841{
843 const css::uno::Sequence<OUString> vals { "com.sun.star.drawing.AccessibleShape" };
845}
846
847// XTypeProvider
848uno::Sequence<uno::Type> SAL_CALL
850{
852 // Get list of types from the context base implementation, ...
853 uno::Sequence<uno::Type> aTypeList (AccessibleContextBase::getTypes());
854 // ... get list of types from component base implementation, ...
855 uno::Sequence<uno::Type> aComponentTypeList (AccessibleComponentBase::getTypes());
856 // ... define local types
857 uno::Sequence<uno::Type> localTypesList = {
861 };
862
863 return comphelper::concatSequences(aTypeList, aComponentTypeList, localTypesList);
864}
865
866// lang::XEventListener
871void AccessibleShape::disposing (const lang::EventObject& aEvent)
872{
873 SolarMutexGuard aSolarGuard;
874 ::osl::MutexGuard aGuard (m_aMutex);
875
876 try
877 {
879 {
880 // Remove reference to model broadcaster to allow it to pass
881 // away.
883 }
884
885 }
886 catch (uno::RuntimeException const&)
887 {
888 TOOLS_WARN_EXCEPTION("svx", "caught exception while disposing");
889 }
890 mpChildrenManager.reset();
891 mxShape.clear();
893 mpText.reset();
894}
895
896// document::XShapeEventListener
897void SAL_CALL
898 AccessibleShape::notifyShapeEvent (const document::EventObject& rEventObject)
899{
900 if (rEventObject.EventName != "ShapeModified")
901 return;
902
903 //Need to update text children when receiving ShapeModified hint when exiting edit mode for text box
904 if (mpText)
905 mpText->UpdateChildren();
906
907
908 // Some property of a shape has been modified. Send an event
909 // that indicates a change of the visible data to all listeners.
911 AccessibleEventId::VISIBLE_DATA_CHANGED,
912 uno::Any(),
913 uno::Any(), -1);
914
915 // Name and Description may have changed. Update the local
916 // values accordingly.
918}
919
920// lang::XUnoTunnel
922
923// IAccessibleViewForwarderListener
924void AccessibleShape::ViewForwarderChanged()
925{
926 // Inform all listeners that the graphical representation (i.e. size
927 // and/or position) of the shape has changed.
928 CommitChange (AccessibleEventId::VISIBLE_DATA_CHANGED,
929 uno::Any(),
930 uno::Any(), -1);
931
932 // Tell children manager of the modified view forwarder.
933 if (mpChildrenManager != nullptr)
934 mpChildrenManager->ViewForwarderChanged();
935
936 // update our children that our screen position might have changed
937 if( mpText )
938 mpText->UpdateChildren();
939}
940
941// protected internal
942// Set this object's name if is different to the current name.
944{
946}
947
948
950{
951 return GetFullAccessibleName(this);
952}
953
955{
956 OUString sName (shape->CreateAccessibleBaseName());
957 // Append the shape's index to the name to disambiguate between shapes
958 // of the same type. If such an index where not given to the
959 // constructor then use the z-order instead. If even that does not exist
960 // we throw an exception.
961 OUString nameStr;
962 if (shape->m_pShape)
963 nameStr = shape->m_pShape->GetName();
964 if (nameStr.isEmpty())
965 {
966 sName += " ";
967 }
968 else
969 {
970 sName = nameStr;
971 }
972
973 //If the new produced name if not the same with last,notify name changed
974 //Event
975 if (aAccName != sName && !aAccName.isEmpty())
976 {
977 uno::Any aOldValue, aNewValue;
978 aOldValue <<= aAccName;
979 aNewValue <<= sName;
981 AccessibleEventId::NAME_CHANGED,
982 aNewValue,
983 aOldValue, -1);
984 }
985 aAccName = sName;
986 return sName;
987}
988
989// protected
991{
992 SolarMutexGuard aSolarGuard;
993 ::osl::MutexGuard aGuard (m_aMutex);
994
995 // Make sure to send an event that this object loses the focus in the
996 // case that it has the focus.
997 mnStateSet &= ~AccessibleStateType::FOCUSED;
998
999 // Unregister from model.
1000 if (mxShape.is() && maShapeTreeInfo.GetModelBroadcaster().is())
1001 maShapeTreeInfo.GetModelBroadcaster()->removeShapeEventListener(mxShape,
1002 static_cast<document::XShapeEventListener*>(this));
1003
1004 // Release the child containers.
1005 if (mpChildrenManager != nullptr)
1006 {
1007 mpChildrenManager.reset();
1008 }
1009 if (mpText != nullptr)
1010 {
1011 mpText->Dispose();
1012 mpText.reset();
1013 }
1014
1015 // Cleanup. Remove references to objects to allow them to be
1016 // destroyed.
1017 mxShape = nullptr;
1019
1020 // Call base classes.
1021 AccessibleContextBase::dispose ();
1022}
1023
1024sal_Int64 SAL_CALL
1026{
1027 ThrowIfDisposed ();
1028 // Use a simple but slow solution for now. Optimize later.
1029
1030 sal_Int64 nIndex = m_nIndexInParent;
1031 if ( -1 == nIndex )
1033 return nIndex;
1034}
1035
1036
1038{
1039 // Ignore missing title, name, or description. There are fallbacks for
1040 // them.
1041 try
1042 {
1043 Reference<beans::XPropertySet> xSet (mxShape, uno::UNO_QUERY_THROW);
1044
1045 // Get the accessible name.
1046 OUString sString = GetOptionalProperty(xSet, "Title");
1047 if (!sString.isEmpty())
1048 {
1050 }
1051 else
1052 {
1053 sString = GetOptionalProperty(xSet, "Name");
1054 if (!sString.isEmpty())
1056 }
1057
1058 // Get the accessible description.
1059 sString = GetOptionalProperty(xSet, "Description");
1060 if (!sString.isEmpty())
1062 }
1063 catch (uno::RuntimeException&)
1064 {
1065 }
1066}
1067
1068// Return this object's role.
1070{
1071 sal_Int16 nAccessibleRole = AccessibleRole::SHAPE ;
1072 switch (ShapeTypeHandler::Instance().GetTypeId (mxShape))
1073 {
1075 nAccessibleRole = AccessibleRole::GRAPHIC ; break;
1076 case DRAWING_OLE:
1077 nAccessibleRole = AccessibleRole::EMBEDDED_OBJECT ; break;
1078
1079 default:
1080 nAccessibleRole = AccessibleContextBase::getAccessibleRole();
1081 break;
1082 }
1083
1084 return nAccessibleRole;
1085}
1086
1087namespace {
1088
1089//sort the drawing objects from up to down, from left to right
1090struct XShapePosCompareHelper
1091{
1092 bool operator() ( const uno::Reference<drawing::XShape>& xshape1,
1093 const uno::Reference<drawing::XShape>& xshape2 ) const
1094 {
1097 if(pObj1 && pObj2)
1098 return pObj1->GetOrdNum() < pObj2->GetOrdNum();
1099 else
1100 return false;
1101 }
1102};
1103
1104}
1105//end of group position
1106
1107// XAccessibleGroupPosition
1108uno::Sequence< sal_Int32 > SAL_CALL
1110{
1111 // we will return the:
1112 // [0] group level
1113 // [1] similar items counts in the group
1114 // [2] the position of the object in the group
1115 uno::Sequence< sal_Int32 > aRet{ 0, 0, 0 };
1116
1117 css::uno::Reference<XAccessible> xParent = getAccessibleParent();
1118 if (!xParent.is())
1119 {
1120 return aRet;
1121 }
1123
1124
1125 if(pObj == nullptr )
1126 {
1127 return aRet;
1128 }
1129
1130 // Compute object's group level.
1131 sal_Int32 nGroupLevel = 0;
1133 while( pUper )
1134 {
1135 ++nGroupLevel;
1136 pUper = pUper->getParentSdrObjectFromSdrObject();
1137 }
1138
1139 css::uno::Reference<XAccessibleContext> xParentContext = xParent->getAccessibleContext();
1140 if( xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT ||
1141 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_PRESENTATION ||
1142 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_SPREADSHEET ||
1143 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_TEXT )//Document
1144 {
1145 Reference< XAccessibleGroupPosition > xGroupPosition( xParent,uno::UNO_QUERY );
1146 if ( xGroupPosition.is() )
1147 {
1148 aRet = xGroupPosition->getGroupPosition( uno::Any( getAccessibleContext() ) );
1149 }
1150 return aRet;
1151 }
1152 if (xParentContext->getAccessibleRole() != AccessibleRole::SHAPE)
1153 {
1154 return aRet;
1155 }
1156
1157 SdrObjList *pGrpList = nullptr;
1159 pGrpList = pObj->getParentSdrObjectFromSdrObject()->GetSubList();
1160 else
1161 return aRet;
1162
1163 std::vector< uno::Reference<drawing::XShape> > vXShapes;
1164 if (pGrpList)
1165 {
1166 const size_t nObj = pGrpList->GetObjCount();
1167 for(size_t i = 0 ; i < nObj ; ++i)
1168 {
1169 SdrObject *pSubObj = pGrpList->GetObj(i);
1170 if (pSubObj &&
1171 xParentContext->getAccessibleChild(i)->getAccessibleContext()->getAccessibleRole() != AccessibleRole::GROUP_BOX)
1172 {
1173 vXShapes.push_back( GetXShapeForSdrObject(pSubObj) );
1174 }
1175 }
1176 }
1177
1178 std::sort( vXShapes.begin(), vXShapes.end(), XShapePosCompareHelper() );
1179
1180 //get the index of the selected object in the group
1181 //we start counting position from 1
1182 sal_Int32 nPos = 1;
1183 for ( const auto& rpShape : vXShapes )
1184 {
1185 if ( rpShape.get() == mxShape.get() )
1186 {
1187 sal_Int32* pArray = aRet.getArray();
1188 pArray[0] = nGroupLevel;
1189 pArray[1] = vXShapes.size();
1190 pArray[2] = nPos;
1191 break;
1192 }
1193 nPos++;
1194 }
1195
1196 return aRet;
1197}
1198
1200{
1201 OUString aRet;
1202
1204 if(pObj == nullptr )
1205 {
1206 return aRet;
1207 }
1209 {
1210 Reference< XAccessibleGroupPosition > xGroupPosition( maShapeTreeInfo.GetDocumentWindow(), uno::UNO_QUERY );
1211 if (xGroupPosition.is())
1212 {
1213 aRet = xGroupPosition->getObjectLink( uno::Any( getAccessibleContext() ) );
1214 }
1215 }
1216 return aRet;
1217}
1218
1219// XAccessibleHypertext
1221{
1222 // MT: Introduced with IA2 CWS, but SvxAccessibleHyperlink was redundant to svx::AccessibleHyperlink which we introduced meanwhile.
1223 // Code need to be adapted...
1224 return 0;
1225
1226 /*
1227 SvxAccessibleHyperlink* pLink = new SvxAccessibleHyperlink(m_pShape,this);
1228 if (pLink->IsValidHyperlink())
1229 return 1;
1230 else
1231 return 0;
1232 */
1233}
1234uno::Reference< XAccessibleHyperlink > SAL_CALL
1236{
1237 uno::Reference< XAccessibleHyperlink > xRet;
1238 // MT: Introduced with IA2 CWS, but SvxAccessibleHyperlink was redundant to svx::AccessibleHyperlink which we introduced meanwhile.
1239 // Code need to be adapted...
1240 /*
1241 SvxAccessibleHyperlink* pLink = new SvxAccessibleHyperlink(m_pShape,this);
1242 if (pLink->IsValidHyperlink())
1243 xRet = pLink;
1244 if( !xRet.is() )
1245 throw css::lang::IndexOutOfBoundsException();
1246 */
1247 return xRet;
1248}
1249sal_Int32 SAL_CALL AccessibleShape::getHyperLinkIndex( sal_Int32 )
1250{
1251 return 0;
1252}
1253// XAccessibleText
1254sal_Int32 SAL_CALL AccessibleShape::getCaretPosition( ){return 0;}
1255sal_Bool SAL_CALL AccessibleShape::setCaretPosition( sal_Int32 ){return false;}
1256sal_Unicode SAL_CALL AccessibleShape::getCharacter( sal_Int32 ){return 0;}
1257css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleShape::getCharacterAttributes( sal_Int32, const css::uno::Sequence< OUString >& )
1258{
1259 uno::Sequence< css::beans::PropertyValue > aValues(0);
1260 return aValues;
1261}
1262css::awt::Rectangle SAL_CALL AccessibleShape::getCharacterBounds( sal_Int32 )
1263{
1264 return css::awt::Rectangle(0, 0, 0, 0 );
1265}
1266sal_Int32 SAL_CALL AccessibleShape::getCharacterCount( ){return 0;}
1267sal_Int32 SAL_CALL AccessibleShape::getIndexAtPoint( const css::awt::Point& ){return 0;}
1268OUString SAL_CALL AccessibleShape::getSelectedText( ){return OUString();}
1269sal_Int32 SAL_CALL AccessibleShape::getSelectionStart( ){return 0;}
1270sal_Int32 SAL_CALL AccessibleShape::getSelectionEnd( ){return 0;}
1271sal_Bool SAL_CALL AccessibleShape::setSelection( sal_Int32, sal_Int32 ){return true;}
1272OUString SAL_CALL AccessibleShape::getText( ){return OUString();}
1273OUString SAL_CALL AccessibleShape::getTextRange( sal_Int32, sal_Int32 ){return OUString();}
1274css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextAtIndex( sal_Int32, sal_Int16 )
1275{
1276 css::accessibility::TextSegment aResult;
1277 return aResult;
1278}
1279css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBeforeIndex( sal_Int32, sal_Int16 )
1280{
1281 css::accessibility::TextSegment aResult;
1282 return aResult;
1283}
1284css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBehindIndex( sal_Int32, sal_Int16 )
1285{
1286 css::accessibility::TextSegment aResult;
1287 return aResult;
1288}
1289sal_Bool SAL_CALL AccessibleShape::copyText( sal_Int32, sal_Int32 ){return true;}
1290sal_Bool SAL_CALL AccessibleShape::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ){return false;}
1291
1292} // end of namespace accessibility
1293
1294/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unotools::WeakReference< AnimationNode > mxParent
AnyEventRef aEvent
void SetAlpha(sal_uInt8 nAlpha)
constexpr tools::Long getX() const
constexpr tools::Long getY() const
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2208
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:785
size_t GetObjCount() const
Definition: svdpage.cxx:779
Abstract DrawObject.
Definition: svdobj.hxx:260
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:4020
virtual OUString GetTitle() const
Definition: svdobj.cxx:817
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1833
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:905
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:717
virtual OUString GetDescription() const
Definition: svdobj.cxx:861
virtual const OUString & GetName() const
Definition: svdobj.cxx:771
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:722
bool CanCreateEditOutlinerParaObject() const
Definition: svdotext.cxx:853
constexpr tools::Long getHeight() const
constexpr tools::Long getWidth() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
virtual bool SetState(sal_Int64 aState)
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual bool ResetState(sal_Int64 aState)
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
void CommitChange(sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue, sal_Int32 nValueIndex)
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
bool GetState(sal_Int64 aState)
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
void SetAccessibleDescription(const OUString &rsDescription, StringOrigin eDescriptionOrigin)
void SetAccessibleName(const OUString &rsName, StringOrigin eNameOrigin)
virtual sal_Int16 SAL_CALL getAccessibleRole() override
@descr This class is a container for the information specific for a single shape that is passed to th...
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
const IAccessibleViewForwarder * GetViewForwarder() const
Return the current view forwarder.
const css::uno::Reference< css::accessibility::XAccessibleComponent > & GetDocumentWindow() const
Deprecated.
SdrView * GetSdrView() const
Return the current SdrView.
void SetModelBroadcaster(const css::uno::Reference< css::document::XShapeEventBroadcaster > &rxModelBroadcaster)
Set a new broadcaster that sends events indicating shape changes.
vcl::Window * GetWindow() const
Return the current Window.
const css::uno::Reference< css::document::XShapeEventBroadcaster > & GetModelBroadcaster() const
Return the current model broadcaster.
This base class provides a base implementation for all shapes.
virtual OUString SAL_CALL getSelectedText() override
virtual OUString CreateAccessibleName() override
Create a unique name string that contains the accessible name.
OUString GetFullAccessibleName(AccessibleShape *shape)
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
This call is forwarded to a) the base class and b) to the accessible edit engine if it is present.
void UpdateStates()
Update the <const>OPAQUE</const> and <const>SELECTED</const> state.
virtual css::awt::Point SAL_CALL getLocation() override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
void UpdateNameAndDescription()
Call this method when the title, name, or description of the mxShape member (may) have been changed.
virtual void Init()
Initialize a new shape.
virtual sal_Int32 SAL_CALL getBackground() override
css::uno::Reference< css::drawing::XShape > mxShape
Reference to the actual shape.
virtual void SAL_CALL release() noexcept override
AccessibleShape(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo)
Create a new accessible object that makes the given shape accessible.
virtual OUString CreateAccessibleBaseName()
Create a base name string that contains the accessible name.
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
sal_Int32 m_nIndexInParent
the index in parent.
virtual sal_Bool SAL_CALL setSelection(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual bool ResetState(sal_Int64 aState) override
Reset the specified state.
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual sal_Int32 SAL_CALL getSelectionEnd() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
bool GetState(sal_Int64 aState)
Return the state of the specified state.
std::unique_ptr< AccessibleTextHelper > mpText
The accessible text engine.
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual ~AccessibleShape() override
The destructor releases its children manager and text engine if still existent.
virtual css::awt::Rectangle SAL_CALL getCharacterBounds(sal_Int32 nIndex) override
virtual sal_Int32 SAL_CALL getSelectionStart() override
virtual void SAL_CALL acquire() noexcept override
virtual OUString SAL_CALL getAccessibleName() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Return the number of currently visible children.
virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
SdrObject * m_pShape
This object can be removed when we have an extra interface to ask if the shape is selected.
virtual sal_Unicode SAL_CALL getCharacter(sal_Int32 nIndex) override
virtual OUString SAL_CALL getObjectLink(const css::uno::Any &accoject) override
AccessibleShapeTreeInfo maShapeTreeInfo
Bundle of information passed to all shapes in a document tree.
virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
std::unique_ptr< ChildrenManager > mpChildrenManager
Children manager. May be empty if there are no children.
virtual sal_Bool SAL_CALL copyText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
This call is forwarded to a) the base class and b) to the accessible edit engine if it is present.
virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual OUString GetStyle() const
virtual sal_Int32 SAL_CALL getHyperLinkCount() override
virtual void SAL_CALL clearAccessibleSelection() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual OUString SAL_CALL getText() override
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual void SAL_CALL notifyShapeEvent(const css::document::EventObject &rEventObject) override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getGroupPosition(const css::uno::Any &rAny) override
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual sal_Int32 SAL_CALL getCaretPosition() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL setCaretPosition(sal_Int32 nIndex) override
virtual void SAL_CALL disposing() override
This method is called from the component helper base class while disposing.
IAccessibleParent * mpParent
This object can be used to modify the child list of our parent.
virtual OUString SAL_CALL getAccessibleDescription() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
Return this objects index among the parents children.
virtual sal_Int32 SAL_CALL getIndexAtPoint(const css::awt::Point &aPoint) override
virtual sal_Int32 SAL_CALL getCharacterCount() override
virtual bool SetState(sal_Int64 aState) override
Set the specified state.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Int32 SAL_CALL getHyperLinkIndex(sal_Int32 nCharIndex) override
virtual sal_Bool SAL_CALL scrollSubstringTo(sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink(sal_Int32 nLinkIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Return this object's role.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The implementation below is at the moment straightforward.
Helper class for objects containing EditEngine/Outliner text.
The AccessibleChildrenManager class acts as a cache of the accessible objects of the currently visibl...
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessibleCaption(const css::uno::Reference< css::drawing::XShape > &)
virtual Point LogicToPixel(const Point &rPoint) const =0
Transform the specified point from internal coordinates in 100th of mm to an absolute screen position...
static OUString CreateAccessibleBaseName(const css::uno::Reference< css::drawing::XShape > &rxShape)
get the accessible base name for an object
static ShapeTypeHandler & Instance()
This function returns a reference to the only instance of this class.
css::uno::Type const & get()
tools::Rectangle GetIntersection(const tools::Rectangle &rRect) const
constexpr tools::Long Top() const
tools::Long getOpenHeight() const
tools::Long getOpenWidth() const
constexpr tools::Long Left() const
bool HasFocus() const
::OutputDevice const * GetOutDev() const
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
RegionData_Impl * mpParent
float u
float y
float x
sal_Int32 nState
OUString sName
std::mutex m_aMutex
sal_Int32 nIndex
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
int i
uno::Reference< drawing::XShape > const mxShape
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
unsigned char sal_uInt8
unsigned char sal_Bool
sal_uInt16 sal_Unicode
UNO3_GETIMPLEMENTATION_IMPL(SvxDrawPage)
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
returns a StarOffice API wrapper for the given SdrObject
Definition: unoshape.cxx:4013