20 #include <rtl/ref.hxx>
27 #include <unordered_map>
33 #include <strings.hrc>
60 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
61 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
62 #include <com/sun/star/accessibility/AccessibleRole.hpp>
63 #include <com/sun/star/beans/XPropertySet.hpp>
64 #include <com/sun/star/document/XShapeEventBroadcaster.hpp>
71 #include <drawdoc.hxx>
90 typedef std::pair<const key_type,mapped_type>
value_type;
91 typedef std::map<key_type, mapped_type>::iterator
iterator;
94 std::map <key_type, mapped_type>
maMap;
97 #if OSL_DEBUG_LEVEL > 0
102 #if OSL_DEBUG_LEVEL > 0
107 iterator
begin() {
return maMap.begin(); }
108 iterator
end() {
return maMap.end(); }
109 bool empty()
const {
return maMap.empty(); }
111 iterator
find(
const key_type& key) {
return maMap.find(key); }
112 template<
class... Args>
113 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
114 iterator
erase(const_iterator
const & pos) {
return maMap.erase(pos); }
119 class SwDrawModellListener_Impl :
public SfxListener,
120 public ::cppu::WeakImplHelper< document::XShapeEventBroadcaster >
122 mutable ::osl::Mutex maListenerMutex;
124 std::unordered_multimap<css::uno::Reference< css::drawing::XShape >, css::uno::Reference< css::document::XShapeEventListener >> maShapeListeners;
127 virtual ~SwDrawModellListener_Impl()
override;
130 explicit SwDrawModellListener_Impl(
SdrModel *pDrawModel );
133 virtual void SAL_CALL addEventListener(
const uno::Reference< document::XEventListener >& xListener )
override;
134 virtual void SAL_CALL removeEventListener(
const uno::Reference< document::XEventListener >& xListener )
override;
136 virtual void SAL_CALL addShapeEventListener(
const css::uno::Reference< css::drawing::XShape >& xShape,
const css::uno::Reference< css::document::XShapeEventListener >& xListener )
override;
137 virtual void SAL_CALL removeShapeEventListener(
const css::uno::Reference< css::drawing::XShape >& xShape,
const css::uno::Reference< css::document::XShapeEventListener >& xListener )
override;
145 SwDrawModellListener_Impl::SwDrawModellListener_Impl(
SdrModel *pDrawModel ) :
146 maEventListeners( maListenerMutex ),
147 mpDrawModel( pDrawModel )
152 SwDrawModellListener_Impl::~SwDrawModellListener_Impl()
157 void SAL_CALL SwDrawModellListener_Impl::addEventListener(
const uno::Reference< document::XEventListener >& xListener )
159 maEventListeners.addInterface( xListener );
162 void SAL_CALL SwDrawModellListener_Impl::removeEventListener(
const uno::Reference< document::XEventListener >& xListener )
164 maEventListeners.removeInterface( xListener );
167 void SAL_CALL SwDrawModellListener_Impl::addShapeEventListener(
168 const css::uno::Reference< css::drawing::XShape >& xShape,
169 const uno::Reference< document::XShapeEventListener >& xListener )
171 assert(xShape.is() &&
"no shape?");
172 osl::MutexGuard aGuard(maListenerMutex);
173 maShapeListeners.emplace(xShape, xListener);
176 void SAL_CALL SwDrawModellListener_Impl::removeShapeEventListener(
177 const css::uno::Reference< css::drawing::XShape >& xShape,
178 const uno::Reference< document::XShapeEventListener >& xListener )
180 osl::MutexGuard aGuard(maListenerMutex);
181 auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
182 for (
auto it = itBegin; it != itEnd; ++it)
183 if (it->second == xListener)
185 maShapeListeners.erase(it);
195 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
200 dynamic_cast< const SwVirtFlyDrawObj* >(pSdrHint->
GetObject()) !=
nullptr ||
201 isType<SdrObject>(pSdrHint->
GetObject()) ) )
206 OSL_ENSURE( mpDrawModel,
"draw model listener is disposed" );
210 document::EventObject
aEvent;
215 while( aIter.hasMoreElements() )
219 aIter.next()->notifyEvent( aEvent );
221 catch( uno::RuntimeException
const & )
228 if (pSdrHint->
GetKind() == SdrHintKind::ObjectChange)
231 uno::Reference<drawing::XShape> xShape(pSdrObject->getUnoShape(), uno::UNO_QUERY);
232 osl::MutexGuard aGuard(maListenerMutex);
233 auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
234 for (
auto it = itBegin; it != itEnd; ++it)
235 it->second->notifyShapeEvent(aEvent);
239 void SwDrawModellListener_Impl::Dispose()
241 if (mpDrawModel !=
nullptr) {
242 EndListening( *mpDrawModel );
244 mpDrawModel =
nullptr;
256 typedef std::map<key_type, mapped_type>::iterator
iterator;
262 std::map<key_type, mapped_type>
maMap;
271 uno::Reference < document::XShapeEventBroadcaster > xModelBroadcaster =
272 new SwDrawModellListener_Impl(
279 const ::accessibility::AccessibleShapeTreeInfo&
GetInfo()
const {
return maInfo; }
281 std::unique_ptr<SwAccessibleObjShape_Impl[]>
Copy(
size_t& rSize,
283 SwAccessibleObjShape_Impl **pSelShape )
const;
285 iterator
end() {
return maMap.end(); }
286 const_iterator
cbegin()
const {
return maMap.cbegin(); }
287 const_iterator
cend()
const {
return maMap.cend(); }
288 bool empty()
const {
return maMap.empty(); }
289 iterator
find(
const key_type& key) {
return maMap.find(key); }
290 template<
class... Args>
291 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
292 iterator
erase(const_iterator
const & pos) {
return maMap.erase(pos); }
299 static_cast < SwDrawModellListener_Impl * >( xBrd.get() )->
Dispose();
302 std::unique_ptr<SwAccessibleObjShape_Impl[]>
305 SwAccessibleObjShape_Impl **pSelStart )
const
307 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
308 SwAccessibleObjShape_Impl *pSelShape =
nullptr;
311 rSize = maMap.size();
315 pShapes.reset(
new SwAccessibleObjShape_Impl[rSize]);
317 SwAccessibleObjShape_Impl *pShape = pShapes.get();
318 pSelShape = &(pShapes[rSize]);
319 for(
const auto& rEntry : maMap )
322 uno::Reference < XAccessible > xAcc( rEntry.second );
327 pSelShape->first = pObj;
335 pShape->first = pObj;
342 assert(pSelShape == pShape);
346 *pSelStart = pSelShape;
365 uno::WeakReference < XAccessible >
mxAcc;
382 const SwAccessibleChild& rFrameOrObj )
384 maFrameOrObj( rFrameOrObj ),
387 mpParentFrame( nullptr )
391 const SwAccessibleChild& rFrameOrObj )
392 : maFrameOrObj( rFrameOrObj ),
395 mpParentFrame( nullptr )
398 "wrong event constructor, DISPOSE only");
404 mpParentFrame( nullptr )
407 "wrong event constructor, SHAPE_SELECTION only" );
412 const SwAccessibleChild& rFrameOrObj,
416 maFrameOrObj( rFrameOrObj ),
419 mpParentFrame( nullptr )
423 "wrong event constructor, (CHILD_)POS_CHANGED only" );
428 const SwAccessibleChild& rFrameOrObj,
431 maFrameOrObj( rFrameOrObj ),
433 mnStates( _nStates ),
434 mpParentFrame( nullptr )
437 "wrong event constructor, CARET_OR_STATES only" );
441 const SwAccessibleChild& rFrameOrObj,
const SwRect& rR ) :
443 maFrameOrObj( rFrameOrObj ),
446 mpParentFrame( pParentFrame )
449 "wrong event constructor, CHILD_POS_CHANGED only" );
464 uno::Reference < XAccessible > xTmp( mxAcc );
466 static_cast<SwAccessibleContext*>( xTmp.get() ) );
489 mnStates |= _nStates;
546 size_t size()
const {
return maEvents.size(); }
547 std::list<SwAccessibleEvent_Impl>::iterator
begin() {
return maEvents.begin(); }
548 std::list<SwAccessibleEvent_Impl>::iterator
end() {
return maEvents.end(); }
549 std::list<SwAccessibleEvent_Impl>::iterator
insert(
const std::list<SwAccessibleEvent_Impl>::iterator& aIter,
552 return maEvents.insert( aIter, rEvent );
554 std::list<SwAccessibleEvent_Impl>::iterator
erase(
const std::list<SwAccessibleEvent_Impl>::iterator& aPos )
556 return maEvents.erase( aPos );
564 size_t nSize =
size();
570 for (
auto li =
begin(); li !=
end(); )
572 if (li->IsNoXaccParentFrame())
580 assert(
size() + lstEvent.
size() == nSize);
582 assert(
size() == nSize);
587 struct SwAccessibleChildFunc
589 bool operator()(
const SwAccessibleChild& r1,
590 const SwAccessibleChild& r2 )
const
592 const void *p1 = r1.GetSwFrame()
593 ? static_cast <
const void * >( r1.GetSwFrame())
594 : ( r1.GetDrawObject()
595 ? static_cast <
const void * >( r1.GetDrawObject() )
596 : static_cast < const void * >( r1.GetWindow() ) );
597 const void *p2 = r2.GetSwFrame()
598 ? static_cast <
const void * >( r2.GetSwFrame())
599 : ( r2.GetDrawObject()
600 ? static_cast <
const void * >( r2.GetDrawObject() )
601 : static_cast < const void * >( r2.GetWindow() ) );
615 typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
616 typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
618 std::map <key_type,mapped_type,key_compare>
maMap;
620 iterator
end() {
return maMap.end(); }
621 iterator
find(
const key_type& key) {
return maMap.find(key); }
622 template<
class... Args>
623 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
624 iterator
erase(const_iterator
const & pos) {
return maMap.erase(pos); }
629 struct SwAccessibleParaSelection
634 SwAccessibleParaSelection(
const TextFrameIndex nStartOfSelection_,
636 : nStartOfSelection(nStartOfSelection_)
637 , nEndOfSelection(nEndOfSelection_)
641 struct SwXAccWeakRefComp
643 bool operator()(
const uno::WeakReference<XAccessible>& _rXAccWeakRef1,
644 const uno::WeakReference<XAccessible>& _rXAccWeakRef2 )
const
646 return _rXAccWeakRef1.
get() < _rXAccWeakRef2.get();
655 typedef uno::WeakReference < XAccessible >
key_type;
659 typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
660 typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
662 std::map<key_type,mapped_type,key_compare>
maMap;
664 iterator
begin() {
return maMap.begin(); }
665 iterator
end() {
return maMap.end(); }
666 iterator
find(
const key_type& key) {
return maMap.find(key); }
667 template<
class... Args>
668 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
669 iterator
erase(const_iterator
const & pos) {
return maMap.erase(pos); }
699 const SwRect& _rPreviewPgSwRect,
700 const Size& _rPreviewWinSize );
706 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
709 const Size& _rPreviewWinSize );
720 const Point& rPoint )
const;
733 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
736 const Size& _rPreviewWinSize )
745 SwAccessibleChild aPage;
750 for (
auto & rpPreviewPage : _rPreviewPages )
752 aPage = rpPreviewPage->pPage;
755 tools::Rectangle aPreviewPgRect( rpPreviewPage->aPreviewWinPos, rpPreviewPage->aPageSize );
759 SwRect aLogicPgSwRect( aPage.GetBox( rAccMap ) );
763 if ( rpPreviewPage->bVisible )
765 if ( !rpPreviewPage->pPage->IsEmptyPage() )
787 struct ContainsPredicate
790 explicit ContainsPredicate(
const Point& rPoint ) : mrPoint(rPoint) {}
800 const Point& rPoint )
const
807 Rectangles::const_iterator aBegin =
maLogicRects.begin();
809 Rectangles::const_iterator aFound = std::find_if( aBegin, aEnd,
810 ContainsPredicate( rPoint ) );
816 aPoint -= (
maLogicRects.begin() + (aFound-aBegin))->TopLeft();
830 SwRect& _iorLogicPgSwRect,
831 const SwRect& _rPreviewPgSwRect,
832 const Size& _rPreviewWinSize )
835 const SwRect aPreviewWinSwRect(
Point( 0, 0 ), _rPreviewWinSize );
837 SwRect aVisPreviewPgSwRect( _rPreviewPgSwRect );
842 nTmpDiff = aVisPreviewPgSwRect.
Left() - _rPreviewPgSwRect.
Left();
843 _iorLogicPgSwRect.
AddLeft( nTmpDiff );
845 nTmpDiff = aVisPreviewPgSwRect.
Top() - _rPreviewPgSwRect.
Top();
846 _iorLogicPgSwRect.
AddTop( nTmpDiff );
848 nTmpDiff = _rPreviewPgSwRect.
Right() - aVisPreviewPgSwRect.
Right();
849 _iorLogicPgSwRect.
AddRight( - nTmpDiff );
851 nTmpDiff = _rPreviewPgSwRect.
Bottom() - aVisPreviewPgSwRect.
Bottom();
852 _iorLogicPgSwRect.
AddBottom( - nTmpDiff );
884 bRet = (pTabFrame1 == pTabFrame2);
900 uno::Reference < XAccessible > xAcc( (*aIter).second );
903 uno::Reference < XAccessibleContext > xContext(xAcc,uno::UNO_QUERY);
904 if (xContext.is() && xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
915 else if( xAccImpl.is() && xAccImpl->GetFrame() )
920 xAccImpl->InvalidateAttr();
925 xAccImpl->InvalidateContent();
928 xAccImpl->InvalidatePosOrSize( rEvent.
GetOldBox() );
935 assert(!
"dispose event has been stored");
946 xAccImpl->InvalidateCursorPos();
948 xAccImpl->InvalidateStates( rEvent.
GetStates() );
955 xAccImpl->InvalidateRelation(
956 AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED );
960 xAccImpl->InvalidateRelation(
961 AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED );
967 xAccImpl->InvalidateTextSelection();
987 "dispose event while firing events" );
999 "dispose events should not be stored" );
1000 bool bAppendEvent =
true;
1008 "invalid event combination" );
1021 "invalid event combination" );
1037 "invalid event combination" );
1048 "invalid event combination" );
1052 "invalid event combination" );
1059 bAppendEvent =
false;
1063 "invalid event combination" );
1068 mpEvents->erase( (*aIter).second );
1073 mpEvents->erase( (*aIter).second );
1086 const uno::Reference< XAccessible >& rAcc )
1096 SwAccessibleChild(pAccImpl->
GetFrame()),
1133 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
1134 SwAccessibleObjShape_Impl *pSelShape =
nullptr;
1144 osl::MutexGuard aGuard(
maMutex );
1146 pShapes =
mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
1159 while( aIter != aEndIter )
1161 uno::Reference < XAccessible > xAcc( (*aIter).second );
1163 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->SetState( AccessibleStateType::SELECTED );
1170 while( aIter != aEndIter )
1181 if(rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1183 uno::Reference < XAccessible > xAcc( (*aIter).second );
1185 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED );
1199 bool bMarked =
false;
1200 if( pCursor !=
nullptr )
1204 SwNodeOffset nFirstNode(pFrame->GetTextNodeFirst()->GetIndex());
1206 if (
sw::MergedPara const*
const pMerged = pFrame->GetMergedPara())
1208 nLastNode = pMerged->pLastNode->GetIndex();
1212 nLastNode = nFirstNode;
1220 if( rTmpCursor.HasMark() )
1228 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
1230 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1232 if( ( ((nHere == nStartIndex) && (nIndex >= pStart->
nContent.
GetIndex())) || (nHere > nStartIndex) )
1233 &&( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) )
1235 uno::Reference < XAccessible > xAcc( (*aIter).second );
1237 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->SetState( AccessibleStateType::SELECTED );
1241 uno::Reference < XAccessible > xAcc( (*aIter).second );
1243 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED );
1246 else if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA )
1248 uno::Reference<XAccessible>
const xAcc((*aIter).second);
1261 else if (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
1263 uno::Reference<XAccessible>
const xAcc((*aIter).second);
1282 SwAccessibleObjShape_Impl *pShape = pShapes.get();
1283 size_t nNumShapes = nShapes;
1286 if( pShape < pSelShape && (pShape->first==(*aIter).first) )
1288 uno::Reference < XAccessible > xAcc( (*aIter).second );
1290 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED );
1311 const SwFrame *pFrame = (*aIter).first;
1314 uno::Reference < XAccessible > xAcc = (*aIter).second;
1327 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1330 if (xAccParent.is())
1332 uno::Reference< XAccessibleContext > xAccContext = xAccParent->getAccessibleContext();
1333 if(xAccContext.is() && xAccContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1355 typedef std::vector< SwAccessibleContext* > VEC_PARA;
1359 bool bMarkChanged =
false;
1361 if( pCursor !=
nullptr )
1365 if( rTmpCursor.HasMark() )
1367 SwNodeIndex nStartIndex( rTmpCursor.Start()->nNode );
1369 for (; nStartIndex <= nEndIndex; ++nStartIndex)
1372 if(nStartIndex.GetNode().IsContentNode())
1376 if (mapTemp.
find(pFrame) != mapTemp.
end())
1381 else if( nStartIndex.GetNode().IsTableNode() )
1393 uno::Reference < XAccessible > xAcc = (*aIter).second;
1394 bool isChanged =
false;
1407 bMarkChanged =
true;
1408 vecAdd.push_back(static_cast< SwAccessibleContext * >(xAcc.get()));
1411 mapTemp.
emplace( pFrame, xAcc );
1425 uno::Reference < XAccessible > xAcc = (*aIter).second;
1427 static_cast< SwAccessibleContext * >(xAcc.get())->SetSelectedState(
false );
1429 vecRemove.push_back(static_cast< SwAccessibleContext * >(xAcc.get()));
1431 bMarkChanged =
true;
1436 while( aIter != mapTemp.
end() )
1448 AccessibleEventObject aEvent;
1449 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
1452 pAccPara->FireAccessibleEvent( aEvent );
1457 AccessibleEventObject aEvent;
1458 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
1461 pAccPara->FireAccessibleEvent( aEvent );
1469 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
1470 SwAccessibleObjShape_Impl *pSelShape =
nullptr;
1475 const size_t nSelShapes = pFESh ? pFESh->
IsObjSelected() : 0;
1479 if (bInvalidateFocusMode && nSelShapes != 1)
1484 osl::MutexGuard aGuard(
maMutex );
1486 pShapes =
mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
1492 typedef std::vector< ::rtl::Reference < ::accessibility::AccessibleShape > > VEC_SHAPE;
1493 VEC_SHAPE vecxShapeAdd;
1494 VEC_SHAPE vecxShapeRemove;
1495 int nCountSelectedShape=0;
1498 bool bFocused = pWin && pWin->
HasFocus();
1499 SwAccessibleObjShape_Impl *pShape = pShapes.get();
1500 int nShapeCount = nShapes;
1501 while( nShapeCount )
1503 if (pShape->second.is() &&
IsInSameLevel(pShape->first, pFESh))
1505 if( pShape < pSelShape )
1507 if(pShape->second->ResetState( AccessibleStateType::SELECTED ))
1509 vecxShapeRemove.push_back(pShape->second);
1511 pShape->second->ResetState( AccessibleStateType::FOCUSED );
1518 for (
const auto& rpShape : vecxShapeRemove)
1523 pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE,
uno::Any(),
uno::Any());
1527 pShape = pShapes.get();
1531 if (pShape->second.is() &&
IsInSameLevel(pShape->first, pFESh))
1533 if( pShape >= pSelShape )
1536 if( bFocused && 1 == nSelShapes )
1537 pShape->second->
SetState( AccessibleStateType::FOCUSED );
1539 pShape->second->ResetState( AccessibleStateType::FOCUSED );
1541 if(pShape->second->SetState( AccessibleStateType::SELECTED ))
1543 vecxShapeAdd.push_back(pShape->second);
1545 ++nCountSelectedShape;
1560 AccessibleEventObject aEvent;
1561 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
1567 short nEventID = AccessibleEventId::SELECTION_CHANGED_ADD;
1568 if (nCountSelectedShape <= 1 && vecxShapeAdd.size() == 1 )
1570 nEventID = AccessibleEventId::SELECTION_CHANGED;
1572 for (
const auto& rpShape : vecxShapeAdd)
1582 for (
const auto& rpShape : vecxShapeAdd)
1592 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1594 uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
1597 uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
1598 if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1611 for (
const auto& rpShape : vecxShapeRemove)
1614 if (pAccShape && !pAccShape->IsDisposed())
1616 uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
1617 uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
1618 if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1632 mbShapeSelected(
false ),
1641 uno::Reference < XAccessible > xAcc;
1643 osl::MutexGuard aGuard(
maMutex );
1649 xAcc = (*aIter).second;
1662 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
1668 uno::Reference < XAccessible > xTmp = (*aIter).second;
1672 assert(pTmp->
GetMap() ==
nullptr);
1679 osl::MutexGuard aGuard(
maMutex );
1681 "Frame map should be empty after disposing the root frame");
1683 "Object map should be empty after disposing the root frame");
1705 uno::Reference < XAccessible > xAcc;
1706 bool bSetVisArea =
false;
1709 osl::MutexGuard aGuard(
maMutex );
1714 #if OSL_DEBUG_LEVEL > 0
1719 #if OSL_DEBUG_LEVEL > 0
1727 xAcc = (*aIter).second;
1741 (*aIter).second = xAcc;
1749 #if OSL_DEBUG_LEVEL > 0
1770 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
1773 const Size& _rPreviewWinSize )
1778 mpPreview->Update( *
this, _rPreviewPages, _rScale, _pSelectedPageFrame, _rPreviewWinSize );
1788 uno::Reference < XAccessible > xAcc;
1789 uno::Reference < XAccessible > xOldCursorAcc;
1790 bool bOldShapeSelected =
false;
1793 osl::MutexGuard aGuard(
maMutex );
1801 xAcc = (*aIter).second;
1803 if( !xAcc.is() && bCreate )
1810 static_cast< const SwTextFrame& >( *pFrame ) );
1814 static_cast< const SwHeaderFrame *>( pFrame ) );
1818 static_cast< const SwFooterFrame *>( pFrame ) );
1834 static_cast <
const SwFlyFrame * >( pFrame );
1851 static_cast< const SwCellFrame *>( pFrame ) );
1855 static_cast< const SwTabFrame *>( pFrame ) );
1858 OSL_ENSURE(
GetShell()->IsPreview(),
1859 "accessible page frames only in PagePreview" );
1869 (*aIter).second = xAcc;
1876 if( pAcc->HasCursor() &&
1904 if( xOldCursorAcc.is() )
1906 if( bOldShapeSelected )
1916 uno::Reference < XAccessible > xAcc(
GetContext( pFrame, bCreate ) );
1919 static_cast< SwAccessibleContext * >( xAcc.get() ) );
1929 uno::Reference < XAccessible > xAcc;
1930 uno::Reference < XAccessible > xOldCursorAcc;
1933 osl::MutexGuard aGuard(
maMutex );
1941 xAcc = (*aIter).second;
1943 if( !xAcc.is() && bCreate )
1946 uno::Reference < drawing::XShape > xShape(
1947 const_cast< SdrObject * >( pObj )->getUnoShape(),
1953 uno::Reference < XAccessible > xParent( pParentImpl );
1955 xShape, xParent,
this );
1965 (*aIter).second = xAcc;
1978 if( xOldCursorAcc.is() )
1993 osl::MutexGuard aGuard(
maMutex );
2005 osl::MutexGuard aGuard(
maMutex );
2015 for (
size_t i = 0; pChildren &&
i < pChildren->GetObjCount(); ++
i)
2017 SdrObject *
const pChild(pChildren->GetObj(
i));
2027 osl::MutexGuard aGuard(
maMutex );
2035 if (!xAccParent.is())
2038 uno::Reference < XAccessibleContext > xContext = xAccParent->getAccessibleContext();
2042 sal_Int32 nChildren = xContext->getAccessibleChildCount();
2043 for(sal_Int32
i = 0;
i<nChildren;
i++)
2045 uno::Reference < XAccessible > xChild = xContext->getAccessibleChild(
i);
2048 uno::Reference < XAccessibleContext > xChildContext = xChild->getAccessibleContext();
2049 if (xChildContext.is())
2051 short nRole = xChildContext->getAccessibleRole();
2052 if (nRole == AccessibleRole::SHAPE)
2055 uno::Reference < drawing::XShape > xShape = pAccShape->
GetXShape();
2073 uno::Reference < XAccessible > xAcc(
GetContext( pObj, pParentImpl, bCreate ) );
2076 static_cast< ::accessibility::AccessibleShape* >( xAcc.get() ) );
2083 osl::MutexGuard aGuard(
maMutex );
2103 OSL_ENSURE( pOldAccImpl->
GetFrame(),
"old caret context is disposed" );
2104 if( pOldAccImpl->
GetFrame() == pFrame )
2119 osl::MutexGuard aGuard(
maMutex );
2128 uno::Reference < XAccessible > xTempHold( (*aIter).second );
2150 bool bCanSkipInvisible )
2152 SwAccessibleChild aFrameOrObj( pFrame, pObj, pWindow );
2158 OSL_ENSURE( !aFrameOrObj.GetSwFrame() || aFrameOrObj.GetSwFrame()->IsAccessibleFrame(),
2159 "non accessible frame should be disposed" );
2161 if (!(aFrameOrObj.IsAccessible(
GetShell()->IsPreview())
2171 osl::MutexGuard aGuard(
maMutex );
2177 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2180 uno::Reference < XAccessible > xAcc( (*aIter).second );
2197 uno::Reference < XAccessible > xAcc( (*aIter).second );
2203 if( !xParentAccImpl.is() && !aFrameOrObj.GetSwFrame() &&
mpShapeMap )
2206 mpShapeMap->find( aFrameOrObj.GetDrawObject() );
2209 uno::Reference < XAccessible > xAcc( (*aIter).second );
2215 (xParentAccImpl.is() || xShapeAccImpl.is()) )
2219 uno::Reference < drawing::XShape > xShape(
2220 const_cast< SdrObject * >( pObj )->getUnoShape(),
2251 xAccImpl->Dispose( bRecursive );
2253 else if( xParentAccImpl.is() )
2260 xParentAccImpl->DisposeChild( aFrameOrObj, bRecursive, bCanSkipInvisible );
2262 else if( xShapeAccImpl.is() )
2265 xShapeAccImpl->dispose();
2269 mpPreview->DisposePage( static_cast< const SwPageFrame *>( pFrame ) );
2277 SwAccessibleChild aFrameOrObj( pFrame, pObj, pWindow );
2278 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2283 const SwFrame *pParent =
nullptr;
2285 osl::MutexGuard aGuard(
maMutex );
2289 if( aFrameOrObj.GetSwFrame() )
2292 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2297 uno::Reference < XAccessible > xAcc( (*aIter).second );
2302 if( !xAccImpl.is() )
2316 uno::Reference < XAccessible > xAcc( (*aIter).second );
2331 aFrameOrObj, rOldBox );
2337 if (xAccImpl->GetFrame())
2339 xAccImpl->InvalidatePosOrSize(rOldBox);
2343 else if( xParentAccImpl.is() )
2349 if (!SwAccessibleChild(pParent).IsVisibleChildrenOnly()
2350 || xParentAccImpl->IsShowing(rOldBox)
2351 || xParentAccImpl->IsShowing(*
this, aFrameOrObj))
2355 xParentAccImpl.get(), aFrameOrObj, rOldBox );
2362 xParentAccImpl->InvalidateChildPosOrSize( aFrameOrObj,
2376 bool bIsValidFrame =
false;
2377 bool bIsTextParent =
false;
2378 if (aFrameOrObj.GetSwFrame())
2382 bIsValidFrame =
true;
2389 bIsTextParent =
true;
2392 if( bIsValidFrame || bIsTextParent )
2398 pParent, aFrameOrObj, rOldBox );
2403 OSL_ENSURE(
false,
"");
2411 SwAccessibleChild aFrameOrObj( pFrame );
2412 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2415 uno::Reference < XAccessible > xAcc;
2417 osl::MutexGuard aGuard(
maMutex );
2422 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2424 xAcc = (*aIter).second;
2449 SwAccessibleChild aFrameOrObj( &rTextFrame );
2450 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2453 uno::Reference < XAccessible > xAcc;
2455 osl::MutexGuard aGuard(
maMutex );
2460 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2462 xAcc = (*aIter).second;
2474 pAccImpl, aFrameOrObj );
2487 SwAccessibleChild aFrameOrObj( pFrame );
2488 bool bShapeSelected =
false;
2490 if(
auto pCSh = dynamic_cast<const SwCursorShell*>(pVSh) )
2492 if( pCSh->IsTableMode() )
2494 while( aFrameOrObj.GetSwFrame() && !aFrameOrObj.GetSwFrame()->IsCellFrame() )
2495 aFrameOrObj = aFrameOrObj.GetSwFrame()->GetUpper();
2497 else if(
auto pFESh = dynamic_cast<const SwFEShell*>(pVSh) )
2499 const SwFrame *pFlyFrame = pFESh->GetSelectedFlyFrame();
2502 OSL_ENSURE( !pFrame || pFrame->
FindFlyFrame() == pFlyFrame,
2503 "cursor is not contained in fly frame" );
2504 aFrameOrObj = pFlyFrame;
2506 else if( pFESh->IsObjSelected() > 0 )
2508 bShapeSelected =
true;
2509 aFrameOrObj =
static_cast<const SwFrame *
>( nullptr );
2514 OSL_ENSURE( bShapeSelected || aFrameOrObj.IsAccessible(
GetShell()->IsPreview()),
2515 "frame is not accessible" );
2517 uno::Reference < XAccessible > xOldAcc;
2518 uno::Reference < XAccessible > xAcc;
2519 bool bOldShapeSelected =
false;
2522 osl::MutexGuard aGuard(
maMutex );
2533 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2535 xAcc = (*aIter).second;
2549 aIter =
mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2552 xAcc = (*aIter).second;
2569 if( aFrameOrObj.GetSwFrame()->IsCellFrame() )
2580 xAcc =
GetContext( aFrameOrObj.GetSwFrame() );
2583 else if (bShapeSelected)
2587 if (pMarkList !=
nullptr && pMarkList->
GetMarkCount() == 1)
2591 if (!pAccShapeImpl.is())
2597 if (pObj !=
nullptr)
2603 if (!xParentAccImpl.is())
2609 uno::Reference< XAccessible> xAccParentTab =
GetContext(pTabFrame);
2615 if(xParentAccImplRoot.is())
2617 AccessibleEventObject aEvent;
2618 aEvent.EventId = AccessibleEventId::CHILD;
2619 aEvent.NewValue <<= xAccParentTab;
2620 xParentAccImplRoot->FireAccessibleEvent( aEvent );
2635 if(xParentAccImplRoot.is())
2637 AccessibleEventObject aEvent;
2638 aEvent.EventId = AccessibleEventId::CHILD;
2639 aEvent.NewValue <<= uno::Reference< XAccessible>(xParentAccImpl);
2640 xParentAccImplRoot->FireAccessibleEvent( aEvent );
2644 if (xParentAccImpl.is())
2646 uno::Reference< XAccessible> xAccShape =
2649 AccessibleEventObject aEvent;
2650 aEvent.EventId = AccessibleEventId::CHILD;
2651 aEvent.NewValue <<= xAccShape;
2652 xParentAccImpl->FireAccessibleEvent( aEvent );
2661 m_setParaAdd.clear();
2662 m_setParaRemove.clear();
2663 if( xOldAcc.is() && xOldAcc != xAcc )
2664 InvalidateCursorPosition( xOldAcc );
2665 if( bOldShapeSelected || bShapeSelected )
2666 InvalidateShapeSelection();
2668 InvalidateCursorPosition( xAcc );
2670 InvalidateShapeInParaSelection();
2674 if(pAccPara && pAccPara->getSelectedAccessibleChildCount() == 0 && pAccPara->getSelectedText().getLength() == 0)
2676 if(pAccPara->SetSelectedState(
false))
2678 AccessibleEventObject aEvent;
2679 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
2680 pAccPara->FireAccessibleEvent( aEvent );
2686 if(pAccPara && pAccPara->SetSelectedState(
true))
2688 AccessibleEventObject aEvent;
2689 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
2690 pAccPara->FireAccessibleEvent( aEvent );
2710 uno::Reference < XAccessible > xAcc;
2712 osl::MutexGuard aGuard(
maMutex );
2729 const ::rtl::Reference < SwAccessibleContext >& rCursorContext )
2731 osl::MutexGuard aGuard(
maMutex );
2732 uno::Reference < XAccessible > xAcc( rCursorContext );
2739 SwAccessibleChild aFrameOrObj( _pFrame );
2740 while( aFrameOrObj.GetSwFrame() &&
2741 !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2742 aFrameOrObj = aFrameOrObj.GetSwFrame()->GetUpper();
2743 if( !aFrameOrObj.GetSwFrame() )
2746 uno::Reference< XAccessible > xAcc(
GetContext( aFrameOrObj.GetSwFrame() ) );
2752 SwAccessibleChild(pAccImpl->
GetFrame()),
2767 SwAccessibleChild aFrameOrObj( pFrame );
2768 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2771 uno::Reference < XAccessible > xAcc;
2773 osl::MutexGuard aGuard(
maMutex );
2778 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2781 xAcc = (*aIter).second;
2795 pAccImpl, SwAccessibleChild(pFrame),
2805 ? AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED
2806 : AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED );
2828 SwAccessibleChild aFrameOrObj( &_rTextFrame );
2829 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2832 uno::Reference < XAccessible > xAcc;
2834 osl::MutexGuard aGuard(
maMutex );
2839 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2842 xAcc = (*aIter).second;
2858 SwAccessibleChild( &_rTextFrame ),
2874 SwAccessibleChild aFrameOrObj( &rParentFrame );
2875 if( aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2877 uno::Reference < XAccessible > xAcc;
2879 osl::MutexGuard aGuard(
maMutex );
2884 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2887 xAcc = (*aIter).second;
2897 nIndex = pAccImpl->
GetChildIndex( const_cast<SwAccessibleMap&>(*
this),
2898 SwAccessibleChild( &rChild ) );
2908 const Size& _rPreviewWinSize )
2910 assert(
GetShell()->IsPreview() &&
"no preview?");
2911 assert(
mpPreview !=
nullptr &&
"no preview data?");
2913 mpPreview->Update( *
this, _rPreviewPages, _rScale, _pSelectedPageFrame, _rPreviewWinSize );
2922 uno::Reference < XAccessible > xOldAcc;
2923 uno::Reference < XAccessible > xAcc;
2925 osl::MutexGuard aGuard(
maMutex );
2935 xAcc = (*aIter).second;
2939 if( xOldAcc.is() && xOldAcc != xAcc )
2950 mpPreview->InvalidateSelection(
GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
2952 uno::Reference < XAccessible > xOldAcc;
2953 uno::Reference < XAccessible > xAcc;
2955 osl::MutexGuard aGuard(
maMutex );
2964 xAcc = (*aIter).second;
2968 if( xOldAcc.is() && xOldAcc != xAcc )
2992 for(
auto const& aEvent : *
mpEvents )
3000 osl::MutexGuard aGuard(
maMutex );
3020 aPoint = pWin->LogicToPixel( aPoint, aMapMode );
3021 aPoint = pWin->OutputToAbsoluteScreenPixel( aPoint );
3034 aSize = pWin->LogicToPixel( aSize, aMapMode );
3042 const uno::Reference< drawing::XShape >& _rxShape,
3044 const ::accessibility::AccessibleShapeTreeInfo&
3049 osl::MutexGuard aGuard(
maMutex );
3054 while( aIter != aEndIter && !pObj )
3056 uno::Reference < XAccessible > xAcc( (*aIter).second );
3059 if( pAccShape == pCurrentChild )
3061 pObj = (*aIter).first;
3070 uno::Reference < drawing::XShape > xShape( _rxShape );
3074 uno::Reference < XAccessible > xParent( pCurrentChild->getAccessibleParent() );
3075 pCurrentChild =
nullptr;
3079 osl::MutexGuard aGuard(
maMutex );
3088 xShape, xParent,
this );
3093 uno::Reference < XAccessible > xAcc( pReplacement );
3096 pReplacement->Init();
3101 (*aIter).second = xAcc;
3123 while( aIter != aEndIter)
3125 uno::Reference < XAccessible > xAcc( (*aIter).second );
3132 return pCtlAccShape;
3140 css::uno::Reference< XAccessible >
3153 aPoint = pWin->PixelToLogic( rPoint, aMapMode );
3165 if (aFineValue < aRefValue)
3170 if (aFineValue > aRefValue)
3182 rInGrid.
Left(),
false) );
3184 rInGrid.
Top(),
false) );
3186 rInGrid.
Right(),
true) );
3188 rInGrid.
Bottom(),
true) );
3198 aRect = pWin->LogicToPixel( rRect.
SVRect(), aMapMode );
3222 mpPreview->AdjustMapMode( aMapMode, _rPoint );
3224 _orMapMode = aMapMode;
3247 SwPaM* pCursor(
nullptr );
3258 pCursor = pCursorShell->
GetCursor(
false );
3268 std::unique_ptr<SwAccessibleSelectedParas_Impl> pRetSelectedParas;
3271 SwPaM* pRingStart = pCursor;
3293 uno::WeakReference < XAccessible > xWeakAcc;
3298 xWeakAcc = (*aMapIter).second;
3299 SwAccessibleParaSelection aDataEntry(
3301 ? pTextFrame->MapModelToViewPos(*pStartPos)
3305 ? pTextFrame->MapModelToViewPos(*pEndPos)
3307 if ( !pRetSelectedParas )
3309 pRetSelectedParas.reset(
3313 pRetSelectedParas->emplace( xWeakAcc, aDataEntry );
3322 }
while ( pCursor != pRingStart );
3324 return pRetSelectedParas;
3329 osl::MutexGuard aGuard(
maMutex );
3332 std::unique_ptr<SwAccessibleSelectedParas_Impl> pPrevSelectedParas( std::move(
mpSelectedParas) );
3347 bool bSubmitEvent(
false );
3348 if ( !pPrevSelectedParas )
3351 bSubmitEvent =
true;
3356 pPrevSelectedParas->find( (*aIter).first );
3357 if ( aPrevSelected != pPrevSelectedParas->end() )
3360 if ( (*aIter).second.nStartOfSelection !=
3361 (*aPrevSelected).second.nStartOfSelection ||
3362 (*aIter).second.nEndOfSelection !=
3363 (*aPrevSelected).second.nEndOfSelection )
3366 bSubmitEvent =
true;
3368 pPrevSelectedParas->erase( aPrevSelected );
3373 bSubmitEvent =
true;
3379 uno::Reference < XAccessible > xAcc( (*aIter).first );
3383 static_cast<SwAccessibleContext*>( xAcc.get() ) );
3384 if ( xAccImpl.is() && xAccImpl->GetFrame() )
3386 const SwTextFrame* pTextFrame = xAccImpl->GetFrame()->DynCastTextFrame();
3387 OSL_ENSURE( pTextFrame,
3388 "<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexpected type of frame" );
3401 if ( !pPrevSelectedParas )
3405 for ( ; aIter != pPrevSelectedParas->end(); ++aIter )
3407 uno::Reference < XAccessible > xAcc( (*aIter).first );
3411 static_cast<SwAccessibleContext*>( xAcc.get() ) );
3412 if ( xAccImpl.is() && xAccImpl->GetFrame() )
3414 const SwTextFrame* pTextFrame = xAccImpl->GetFrame()->DynCastTextFrame();
3415 OSL_ENSURE( pTextFrame,
3416 "<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexpected type of frame" );
void AdjustMapMode(MapMode &rMapMode, const Point &rPoint) const
Adjust the MapMode so that the preview page appears at the proper position.
bool IsInvalidateTextSelection() const
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
void SetStates(AccessibleStates _nStates)
void InvalidateRelationSet(const SwFrame *pMaster, const SwFrame *pFollow)
std::unique_ptr< SwAccessibleContextMap_Impl > mpFrameMap
void DisposePage(const SwPageFrame *pPageFrame)
void InvalidateContent(const SwFrame *pFrame)
virtual tools::Rectangle GetVisibleArea() const override
virtual bool IsDocumentSelAll() override
void Right(const tools::Long nRight)
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
virtual const SwFlyFrameFormat * GetFormat() const override
const SwFrame * mpParentFrame
static bool createEvent(const SdrModel *pDoc, const SdrHint *pSdrHint, css::document::EventObject &aEvent)
std::map< key_type, mapped_type >::iterator iterator
void RemoveContext(const SwFrame *pFrame)
SdrHintKind GetKind() const
size_t GetMarkCount() const
bool IsInvalidateRelation() const
Marks a position in the document model.
std::pair< const SdrObject *,::rtl::Reference< ::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl
iterator erase(const_iterator const &pos)
SwRect & Union(const SwRect &rRect)
constexpr auto toTwips(N number, Length from)
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, const SwAccessibleChild &rFrameOrObj, const SwRect &rR)
SwAccessibleChild maFrameOrObj
sal_Int32 GetChildIndex(const SwFrame &rParentFrame, vcl::Window &rChild) const
size_type count(const Value &v) const
const_iterator cend() const
std::pair< iterator, bool > emplace(Args &&...args)
SwAccessibleParaSelection mapped_type
std::unique_ptr< SwAccessibleContextMap_Impl > mpSelectedFrameMap
void Left(const tools::Long nLeft)
SwFrameType GetType() const
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
std::unique_ptr< SwAccessibleEventList_Impl > mpEvents
std::map< key_type, mapped_type, key_compare >::const_iterator const_iterator
void InvalidateShapeSelection()
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
const SwPageFrame * mpSelPage
const css::uno::Reference< css::drawing::XShape > & GetXShape() const
virtual ::accessibility::AccessibleControlShape * GetAccControlShapeFromModel(css::beans::XPropertySet *pSet) override
const SwPosition * GetMark() const
SwTabFrame is one table in the document layout, containing rows (which contain cells).
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
std::pair< iterator, bool > emplace(Args &&...args)
const SwAccessibleChild & GetFrameOrObj() const
std::map< key_type, mapped_type, key_compare >::iterator iterator
const SwRect & GetVisArea() const
const SdrMarkList * GetMarkList() const
SwAccessibleEventList_Impl()
iterator erase(const_iterator const &pos)
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
SdrMark * GetMark(size_t nNum) const
uno::WeakReference< XAccessible > mapped_type
rtl::Reference< AccessibleShape > CreateAccessibleObject(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo) const
::osl::Mutex maEventMutex
Of course Writer needs its own rectangles.
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?
AccessibleStates GetAllStates() const
std::map< key_type, mapped_type >::const_iterator const_iterator
virtual bool SetSelectedState(bool bSelected) override
The root element of a Writer document layout.
std::pair< iterator, bool > emplace(Args &&...args)
void InvalidatePreviewSelection(sal_uInt16 nSelPage)
std::unique_ptr< SwAccessibleObjShape_Impl[]> Copy(size_t &rSize, const SwFEShell *pFESh, SwAccessibleObjShape_Impl **pSelShape) const
virtual SdrObjList * GetSubList() const
SwTableFormat * GetFrameFormat()
const unsigned int SELECTION_WITH_NUM
void AddTop(const tools::Long nAdd)
mutable::osl::Mutex maMutex
void InvalidatePosOrSize(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, const SwRect &rOldFrame)
std::list< SwAccessibleEvent_Impl > maEvents
SwViewShell * GetShell() const
static tools::Long lcl_CorrectCoarseValue(tools::Long aCoarseValue, tools::Long aFineValue, tools::Long aRefValue, bool bToLower)
::rtl::Reference< SwAccessibleContext > GetContextImpl(const SwFrame *pFrame, bool bCreate=true)
const SwFrame * GetFrame() const
AccessibleStates GetStates() const
svx::diagram::Point & mrPoint
void SetModelBroadcaster(const css::uno::Reference< css::document::XShapeEventBroadcaster > &rxModelBroadcaster)
static bool IsInSameLevel(const SdrObject *pObj, const SwFEShell *pFESh)
css::uno::Reference< css::accessibility::XAccessible > GetDocumentPreview(const std::vector< std::unique_ptr< PreviewPage >> &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
::accessibility::AccessibleShapeTreeInfo maInfo
Size GetPreviewPageSizeByPageNum(sal_uInt16 _nPageNum) const
get size of a preview page by its physical page number
std::vector< tools::Rectangle > Rectangles
std::map< key_type, mapped_type, key_compare > maMap
SwRect & Intersection(const SwRect &rRect)
std::map< key_type, mapped_type > maMap
Point PixelToCore(const Point &rPoint) const
const SwRect & GetOldBox() const
const SwTable & GetTable() const
void AddShapeContext(const SdrObject *pObj, css::uno::Reference< css::accessibility::XAccessible > const &xAccShape)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
std::pair< iterator, bool > emplace(Args &&...args)
SwNodeOffset GetIndex() const
bool IsSelectedInDoc() const
SwFlyFrame * FindFlyFrame()
bool IsUpdateCursorPos() const
static void lcl_CorrectRectangle(tools::Rectangle &rRect, const tools::Rectangle &rSource, const tools::Rectangle &rInGrid)
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
SwPagePreviewLayout * PagePreviewLayout()
const SwPageFrame * GetSelPage() const
static void AdjustLogicPgRectToVisibleArea(SwRect &_iorLogicPgSwRect, const SwRect &_rPreviewPgSwRect, const Size &_rPreviewWinSize)
adjust logic page rectangle to its visible part
void InvalidateParaTextSelection(const SwTextFrame &_rTextFrame)
invalidation of text selection of a paragraph
std::pair< const key_type, mapped_type > value_type
void FireEvent(const SwAccessibleEvent_Impl &rEvent)
std::pair< const key_type, mapped_type > value_type
std::unique_ptr< SwAccessibleEventMap_Impl > mpEventMap
SdrObject * GetMarkedSdrObj() const
EventType GetType() const
PaM is Point and Mark: a selection of the document model.
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessibleCaption(const css::uno::Reference< css::drawing::XShape > &xShape) override
UNDERLYING_TYPE get() const
iterator erase(const_iterator const &pos)
void SetScaleX(const Fraction &rScaleX)
#define TOOLS_WARN_EXCEPTION(area, stream)
bool IsPrepareSelAll() const
const_iterator cbegin() const
css::uno::Reference< css::accessibility::XAccessible > GetDocumentView()
Size GetPreviewPageSize(sal_uInt16 _nPreviewPageNum) const
get size of a dedicated preview page
iterator find(const key_type &key)
const SdrObject * key_type
iterator find(const key_type &key)
const SwRect & VisArea() const
void InvalidateCursorPosition(const css::uno::Reference< css::accessibility::XAccessible > &rAcc)
SwAccessibleContextMap_Impl()
const SwPosition * GetPoint() const
~SwAccessibleShapeMap_Impl()
SwAccessibleEvent_Impl(EventType eT)
void AddBottom(const tools::Long nAdd)
css::uno::Reference< css::accessibility::XAccessible > GetDocumentView_(bool bPagePreview)
o3tl::sorted_vector< SwAccessibleParagraph * > m_setParaAdd
const MapMode & GetMapMode() const
SwNodeOffset GetIndex() const
accessibility implementation for the page (SwPageFrame) The page is only visible in the page preview...
void SetWindow(vcl::Window *pWindow)
void SetOrigin(const Point &rOrigin)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
uno::WeakReference< XAccessible > key_type
std::map< key_type, mapped_type, key_compare >::iterator iterator
static bool GetChildIndex(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame &rFrame, const sw::access::SwAccessibleChild &rChild, sal_Int32 &rPos, bool bInPagePreview)
void InvalidateStates(AccessibleStates _nStates)
void InvalidateAttr()
#i88069# - attributes has changed
void GetMapMode(const Point &_rPoint, MapMode &_orMapMode) const
get mapping mode for LogicToPixel and PixelToLogic conversions
o3tl::sorted_vector< SwAccessibleParagraph * > m_setParaRemove
const css::uno::Reference< css::beans::XPropertySet > & GetControlModel() const
SwAccessibleChildFunc key_compare
static ShapeTypeHandler & Instance()
const SwRect & GetVisArea() const
void SetScaleY(const Fraction &rScaleY)
std::pair< const key_type, mapped_type > value_type
bool IsGroupObject() const
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Marks a node in the document model.
virtual ~SwAccessibleMap() override
void InvalidateRelation(sal_uInt16 nType)
ring_container GetRingContainer()
void AddRight(const tools::Long nAdd)
bool IsInvalidateStates() const
iterator find(const key_type &key)
access to an accessible Writer document
virtual bool ReplaceChild(::accessibility::AccessibleShape *pCurrentChild, const css::uno::Reference< css::drawing::XShape > &_rxShape, const tools::Long _nIndex, const ::accessibility::AccessibleShapeTreeInfo &_rShapeTreeInfo) override
A page of the document layout.
static SwNodeType GetNodeType(const SwFlyFrame *pFlyFrame)
void AddAccessibleShell()
const SwPosition * Start() const
AccessibleStates mnStates
std::list< SwAccessibleEvent_Impl >::iterator begin()
void SetOldBox(const SwRect &rOldBox)
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
std::unique_ptr< SwAccessibleShapeMap_Impl > mpShapeMap
std::map< key_type, mapped_type >::const_iterator const_iterator
uno::WeakReference< XAccessible > mxAcc
void RemoveAccessibleShell()
void AddLeft(const tools::Long nAdd)
std::pair< const key_type, mapped_type > value_type
void A11yDispose(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, bool bRecursive=false, bool bCanSkipInvisible=true)
std::map< key_type, mapped_type, key_compare > maMap
void AddGroupContext(const SdrObject *pParentObj, css::uno::Reference< css::accessibility::XAccessible > const &xAccParent)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
void Bottom(const tools::Long nBottom)
SwTextNode is a paragraph in the document model.
void InvalidateRelationSet_(const SwFrame *pFrame, bool bFrom)
void InvalidateShapeInParaSelection()
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
const css::uno::Reference< css::document::XShapeEventBroadcaster > & GetModelBroadcaster() const
iterator erase(const_iterator const &pos)
tools::Rectangle SVRect() const
const ::accessibility::AccessibleShapeTreeInfo & GetInfo() const
general base class for all free-flowing frames
std::map< key_type, mapped_type >::iterator iterator
std::map< key_type, mapped_type, key_compare >::const_iterator const_iterator
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true)
::rtl::Reference< SwAccessibleContext > GetContext() const
vcl::Window * GetWin() const
void InvalidateAttr(const SwTextFrame &rTextFrame)
Rectangles maPreviewRects
ShapeTypeId GetTypeId(const OUString &aServiceName) const
sal_Int32 GetIndex() const
virtual SwDrawModel * GetOrCreateDrawModel()=0
void InvalidateEditableStates(const SwFrame *_pFrame)
void UpdatePreview(const std::vector< std::unique_ptr< PreviewPage >> &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
std::unique_ptr< SwAccessibleSelectedParas_Impl > BuildSelectedParas()
method to build up a new data structure of the accessible paragraphs, which have a selection ...
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, const SwAccessibleChild &rFrameOrObj)
const SwPosition * End() const
void InvalidateCursorPos()
bool Contains(const SwFrame *pFrame) const
void Top(const tools::Long nTop)
tools::Rectangle CoreToPixel(const SwRect &rRect) const
const SwFrame * GetParent() const
size_t IsObjSelected() const
virtual Point LogicToPixel(const Point &rPoint) const override
void InvalidateParaFlowRelation(const SwTextFrame &_rTextFrame, const bool _bFrom)
invalidation CONTENT_FLOWS_FROM/_TO relation of a paragraph
css::uno::Reference< css::accessibility::XAccessible > GetContext(const SwFrame *pFrame, bool bCreate=true)
void InvalidateTextSelection()
#i27301# - text selection has changed
SwAccessibleMap * GetMap()
void MoveMissingXAccToEnd()
SwAccessibleChild key_type
SdrObject * getParentSdrObjectFromSdrObject() const
constexpr sal_Int32 COMPLETE_STRING
void Update(const SwAccessibleMap &rAccMap, const std::vector< std::unique_ptr< PreviewPage >> &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
const SwTabFrame * GetFollow() const
SwAccessibleShapeMap_Impl(SwAccessibleMap const *pMap)
virtual bool SetState(sal_Int16 aState) override
accessibility implementation for the page preview.
bool IsObjSameLevelWithMarked(const SdrObject *pObj) const
#define DBG_TESTSOLARMUTEX()
void SetCursorContext(const ::rtl::Reference< SwAccessibleContext > &rCursorContext)
void Dispose(const T &xInterface)
bool IsPageSelected(const SwPageFrame *pPageFrame) const
std::unique_ptr< SwAccPreviewData > mpPreview
for page preview: store preview data, VisArea, and mapping of preview-to-display coordinates ...
std::list< SwAccessibleEvent_Impl >::iterator erase(const std::list< SwAccessibleEvent_Impl >::iterator &aPos)
SwShapeList_Impl mvShapes
static bool AreInSameTable(const uno::Reference< XAccessible > &rAcc, const SwFrame *pFrame)
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, const SwAccessibleChild &rFrameOrObj, const AccessibleStates _nStates)
void InvalidateTextSelectionOfAllParas()
invalidation of text selection of all paragraphs
std::map< key_type, mapped_type > maMap
std::list< SwAccessibleEvent_Impl >::iterator mapped_type
uno::WeakReference< XAccessible > mapped_type
std::pair< const_iterator, bool > insert(Value &&x)
SwXAccWeakRefComp key_compare
void SetType(EventType eT)
std::list< SwAccessibleEvent_Impl >::iterator insert(const std::list< SwAccessibleEvent_Impl >::iterator &aIter, const SwAccessibleEvent_Impl &rEvent)
void RemoveGroupContext(const SdrObject *pParentObj)
SwRootFrame * GetLayout() const
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
iterator find(const key_type &key)
SwAccessibleEvent_Impl(EventType eT, const SwAccessibleChild &rFrameOrObj)
void DoInvalidateShapeSelection(bool bInvalidateFocusMode=false)
SwAccessibleEvent_Impl(EventType eT, const SwFrame *pParentFrame, const SwAccessibleChild &rFrameOrObj, const SwRect &rR)
void InvalidateSelection(const SwPageFrame *_pSelectedPageFrame)
bool IsFrameSelected() const
void SetSdrView(SdrView *pView)
std::list< SwAccessibleEvent_Impl >::iterator end()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
void AppendEvent(const SwAccessibleEvent_Impl &rEvent)
bool m_bDetectedRangeSegmentation false
SwTabFrame * FindTabFrame()
bool IsInvalidateTextAttrs() const
css::uno::WeakReference< css::accessibility::XAccessible > mxCursorContext
std::unique_ptr< SwAccessibleSelectedParas_Impl > mpSelectedParas
bool IsNoXaccParentFrame() const
SwAccessibleMap(SwViewShell *pSh)
const SdrObject * GetObject() const