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 static_cast<uno::XWeak*>(this));
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 static_cast<uno::XWeak*>(this));
539 ::Size (aBoundingBox.Width, aBoundingBox.Height));
540 ::Point aPixelPosition = maShapeTreeInfo.GetViewForwarder()->LogicToPixel (
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}
891
892// document::XShapeEventListener
893void SAL_CALL
894 AccessibleShape::notifyShapeEvent (const document::EventObject& rEventObject)
895{
896 if (rEventObject.EventName != "ShapeModified")
897 return;
898
899 //Need to update text children when receiving ShapeModified hint when exiting edit mode for text box
900 if (mpText)
901 mpText->UpdateChildren();
902
903
904 // Some property of a shape has been modified. Send an event
905 // that indicates a change of the visible data to all listeners.
907 AccessibleEventId::VISIBLE_DATA_CHANGED,
908 uno::Any(),
909 uno::Any());
910
911 // Name and Description may have changed. Update the local
912 // values accordingly.
914}
915
916// lang::XUnoTunnel
918
919// IAccessibleViewForwarderListener
920void AccessibleShape::ViewForwarderChanged()
921{
922 // Inform all listeners that the graphical representation (i.e. size
923 // and/or position) of the shape has changed.
924 CommitChange (AccessibleEventId::VISIBLE_DATA_CHANGED,
925 uno::Any(),
926 uno::Any());
927
928 // Tell children manager of the modified view forwarder.
929 if (mpChildrenManager != nullptr)
930 mpChildrenManager->ViewForwarderChanged();
931
932 // update our children that our screen position might have changed
933 if( mpText )
934 mpText->UpdateChildren();
935}
936
937// protected internal
938// Set this object's name if is different to the current name.
940{
942}
943
944
946{
947 return GetFullAccessibleName(this);
948}
949
951{
952 OUString sName (shape->CreateAccessibleBaseName());
953 // Append the shape's index to the name to disambiguate between shapes
954 // of the same type. If such an index where not given to the
955 // constructor then use the z-order instead. If even that does not exist
956 // we throw an exception.
957 OUString nameStr;
958 if (shape->m_pShape)
959 nameStr = shape->m_pShape->GetName();
960 if (nameStr.isEmpty())
961 {
962 sName += " ";
963 }
964 else
965 {
966 sName = nameStr;
967 }
968
969 //If the new produced name if not the same with last,notify name changed
970 //Event
971 if (aAccName != sName && !aAccName.isEmpty())
972 {
973 uno::Any aOldValue, aNewValue;
974 aOldValue <<= aAccName;
975 aNewValue <<= sName;
977 AccessibleEventId::NAME_CHANGED,
978 aNewValue,
979 aOldValue);
980 }
981 aAccName = sName;
982 return sName;
983}
984
985// protected
987{
988 SolarMutexGuard aSolarGuard;
989 ::osl::MutexGuard aGuard (m_aMutex);
990
991 // Make sure to send an event that this object loses the focus in the
992 // case that it has the focus.
993 mnStateSet &= ~AccessibleStateType::FOCUSED;
994
995 // Unregister from model.
997 maShapeTreeInfo.GetModelBroadcaster()->removeShapeEventListener(mxShape,
998 static_cast<document::XShapeEventListener*>(this));
999
1000 // Release the child containers.
1001 if (mpChildrenManager != nullptr)
1002 {
1003 mpChildrenManager.reset();
1004 }
1005 if (mpText != nullptr)
1006 {
1007 mpText->Dispose();
1008 mpText.reset();
1009 }
1010
1011 // Cleanup. Remove references to objects to allow them to be
1012 // destroyed.
1013 mxShape = nullptr;
1015
1016 // Call base classes.
1017 AccessibleContextBase::dispose ();
1018}
1019
1020sal_Int64 SAL_CALL
1022{
1023 ThrowIfDisposed ();
1024 // Use a simple but slow solution for now. Optimize later.
1025
1026 sal_Int64 nIndex = m_nIndexInParent;
1027 if ( -1 == nIndex )
1029 return nIndex;
1030}
1031
1032
1034{
1035 // Ignore missing title, name, or description. There are fallbacks for
1036 // them.
1037 try
1038 {
1039 Reference<beans::XPropertySet> xSet (mxShape, uno::UNO_QUERY_THROW);
1040
1041 // Get the accessible name.
1042 OUString sString = GetOptionalProperty(xSet, "Title");
1043 if (!sString.isEmpty())
1044 {
1046 }
1047 else
1048 {
1049 sString = GetOptionalProperty(xSet, "Name");
1050 if (!sString.isEmpty())
1052 }
1053
1054 // Get the accessible description.
1055 sString = GetOptionalProperty(xSet, "Description");
1056 if (!sString.isEmpty())
1058 }
1059 catch (uno::RuntimeException&)
1060 {
1061 }
1062}
1063
1064// Return this object's role.
1066{
1067 sal_Int16 nAccessibleRole = AccessibleRole::SHAPE ;
1068 switch (ShapeTypeHandler::Instance().GetTypeId (mxShape))
1069 {
1071 nAccessibleRole = AccessibleRole::GRAPHIC ; break;
1072 case DRAWING_OLE:
1073 nAccessibleRole = AccessibleRole::EMBEDDED_OBJECT ; break;
1074
1075 default:
1076 nAccessibleRole = AccessibleContextBase::getAccessibleRole();
1077 break;
1078 }
1079
1080 return nAccessibleRole;
1081}
1082
1083namespace {
1084
1085//sort the drawing objects from up to down, from left to right
1086struct XShapePosCompareHelper
1087{
1088 bool operator() ( const uno::Reference<drawing::XShape>& xshape1,
1089 const uno::Reference<drawing::XShape>& xshape2 ) const
1090 {
1093 if(pObj1 && pObj2)
1094 return pObj1->GetOrdNum() < pObj2->GetOrdNum();
1095 else
1096 return false;
1097 }
1098};
1099
1100}
1101//end of group position
1102
1103// XAccessibleGroupPosition
1104uno::Sequence< sal_Int32 > SAL_CALL
1106{
1107 // we will return the:
1108 // [0] group level
1109 // [1] similar items counts in the group
1110 // [2] the position of the object in the group
1111 uno::Sequence< sal_Int32 > aRet{ 0, 0, 0 };
1112
1113 css::uno::Reference<XAccessible> xParent = getAccessibleParent();
1114 if (!xParent.is())
1115 {
1116 return aRet;
1117 }
1119
1120
1121 if(pObj == nullptr )
1122 {
1123 return aRet;
1124 }
1125
1126 // Compute object's group level.
1127 sal_Int32 nGroupLevel = 0;
1129 while( pUper )
1130 {
1131 ++nGroupLevel;
1132 pUper = pUper->getParentSdrObjectFromSdrObject();
1133 }
1134
1135 css::uno::Reference<XAccessibleContext> xParentContext = xParent->getAccessibleContext();
1136 if( xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT ||
1137 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_PRESENTATION ||
1138 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_SPREADSHEET ||
1139 xParentContext->getAccessibleRole() == AccessibleRole::DOCUMENT_TEXT )//Document
1140 {
1141 Reference< XAccessibleGroupPosition > xGroupPosition( xParent,uno::UNO_QUERY );
1142 if ( xGroupPosition.is() )
1143 {
1144 aRet = xGroupPosition->getGroupPosition( uno::Any( getAccessibleContext() ) );
1145 }
1146 return aRet;
1147 }
1148 if (xParentContext->getAccessibleRole() != AccessibleRole::SHAPE)
1149 {
1150 return aRet;
1151 }
1152
1153 SdrObjList *pGrpList = nullptr;
1155 pGrpList = pObj->getParentSdrObjectFromSdrObject()->GetSubList();
1156 else
1157 return aRet;
1158
1159 std::vector< uno::Reference<drawing::XShape> > vXShapes;
1160 if (pGrpList)
1161 {
1162 const size_t nObj = pGrpList->GetObjCount();
1163 for(size_t i = 0 ; i < nObj ; ++i)
1164 {
1165 SdrObject *pSubObj = pGrpList->GetObj(i);
1166 if (pSubObj &&
1167 xParentContext->getAccessibleChild(i)->getAccessibleContext()->getAccessibleRole() != AccessibleRole::GROUP_BOX)
1168 {
1169 vXShapes.push_back( GetXShapeForSdrObject(pSubObj) );
1170 }
1171 }
1172 }
1173
1174 std::sort( vXShapes.begin(), vXShapes.end(), XShapePosCompareHelper() );
1175
1176 //get the index of the selected object in the group
1177 //we start counting position from 1
1178 sal_Int32 nPos = 1;
1179 for ( const auto& rpShape : vXShapes )
1180 {
1181 if ( rpShape.get() == mxShape.get() )
1182 {
1183 sal_Int32* pArray = aRet.getArray();
1184 pArray[0] = nGroupLevel;
1185 pArray[1] = vXShapes.size();
1186 pArray[2] = nPos;
1187 break;
1188 }
1189 nPos++;
1190 }
1191
1192 return aRet;
1193}
1194
1196{
1197 OUString aRet;
1198
1200 if(pObj == nullptr )
1201 {
1202 return aRet;
1203 }
1205 {
1206 Reference< XAccessibleGroupPosition > xGroupPosition( maShapeTreeInfo.GetDocumentWindow(), uno::UNO_QUERY );
1207 if (xGroupPosition.is())
1208 {
1209 aRet = xGroupPosition->getObjectLink( uno::Any( getAccessibleContext() ) );
1210 }
1211 }
1212 return aRet;
1213}
1214
1215// XAccessibleHypertext
1217{
1218 // MT: Introduced with IA2 CWS, but SvxAccessibleHyperlink was redundant to svx::AccessibleHyperlink which we introduced meanwhile.
1219 // Code need to be adapted...
1220 return 0;
1221
1222 /*
1223 SvxAccessibleHyperlink* pLink = new SvxAccessibleHyperlink(m_pShape,this);
1224 if (pLink->IsValidHyperlink())
1225 return 1;
1226 else
1227 return 0;
1228 */
1229}
1230uno::Reference< XAccessibleHyperlink > SAL_CALL
1232{
1233 uno::Reference< XAccessibleHyperlink > xRet;
1234 // MT: Introduced with IA2 CWS, but SvxAccessibleHyperlink was redundant to svx::AccessibleHyperlink which we introduced meanwhile.
1235 // Code need to be adapted...
1236 /*
1237 SvxAccessibleHyperlink* pLink = new SvxAccessibleHyperlink(m_pShape,this);
1238 if (pLink->IsValidHyperlink())
1239 xRet = pLink;
1240 if( !xRet.is() )
1241 throw css::lang::IndexOutOfBoundsException();
1242 */
1243 return xRet;
1244}
1245sal_Int32 SAL_CALL AccessibleShape::getHyperLinkIndex( sal_Int32 )
1246{
1247 return 0;
1248}
1249// XAccessibleText
1250sal_Int32 SAL_CALL AccessibleShape::getCaretPosition( ){return 0;}
1251sal_Bool SAL_CALL AccessibleShape::setCaretPosition( sal_Int32 ){return false;}
1252sal_Unicode SAL_CALL AccessibleShape::getCharacter( sal_Int32 ){return 0;}
1253css::uno::Sequence< css::beans::PropertyValue > SAL_CALL AccessibleShape::getCharacterAttributes( sal_Int32, const css::uno::Sequence< OUString >& )
1254{
1255 uno::Sequence< css::beans::PropertyValue > aValues(0);
1256 return aValues;
1257}
1258css::awt::Rectangle SAL_CALL AccessibleShape::getCharacterBounds( sal_Int32 )
1259{
1260 return css::awt::Rectangle(0, 0, 0, 0 );
1261}
1262sal_Int32 SAL_CALL AccessibleShape::getCharacterCount( ){return 0;}
1263sal_Int32 SAL_CALL AccessibleShape::getIndexAtPoint( const css::awt::Point& ){return 0;}
1264OUString SAL_CALL AccessibleShape::getSelectedText( ){return OUString();}
1265sal_Int32 SAL_CALL AccessibleShape::getSelectionStart( ){return 0;}
1266sal_Int32 SAL_CALL AccessibleShape::getSelectionEnd( ){return 0;}
1267sal_Bool SAL_CALL AccessibleShape::setSelection( sal_Int32, sal_Int32 ){return true;}
1268OUString SAL_CALL AccessibleShape::getText( ){return OUString();}
1269OUString SAL_CALL AccessibleShape::getTextRange( sal_Int32, sal_Int32 ){return OUString();}
1270css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextAtIndex( sal_Int32, sal_Int16 )
1271{
1272 css::accessibility::TextSegment aResult;
1273 return aResult;
1274}
1275css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBeforeIndex( sal_Int32, sal_Int16 )
1276{
1277 css::accessibility::TextSegment aResult;
1278 return aResult;
1279}
1280css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBehindIndex( sal_Int32, sal_Int16 )
1281{
1282 css::accessibility::TextSegment aResult;
1283 return aResult;
1284}
1285sal_Bool SAL_CALL AccessibleShape::copyText( sal_Int32, sal_Int32 ){return true;}
1286sal_Bool SAL_CALL AccessibleShape::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ){return false;}
1287
1288} // end of namespace accessibility
1289
1290/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
WeakReference< XInterface > mxParent
AnyEventRef aEvent
void SetAlpha(sal_uInt8 nAlpha)
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2206
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
Abstract DrawObject.
Definition: svdobj.hxx:261
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:3962
virtual OUString GetTitle() const
Definition: svdobj.cxx:815
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1836
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:869
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:715
virtual OUString GetDescription() const
Definition: svdobj.cxx:859
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:720
bool CanCreateEditOutlinerParaObject() const
Definition: svdotext.cxx:847
constexpr tools::Long getHeight() const
constexpr tools::Long getWidth() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
void CommitChange(sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
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
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:3217
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:3955