28#include <unordered_map>
61#include <com/sun/star/accessibility/AccessibleEventId.hpp>
62#include <com/sun/star/accessibility/AccessibleStateType.hpp>
63#include <com/sun/star/accessibility/AccessibleRole.hpp>
64#include <com/sun/star/beans/XPropertySet.hpp>
65#include <com/sun/star/document/XShapeEventBroadcaster.hpp>
91 typedef std::pair<const key_type,mapped_type>
value_type;
92 typedef std::map<key_type, mapped_type>::iterator
iterator;
95 std::map <key_type, mapped_type>
maMap;
98#if OSL_DEBUG_LEVEL > 0
103#if OSL_DEBUG_LEVEL > 0
113 template<
class... Args>
114 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
120class SwDrawModellListener_Impl :
public SfxListener,
121 public ::cppu::WeakImplHelper< document::XShapeEventBroadcaster >
123 mutable ::osl::Mutex maListenerMutex;
125 std::unordered_multimap<css::uno::Reference< css::drawing::XShape >, css::uno::Reference< css::document::XShapeEventListener >> maShapeListeners;
128 virtual ~SwDrawModellListener_Impl()
override;
131 explicit SwDrawModellListener_Impl(
SdrModel *pDrawModel );
134 virtual void SAL_CALL addEventListener(
const uno::Reference< document::XEventListener >& xListener )
override;
135 virtual void SAL_CALL removeEventListener(
const uno::Reference< document::XEventListener >& xListener )
override;
137 virtual void SAL_CALL addShapeEventListener(
const css::uno::Reference< css::drawing::XShape >& xShape,
const css::uno::Reference< css::document::XShapeEventListener >& xListener )
override;
138 virtual void SAL_CALL removeShapeEventListener(
const css::uno::Reference< css::drawing::XShape >& xShape,
const css::uno::Reference< css::document::XShapeEventListener >& xListener )
override;
146SwDrawModellListener_Impl::SwDrawModellListener_Impl(
SdrModel *pDrawModel ) :
147 maEventListeners( maListenerMutex ),
148 mpDrawModel( pDrawModel )
153SwDrawModellListener_Impl::~SwDrawModellListener_Impl()
158void SAL_CALL SwDrawModellListener_Impl::addEventListener(
const uno::Reference< document::XEventListener >& xListener )
160 maEventListeners.addInterface( xListener );
163void SAL_CALL SwDrawModellListener_Impl::removeEventListener(
const uno::Reference< document::XEventListener >& xListener )
165 maEventListeners.removeInterface( xListener );
168void SAL_CALL SwDrawModellListener_Impl::addShapeEventListener(
169 const css::uno::Reference< css::drawing::XShape >& xShape,
170 const uno::Reference< document::XShapeEventListener >& xListener )
172 assert(xShape.is() &&
"no shape?");
173 osl::MutexGuard aGuard(maListenerMutex);
174 maShapeListeners.emplace(xShape, xListener);
177void SAL_CALL SwDrawModellListener_Impl::removeShapeEventListener(
178 const css::uno::Reference< css::drawing::XShape >& xShape,
179 const uno::Reference< document::XShapeEventListener >& xListener )
181 osl::MutexGuard aGuard(maListenerMutex);
182 auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
183 for (
auto it = itBegin; it != itEnd; ++it)
184 if (it->second == xListener)
186 maShapeListeners.erase(it);
196 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
202 isType<SdrObject>(pSdrHint->
GetObject()) ) )
207 OSL_ENSURE( mpDrawModel,
"draw model listener is disposed" );
211 document::EventObject
aEvent;
216 while( aIter.hasMoreElements() )
220 aIter.next()->notifyEvent( aEvent );
222 catch( uno::RuntimeException
const & )
229 if (pSdrHint->
GetKind() == SdrHintKind::ObjectChange)
232 uno::Reference<drawing::XShape> xShape(pSdrObject->getUnoShape(), uno::UNO_QUERY);
233 osl::MutexGuard aGuard(maListenerMutex);
234 auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
235 for (
auto it = itBegin; it != itEnd; ++it)
236 it->second->notifyShapeEvent(aEvent);
240void SwDrawModellListener_Impl::Dispose()
242 if (mpDrawModel !=
nullptr) {
243 EndListening( *mpDrawModel );
245 mpDrawModel =
nullptr;
257 typedef std::map<key_type, mapped_type>::iterator
iterator;
263 std::map<key_type, mapped_type>
maMap;
272 uno::Reference < document::XShapeEventBroadcaster > xModelBroadcaster =
273 new SwDrawModellListener_Impl(
280 const ::accessibility::AccessibleShapeTreeInfo&
GetInfo()
const {
return maInfo; }
282 std::unique_ptr<SwAccessibleObjShape_Impl[]>
Copy(
size_t& rSize,
291 template<
class... Args>
292 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
300 static_cast < SwDrawModellListener_Impl *
>( xBrd.get() )->
Dispose();
303std::unique_ptr<SwAccessibleObjShape_Impl[]>
308 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
312 rSize =
maMap.size();
319 pSelShape = &(pShapes[rSize]);
320 for(
const auto& rEntry :
maMap )
323 uno::Reference < XAccessible > xAcc( rEntry.second );
328 pSelShape->first = pObj;
336 pShape->first = pObj;
343 assert(pSelShape == pShape);
347 *pSelStart = pSelShape;
366 uno::WeakReference < XAccessible >
mxAcc;
383 SwAccessibleChild aFrameOrObj )
392 SwAccessibleChild aFrameOrObj )
399 "wrong event constructor, DISPOSE only");
408 "wrong event constructor, SHAPE_SELECTION only" );
413 SwAccessibleChild aFrameOrObj,
424 "wrong event constructor, (CHILD_)POS_CHANGED only" );
429 SwAccessibleChild aFrameOrObj,
438 "wrong event constructor, CARET_OR_STATES only" );
442 SwAccessibleChild aFrameOrObj,
const SwRect& rR ) :
450 "wrong event constructor, CHILD_POS_CHANGED only" );
465 uno::Reference < XAccessible > xTmp(
mxAcc );
548 std::list<SwAccessibleEvent_Impl>::iterator
begin() {
return maEvents.begin(); }
549 std::list<SwAccessibleEvent_Impl>::iterator
end() {
return maEvents.end(); }
550 std::list<SwAccessibleEvent_Impl>::iterator
insert(
const std::list<SwAccessibleEvent_Impl>::iterator& aIter,
553 return maEvents.insert( aIter, rEvent );
555 std::list<SwAccessibleEvent_Impl>::iterator
erase(
const std::list<SwAccessibleEvent_Impl>::iterator& aPos )
565 size_t nSize =
size();
571 for (
auto li =
begin(); li !=
end(); )
573 if (li->IsNoXaccParentFrame())
581 assert(
size() + lstEvent.
size() == nSize);
583 assert(
size() == nSize);
588struct SwAccessibleChildFunc
590 bool operator()(
const SwAccessibleChild& r1,
591 const SwAccessibleChild& r2 )
const
593 const void *p1 = r1.GetSwFrame()
594 ?
static_cast < const void *
>( r1.GetSwFrame())
595 : ( r1.GetDrawObject()
596 ?
static_cast < const void *
>( r1.GetDrawObject() )
597 :
static_cast < const void *
>( r1.GetWindow() ) );
598 const void *p2 = r2.GetSwFrame()
599 ?
static_cast < const void *
>( r2.GetSwFrame())
600 : ( r2.GetDrawObject()
601 ?
static_cast < const void *
>( r2.GetDrawObject() )
602 :
static_cast < const void *
>( r2.GetWindow() ) );
616 typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
617 typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
619 std::map <key_type,mapped_type,key_compare>
maMap;
623 template<
class... Args>
624 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
630struct SwAccessibleParaSelection
635 SwAccessibleParaSelection(
const TextFrameIndex nStartOfSelection_,
637 : nStartOfSelection(nStartOfSelection_)
638 , nEndOfSelection(nEndOfSelection_)
642struct SwXAccWeakRefComp
644 bool operator()(
const uno::WeakReference<XAccessible>& _rXAccWeakRef1,
645 const uno::WeakReference<XAccessible>& _rXAccWeakRef2 )
const
647 return _rXAccWeakRef1.
get() < _rXAccWeakRef2.get();
656 typedef uno::WeakReference < XAccessible >
key_type;
660 typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
661 typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
663 std::map<key_type,mapped_type,key_compare>
maMap;
668 template<
class... Args>
669 std::pair<iterator,bool>
emplace(Args&&... args) {
return maMap.emplace(std::forward<Args>(
args)...); }
700 const SwRect& _rPreviewPgSwRect,
701 const Size& _rPreviewWinSize );
707 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
710 const Size& _rPreviewWinSize );
721 const Point& rPoint )
const;
734 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
737 const Size& _rPreviewWinSize )
746 SwAccessibleChild aPage;
751 for (
auto & rpPreviewPage : _rPreviewPages )
753 aPage = rpPreviewPage->pPage;
756 tools::Rectangle aPreviewPgRect( rpPreviewPage->aPreviewWinPos, rpPreviewPage->aPageSize );
760 SwRect aLogicPgSwRect( aPage.GetBox( rAccMap ) );
764 if ( rpPreviewPage->bVisible )
766 if ( !rpPreviewPage->pPage->IsEmptyPage() )
788struct ContainsPredicate
791 explicit ContainsPredicate(
const Point& rPoint ) :
mrPoint(rPoint) {}
801 const Point& rPoint )
const
808 Rectangles::const_iterator aBegin =
maLogicRects.begin();
810 Rectangles::const_iterator aFound = std::find_if( aBegin, aEnd,
811 ContainsPredicate( rPoint ) );
817 aPoint -= (
maLogicRects.begin() + (aFound-aBegin))->TopLeft();
831 SwRect& _iorLogicPgSwRect,
832 const SwRect& _rPreviewPgSwRect,
833 const Size& _rPreviewWinSize )
836 const SwRect aPreviewWinSwRect(
Point( 0, 0 ), _rPreviewWinSize );
838 SwRect aVisPreviewPgSwRect( _rPreviewPgSwRect );
843 nTmpDiff = aVisPreviewPgSwRect.
Left() - _rPreviewPgSwRect.
Left();
844 _iorLogicPgSwRect.
AddLeft( nTmpDiff );
846 nTmpDiff = aVisPreviewPgSwRect.
Top() - _rPreviewPgSwRect.
Top();
847 _iorLogicPgSwRect.
AddTop( nTmpDiff );
849 nTmpDiff = _rPreviewPgSwRect.
Right() - aVisPreviewPgSwRect.
Right();
850 _iorLogicPgSwRect.
AddRight( - nTmpDiff );
852 nTmpDiff = _rPreviewPgSwRect.
Bottom() - aVisPreviewPgSwRect.
Bottom();
853 _iorLogicPgSwRect.
AddBottom( - nTmpDiff );
885 bRet = (pTabFrame1 == pTabFrame2);
901 uno::Reference < XAccessible > xAcc( (*aIter).second );
904 uno::Reference < XAccessibleContext > xContext(xAcc,uno::UNO_QUERY);
905 if (xContext.is() && xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
916 else if( xAccImpl.is() && xAccImpl->GetFrame() )
921 xAccImpl->InvalidateAttr();
926 xAccImpl->InvalidateContent();
929 xAccImpl->InvalidatePosOrSize( rEvent.
GetOldBox() );
936 assert(!
"dispose event has been stored");
947 xAccImpl->InvalidateCursorPos();
949 xAccImpl->InvalidateStates( rEvent.
GetStates() );
956 xAccImpl->InvalidateRelation(
957 AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED );
961 xAccImpl->InvalidateRelation(
962 AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED );
968 xAccImpl->InvalidateTextSelection();
988 "dispose event while firing events" );
1000 "dispose events should not be stored" );
1001 bool bAppendEvent =
true;
1009 "invalid event combination" );
1022 "invalid event combination" );
1038 "invalid event combination" );
1049 "invalid event combination" );
1053 "invalid event combination" );
1060 bAppendEvent =
false;
1070 "invalid event combination" );
1076 mpEvents->erase( (*aIter).second );
1081 mpEvents->erase( (*aIter).second );
1094 const uno::Reference< XAccessible >& rAcc )
1104 SwAccessibleChild(pAccImpl->
GetFrame()),
1141 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
1152 osl::MutexGuard aGuard(
maMutex );
1154 pShapes =
mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
1167 while( aIter != aEndIter )
1169 uno::Reference < XAccessible > xAcc( (*aIter).second );
1178 while( aIter != aEndIter )
1189 if(rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1191 uno::Reference < XAccessible > xAcc( (*aIter).second );
1207 bool bMarked =
false;
1208 if( pCursor !=
nullptr )
1216 nLastNode = pMerged->pLastNode->GetIndex();
1220 nLastNode = nFirstNode;
1228 if( rTmpCursor.HasMark() )
1236 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
1238 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1241 &&( ((nHere == nEndIndex) && (nIndex < pEnd->GetContentIndex())) || (nHere < nEndIndex) ) )
1243 uno::Reference < XAccessible > xAcc( (*aIter).second );
1249 uno::Reference < XAccessible > xAcc( (*aIter).second );
1254 else if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA )
1256 uno::Reference<XAccessible>
const xAcc((*aIter).second);
1269 else if (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
1271 uno::Reference<XAccessible>
const xAcc((*aIter).second);
1291 size_t nNumShapes = nShapes;
1294 if( pShape < pSelShape && (pShape->first==(*aIter).first) )
1296 uno::Reference < XAccessible > xAcc( (*aIter).second );
1319 const SwFrame *pFrame = (*aIter).first;
1322 uno::Reference < XAccessible > xAcc = (*aIter).second;
1335 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1338 if (xAccParent.is())
1340 uno::Reference< XAccessibleContext > xAccContext = xAccParent->getAccessibleContext();
1341 if(xAccContext.is() && xAccContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1363 typedef std::vector< SwAccessibleContext* > VEC_PARA;
1367 bool bMarkChanged =
false;
1369 if( pCursor !=
nullptr )
1373 if( rTmpCursor.HasMark() )
1375 SwNodeIndex nStartIndex( rTmpCursor.Start()->GetNode() );
1376 SwNodeIndex nEndIndex( rTmpCursor.End()->GetNode() );
1377 for (; nStartIndex <= nEndIndex; ++nStartIndex)
1384 if (mapTemp.
find(pFrame) != mapTemp.
end())
1401 uno::Reference < XAccessible > xAcc = (*aIter).second;
1402 bool isChanged =
false;
1415 bMarkChanged =
true;
1419 mapTemp.
emplace( pFrame, xAcc );
1433 uno::Reference < XAccessible > xAcc = (*aIter).second;
1439 bMarkChanged =
true;
1444 while( aIter != mapTemp.
end() )
1456 AccessibleEventObject
aEvent;
1457 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
1460 pAccPara->FireAccessibleEvent(
aEvent );
1465 AccessibleEventObject
aEvent;
1466 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
1469 pAccPara->FireAccessibleEvent(
aEvent );
1477 std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes;
1483 const size_t nSelShapes = pFESh ? pFESh->
IsObjSelected() : 0;
1487 if (bInvalidateFocusMode && nSelShapes != 1)
1492 osl::MutexGuard aGuard(
maMutex );
1494 pShapes =
mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
1500 typedef std::vector< ::rtl::Reference < ::accessibility::AccessibleShape > > VEC_SHAPE;
1501 VEC_SHAPE vecxShapeAdd;
1502 VEC_SHAPE vecxShapeRemove;
1503 int nCountSelectedShape=0;
1506 bool bFocused = pWin && pWin->
HasFocus();
1508 int nShapeCount = nShapes;
1509 while( nShapeCount )
1511 if (pShape->second.is() &&
IsInSameLevel(pShape->first, pFESh))
1513 if( pShape < pSelShape )
1515 if(pShape->second->ResetState( AccessibleStateType::SELECTED ))
1517 vecxShapeRemove.push_back(pShape->second);
1519 pShape->second->ResetState( AccessibleStateType::FOCUSED );
1526 for (
const auto& rpShape : vecxShapeRemove)
1531 pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE,
uno::Any(),
uno::Any());
1535 pShape = pShapes.get();
1539 if (pShape->second.is() &&
IsInSameLevel(pShape->first, pFESh))
1541 if( pShape >= pSelShape )
1544 if( bFocused && 1 == nSelShapes )
1545 pShape->second->
SetState( AccessibleStateType::FOCUSED );
1547 pShape->second->ResetState( AccessibleStateType::FOCUSED );
1549 if(pShape->second->SetState( AccessibleStateType::SELECTED ))
1551 vecxShapeAdd.push_back(pShape->second);
1553 ++nCountSelectedShape;
1568 AccessibleEventObject
aEvent;
1569 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
1575 short nEventID = AccessibleEventId::SELECTION_CHANGED_ADD;
1576 if (nCountSelectedShape <= 1 && vecxShapeAdd.size() == 1 )
1578 nEventID = AccessibleEventId::SELECTION_CHANGED;
1580 for (
const auto& rpShape : vecxShapeAdd)
1590 for (
const auto& rpShape : vecxShapeAdd)
1600 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1602 uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
1605 uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
1606 if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1619 for (
const auto& rpShape : vecxShapeRemove)
1622 if (pAccShape && !pAccShape->IsDisposed())
1624 uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
1625 uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
1626 if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
1640 mbShapeSelected( false ),
1649 uno::Reference < XAccessible > xAcc;
1651 osl::MutexGuard aGuard(
maMutex );
1657 xAcc = (*aIter).second;
1670#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
1676 uno::Reference < XAccessible > xTmp = (*aIter).second;
1680 assert(pTmp->
GetMap() ==
nullptr);
1687 osl::MutexGuard aGuard(
maMutex );
1689 "Frame map should be empty after disposing the root frame");
1691 "Object map should be empty after disposing the root frame");
1713 uno::Reference < XAccessible > xAcc;
1714 bool bSetVisArea =
false;
1717 osl::MutexGuard aGuard(
maMutex );
1722#if OSL_DEBUG_LEVEL > 0
1727#if OSL_DEBUG_LEVEL > 0
1735 xAcc = (*aIter).second;
1749 (*aIter).second = xAcc;
1757#if OSL_DEBUG_LEVEL > 0
1778 const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages,
1781 const Size& _rPreviewWinSize )
1786 mpPreview->Update( *
this, _rPreviewPages, _rScale, _pSelectedPageFrame, _rPreviewWinSize );
1796 uno::Reference < XAccessible > xAcc;
1797 uno::Reference < XAccessible > xOldCursorAcc;
1798 bool bOldShapeSelected =
false;
1801 osl::MutexGuard aGuard(
maMutex );
1809 xAcc = (*aIter).second;
1811 if( !xAcc.is() && bCreate )
1842 static_cast < const SwFlyFrame *
>( pFrame );
1863 static_cast< const SwTabFrame *
>( pFrame ) );
1866 OSL_ENSURE(
GetShell()->IsPreview(),
1867 "accessible page frames only in PagePreview" );
1877 (*aIter).second = xAcc;
1884 if( pAcc->HasCursor() &&
1912 if( xOldCursorAcc.is() )
1914 if( bOldShapeSelected )
1924 uno::Reference < XAccessible > xAcc(
GetContext( pFrame, bCreate ) );
1937 uno::Reference < XAccessible > xAcc;
1938 uno::Reference < XAccessible > xOldCursorAcc;
1941 osl::MutexGuard aGuard(
maMutex );
1949 xAcc = (*aIter).second;
1951 if( !xAcc.is() && bCreate )
1954 uno::Reference < drawing::XShape > xShape(
1955 const_cast< SdrObject *
>( pObj )->getUnoShape(),
1961 uno::Reference < XAccessible > xParent( pParentImpl );
1963 xShape, xParent,
this );
1973 (*aIter).second = xAcc;
1986 if( xOldCursorAcc.is() )
2001 osl::MutexGuard aGuard(
maMutex );
2013 osl::MutexGuard aGuard(
maMutex );
2023 for (
size_t i = 0; pChildren &&
i < pChildren->
GetObjCount(); ++
i)
2035 osl::MutexGuard aGuard(
maMutex );
2043 if (!xAccParent.is())
2046 uno::Reference < XAccessibleContext > xContext = xAccParent->getAccessibleContext();
2050 sal_Int64 nChildren = xContext->getAccessibleChildCount();
2051 for(sal_Int64
i = 0;
i<nChildren;
i++)
2053 uno::Reference < XAccessible > xChild = xContext->getAccessibleChild(
i);
2056 uno::Reference < XAccessibleContext > xChildContext = xChild->getAccessibleContext();
2057 if (xChildContext.is())
2059 short nRole = xChildContext->getAccessibleRole();
2060 if (nRole == AccessibleRole::SHAPE)
2063 uno::Reference < drawing::XShape > xShape = pAccShape->
GetXShape();
2081 uno::Reference < XAccessible > xAcc(
GetContext( pObj, pParentImpl, bCreate ) );
2091 osl::MutexGuard aGuard(
maMutex );
2118 OSL_ENSURE( pOldAccImpl->
GetFrame(),
"old caret context is disposed" );
2119 if( pOldAccImpl->
GetFrame() == pFrame )
2134 osl::MutexGuard aGuard(
maMutex );
2143 uno::Reference < XAccessible > xTempHold( (*aIter).second );
2165 bool bCanSkipInvisible )
2167 SwAccessibleChild aFrameOrObj( pFrame, pObj, pWindow );
2173 OSL_ENSURE( !aFrameOrObj.GetSwFrame() || aFrameOrObj.GetSwFrame()->IsAccessibleFrame(),
2174 "non accessible frame should be disposed" );
2176 if (!(aFrameOrObj.IsAccessible(
GetShell()->IsPreview())
2186 osl::MutexGuard aGuard(
maMutex );
2192 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2195 uno::Reference < XAccessible > xAcc( (*aIter).second );
2212 uno::Reference < XAccessible > xAcc( (*aIter).second );
2218 if( !xParentAccImpl.is() && !aFrameOrObj.GetSwFrame() &&
mpShapeMap )
2221 mpShapeMap->find( aFrameOrObj.GetDrawObject() );
2224 uno::Reference < XAccessible > xAcc( (*aIter).second );
2230 (xParentAccImpl.is() || xShapeAccImpl.is()) )
2234 uno::Reference < drawing::XShape > xShape(
2235 const_cast< SdrObject *
>( pObj )->getUnoShape(),
2266 xAccImpl->Dispose( bRecursive );
2268 else if( xParentAccImpl.is() )
2275 xParentAccImpl->DisposeChild( aFrameOrObj, bRecursive, bCanSkipInvisible );
2277 else if( xShapeAccImpl.is() )
2280 xShapeAccImpl->dispose();
2292 SwAccessibleChild aFrameOrObj( pFrame, pObj, pWindow );
2293 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2298 const SwFrame *pParent =
nullptr;
2300 osl::MutexGuard aGuard(
maMutex );
2304 if( aFrameOrObj.GetSwFrame() )
2307 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2312 uno::Reference < XAccessible > xAcc( (*aIter).second );
2317 if( !xAccImpl.is() )
2331 uno::Reference < XAccessible > xAcc( (*aIter).second );
2346 aFrameOrObj, rOldBox );
2352 if (xAccImpl->GetFrame())
2354 xAccImpl->InvalidatePosOrSize(rOldBox);
2358 else if( xParentAccImpl.is() )
2364 if (!SwAccessibleChild(pParent).IsVisibleChildrenOnly()
2365 || xParentAccImpl->IsShowing(rOldBox)
2366 || xParentAccImpl->IsShowing(*
this, aFrameOrObj))
2370 xParentAccImpl.get(), aFrameOrObj, rOldBox );
2377 xParentAccImpl->InvalidateChildPosOrSize( aFrameOrObj,
2391 bool bIsValidFrame =
false;
2392 bool bIsTextParent =
false;
2393 if (aFrameOrObj.GetSwFrame())
2397 bIsValidFrame =
true;
2404 bIsTextParent =
true;
2407 if( bIsValidFrame || bIsTextParent )
2413 pParent, aFrameOrObj, rOldBox );
2418 OSL_ENSURE(
false,
"");
2426 SwAccessibleChild aFrameOrObj( pFrame );
2427 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2430 uno::Reference < XAccessible > xAcc;
2432 osl::MutexGuard aGuard(
maMutex );
2438 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2440 xAcc = (*aIter).second;
2452 std::move(aFrameOrObj) );
2464 SwAccessibleChild aFrameOrObj( &rTextFrame );
2465 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2468 uno::Reference < XAccessible > xAcc;
2470 osl::MutexGuard aGuard(
maMutex );
2476 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2478 xAcc = (*aIter).second;
2489 pAccImpl, std::move(aFrameOrObj) );
2502 SwAccessibleChild aFrameOrObj( pFrame );
2503 bool bShapeSelected =
false;
2507 if( pCSh->IsTableMode() )
2509 while( aFrameOrObj.GetSwFrame() && !aFrameOrObj.GetSwFrame()->IsCellFrame() )
2510 aFrameOrObj = aFrameOrObj.GetSwFrame()->GetUpper();
2512 else if(
auto pFESh =
dynamic_cast<const SwFEShell*
>(pVSh) )
2514 const SwFrame *pFlyFrame = pFESh->GetSelectedFlyFrame();
2517 OSL_ENSURE( !pFrame || pFrame->
FindFlyFrame() == pFlyFrame,
2518 "cursor is not contained in fly frame" );
2519 aFrameOrObj = pFlyFrame;
2521 else if( pFESh->IsObjSelected() > 0 )
2523 bShapeSelected =
true;
2524 aFrameOrObj =
static_cast<const SwFrame *
>( nullptr );
2529 OSL_ENSURE( bShapeSelected || aFrameOrObj.IsAccessible(
GetShell()->IsPreview()),
2530 "frame is not accessible" );
2532 uno::Reference < XAccessible > xOldAcc;
2533 uno::Reference < XAccessible > xAcc;
2534 bool bOldShapeSelected =
false;
2537 osl::MutexGuard aGuard(
maMutex );
2548 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2550 xAcc = (*aIter).second;
2564 aIter =
mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2567 xAcc = (*aIter).second;
2584 if( aFrameOrObj.GetSwFrame()->IsCellFrame() )
2595 xAcc =
GetContext( aFrameOrObj.GetSwFrame() );
2598 else if (bShapeSelected)
2602 if (pMarkList !=
nullptr && pMarkList->
GetMarkCount() == 1)
2606 if (!pAccShapeImpl.is())
2612 if (pObj !=
nullptr)
2618 if (!xParentAccImpl.is())
2624 uno::Reference< XAccessible> xAccParentTab =
GetContext(pTabFrame);
2630 if(xParentAccImplRoot.is())
2632 AccessibleEventObject
aEvent;
2633 aEvent.EventId = AccessibleEventId::CHILD;
2634 aEvent.NewValue <<= xAccParentTab;
2635 xParentAccImplRoot->FireAccessibleEvent(
aEvent );
2650 if(xParentAccImplRoot.is())
2652 AccessibleEventObject
aEvent;
2653 aEvent.EventId = AccessibleEventId::CHILD;
2654 aEvent.NewValue <<= uno::Reference< XAccessible>(xParentAccImpl);
2655 xParentAccImplRoot->FireAccessibleEvent(
aEvent );
2659 if (xParentAccImpl.is())
2661 uno::Reference< XAccessible> xAccShape =
2664 AccessibleEventObject
aEvent;
2665 aEvent.EventId = AccessibleEventId::CHILD;
2666 aEvent.NewValue <<= xAccShape;
2667 xParentAccImpl->FireAccessibleEvent(
aEvent );
2678 if( xOldAcc.is() && xOldAcc != xAcc )
2680 if( bOldShapeSelected || bShapeSelected )
2689 if(pAccPara && pAccPara->getSelectedAccessibleChildCount() == 0 && pAccPara->getSelectedText().getLength() == 0)
2691 if(pAccPara->SetSelectedState(
false))
2693 AccessibleEventObject
aEvent;
2694 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
2695 pAccPara->FireAccessibleEvent(
aEvent );
2701 if(pAccPara && pAccPara->SetSelectedState(
true))
2703 AccessibleEventObject
aEvent;
2704 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
2705 pAccPara->FireAccessibleEvent(
aEvent );
2725 uno::Reference < XAccessible > xAcc;
2727 osl::MutexGuard aGuard(
maMutex );
2744 const ::rtl::Reference < SwAccessibleContext >& rCursorContext )
2746 osl::MutexGuard aGuard(
maMutex );
2747 uno::Reference < XAccessible > xAcc( rCursorContext );
2754 SwAccessibleChild aFrameOrObj( _pFrame );
2755 while( aFrameOrObj.GetSwFrame() &&
2756 !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2757 aFrameOrObj = aFrameOrObj.GetSwFrame()->GetUpper();
2758 if( !aFrameOrObj.GetSwFrame() )
2761 uno::Reference< XAccessible > xAcc(
GetContext( aFrameOrObj.GetSwFrame() ) );
2767 SwAccessibleChild(pAccImpl->
GetFrame()),
2782 SwAccessibleChild aFrameOrObj( pFrame );
2783 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2786 uno::Reference < XAccessible > xAcc;
2788 osl::MutexGuard aGuard(
maMutex );
2794 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2797 xAcc = (*aIter).second;
2810 pAccImpl, SwAccessibleChild(pFrame),
2820 ? AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED
2821 : AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED );
2843 SwAccessibleChild aFrameOrObj( &_rTextFrame );
2844 if( !aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2847 uno::Reference < XAccessible > xAcc;
2849 osl::MutexGuard aGuard(
maMutex );
2855 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2858 xAcc = (*aIter).second;
2873 SwAccessibleChild( &_rTextFrame ),
2889 SwAccessibleChild aFrameOrObj( &rParentFrame );
2890 if( aFrameOrObj.IsAccessible(
GetShell()->IsPreview() ) )
2892 uno::Reference < XAccessible > xAcc;
2894 osl::MutexGuard aGuard(
maMutex );
2899 mpFrameMap->find( aFrameOrObj.GetSwFrame() );
2902 xAcc = (*aIter).second;
2913 SwAccessibleChild( &rChild ) );
2923 const Size& _rPreviewWinSize )
2925 assert(
GetShell()->IsPreview() &&
"no preview?");
2926 assert(
mpPreview !=
nullptr &&
"no preview data?");
2928 mpPreview->Update( *
this, _rPreviewPages, _rScale, _pSelectedPageFrame, _rPreviewWinSize );
2937 uno::Reference < XAccessible > xOldAcc;
2938 uno::Reference < XAccessible > xAcc;
2940 osl::MutexGuard aGuard(
maMutex );
2950 xAcc = (*aIter).second;
2954 if( xOldAcc.is() && xOldAcc != xAcc )
2965 mpPreview->InvalidateSelection(
GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
2967 uno::Reference < XAccessible > xOldAcc;
2968 uno::Reference < XAccessible > xAcc;
2970 osl::MutexGuard aGuard(
maMutex );
2979 xAcc = (*aIter).second;
2983 if( xOldAcc.is() && xOldAcc != xAcc )
3015 osl::MutexGuard aGuard(
maMutex );
3035 aPoint = pWin->LogicToPixel( aPoint, aMapMode );
3036 aPoint = pWin->OutputToAbsoluteScreenPixel( aPoint );
3049 aSize = pWin->LogicToPixel( aSize, aMapMode );
3057 const uno::Reference< drawing::XShape >& _rxShape,
3059 const ::accessibility::AccessibleShapeTreeInfo&
3064 osl::MutexGuard aGuard(
maMutex );
3069 while( aIter != aEndIter && !pObj )
3071 uno::Reference < XAccessible > xAcc( (*aIter).second );
3074 if( pAccShape == pCurrentChild )
3076 pObj = (*aIter).first;
3085 uno::Reference < drawing::XShape > xShape( _rxShape );
3089 uno::Reference < XAccessible > xParent( pCurrentChild->getAccessibleParent() );
3090 pCurrentChild =
nullptr;
3094 osl::MutexGuard aGuard(
maMutex );
3103 xShape, xParent,
this );
3108 uno::Reference < XAccessible > xAcc( pReplacement );
3111 pReplacement->Init();
3116 (*aIter).second = xAcc;
3138 while( aIter != aEndIter)
3140 uno::Reference < XAccessible > xAcc( (*aIter).second );
3147 return pCtlAccShape;
3155css::uno::Reference< XAccessible >
3168 aPoint = pWin->PixelToLogic( rPoint, aMapMode );
3180 if (aFineValue < aRefValue)
3185 if (aFineValue > aRefValue)
3197 rInGrid.
Left(),
false) );
3199 rInGrid.
Top(),
false) );
3201 rInGrid.
Right(),
true) );
3203 rInGrid.
Bottom(),
true) );
3213 aRect = pWin->LogicToPixel( rRect.
SVRect(), aMapMode );
3237 mpPreview->AdjustMapMode( aMapMode, _rPoint );
3239 _orMapMode = aMapMode;
3262 SwPaM* pCursor(
nullptr );
3273 pCursor = pCursorShell->
GetCursor(
false );
3283 std::unique_ptr<SwAccessibleSelectedParas_Impl> pRetSelectedParas;
3286 SwPaM* pRingStart = pCursor;
3295 auto [pStartPos, pEndPos] = pCursor->
StartEnd();
3298 for ( ; aIdx.
GetIndex() <= pEndPos->GetNodeIndex(); ++aIdx )
3307 uno::WeakReference < XAccessible > xWeakAcc;
3312 xWeakAcc = (*aMapIter).second;
3313 SwAccessibleParaSelection aDataEntry(
3315 ? pTextFrame->MapModelToViewPos(*pStartPos)
3319 ? pTextFrame->MapModelToViewPos(*pEndPos)
3321 if ( !pRetSelectedParas )
3323 pRetSelectedParas.reset(
3327 pRetSelectedParas->emplace( xWeakAcc, aDataEntry );
3336 }
while ( pCursor != pRingStart );
3338 return pRetSelectedParas;
3343 osl::MutexGuard aGuard(
maMutex );
3346 std::unique_ptr<SwAccessibleSelectedParas_Impl> pPrevSelectedParas( std::move(
mpSelectedParas) );
3361 bool bSubmitEvent(
false );
3362 if ( !pPrevSelectedParas )
3365 bSubmitEvent =
true;
3370 pPrevSelectedParas->find( (*aIter).first );
3371 if ( aPrevSelected != pPrevSelectedParas->end() )
3374 if ( (*aIter).second.nStartOfSelection !=
3375 (*aPrevSelected).second.nStartOfSelection ||
3376 (*aIter).second.nEndOfSelection !=
3377 (*aPrevSelected).second.nEndOfSelection )
3380 bSubmitEvent =
true;
3382 pPrevSelectedParas->erase( aPrevSelected );
3387 bSubmitEvent =
true;
3393 uno::Reference < XAccessible > xAcc( (*aIter).first );
3398 if ( xAccImpl.is() && xAccImpl->GetFrame() )
3400 const SwTextFrame* pTextFrame = xAccImpl->GetFrame()->DynCastTextFrame();
3401 OSL_ENSURE( pTextFrame,
3402 "<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexpected type of frame" );
3415 if ( !pPrevSelectedParas )
3419 for ( ; aIter != pPrevSelectedParas->end(); ++aIter )
3421 uno::Reference < XAccessible > xAcc( (*aIter).first );
3426 if ( xAccImpl.is() && xAccImpl->GetFrame() )
3428 const SwTextFrame* pTextFrame = xAccImpl->GetFrame()->DynCastTextFrame();
3429 OSL_ENSURE( pTextFrame,
3430 "<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexpected type of frame" );
static void lcl_CorrectRectangle(tools::Rectangle &rRect, const tools::Rectangle &rSource, const tools::Rectangle &rInGrid)
static tools::Long lcl_CorrectCoarseValue(tools::Long aCoarseValue, tools::Long aFineValue, tools::Long aRefValue, bool bToLower)
static bool AreInSameTable(const uno::Reference< XAccessible > &rAcc, const SwFrame *pFrame)
std::pair< const SdrObject *, ::rtl::Reference< ::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl
const unsigned int SELECTION_WITH_NUM
virtual SwDrawModel * GetOrCreateDrawModel()=0
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
void SetScaleX(const Fraction &rScaleX)
SdrHintKind GetKind() const
const SdrObject * GetObject() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual SdrObjList * GetSubList() const
bool IsGroupObject() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
static bool createEvent(const SdrModel *pDoc, const SdrHint *pSdrHint, css::document::EventObject &aEvent)
const SwPageFrame * mpSelPage
void DisposePage(const SwPageFrame *pPageFrame)
void AdjustMapMode(MapMode &rMapMode, const Point &rPoint) const
Adjust the MapMode so that the preview page appears at the proper position.
void Update(const SwAccessibleMap &rAccMap, const std::vector< std::unique_ptr< PreviewPage > > &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
std::vector< tools::Rectangle > Rectangles
const SwRect & GetVisArea() const
static void AdjustLogicPgRectToVisibleArea(SwRect &_iorLogicPgSwRect, const SwRect &_rPreviewPgSwRect, const Size &_rPreviewWinSize)
adjust logic page rectangle to its visible part
Rectangles maPreviewRects
void InvalidateSelection(const SwPageFrame *_pSelectedPageFrame)
const SwPageFrame * GetSelPage() const
std::pair< iterator, bool > emplace(Args &&... args)
uno::WeakReference< XAccessible > mapped_type
iterator erase(const_iterator const &pos)
SwAccessibleContextMap_Impl()
std::map< key_type, mapped_type >::const_iterator const_iterator
std::map< key_type, mapped_type > maMap
std::map< key_type, mapped_type >::iterator iterator
std::pair< const key_type, mapped_type > value_type
iterator find(const key_type &key)
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true)
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
void InvalidateRelation(sal_uInt16 nType)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
void InvalidateCursorPos()
SwAccessibleMap * GetMap()
bool IsSelectedInDoc() const
void InvalidateTextSelection()
#i27301# - text selection has changed
void InvalidateAttr()
#i88069# - attributes has changed
void InvalidateStates(AccessibleStates _nStates)
access to an accessible Writer document
std::list< SwAccessibleEvent_Impl >::iterator erase(const std::list< SwAccessibleEvent_Impl >::iterator &aPos)
SwAccessibleEventList_Impl()
void MoveMissingXAccToEnd()
std::list< SwAccessibleEvent_Impl >::iterator end()
std::list< SwAccessibleEvent_Impl >::iterator insert(const std::list< SwAccessibleEvent_Impl >::iterator &aIter, const SwAccessibleEvent_Impl &rEvent)
std::list< SwAccessibleEvent_Impl > maEvents
std::list< SwAccessibleEvent_Impl >::iterator begin()
SwAccessibleChildFunc key_compare
iterator erase(const_iterator const &pos)
iterator find(const key_type &key)
std::map< key_type, mapped_type, key_compare > maMap
std::pair< const key_type, mapped_type > value_type
SwAccessibleChild key_type
std::pair< iterator, bool > emplace(Args &&... args)
std::map< key_type, mapped_type, key_compare >::const_iterator const_iterator
std::list< SwAccessibleEvent_Impl >::iterator mapped_type
std::map< key_type, mapped_type, key_compare >::iterator iterator
virtual bool SetSelectedState(bool bSelected) override
static SwNodeType GetNodeType(const SwFlyFrame *pFlyFrame)
static bool GetChildIndex(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame &rFrame, const sw::access::SwAccessibleChild &rChild, sal_Int32 &rPos, bool bInPagePreview)
const SwFrame * GetFrame() const
const SwFrame * GetParent() const
virtual tools::Rectangle GetVisibleArea() const override
std::unique_ptr< SwAccessibleShapeMap_Impl > mpShapeMap
void AddShapeContext(const SdrObject *pObj, css::uno::Reference< css::accessibility::XAccessible > const &xAccShape)
void InvalidateRelationSet(const SwFrame *pMaster, const SwFrame *pFollow)
o3tl::sorted_vector< SwAccessibleParagraph * > m_setParaAdd
void InvalidateShapeInParaSelection()
tools::Rectangle CoreToPixel(const SwRect &rRect) const
void InvalidatePosOrSize(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, const SwRect &rOldFrame)
std::unique_ptr< SwAccessibleSelectedParas_Impl > mpSelectedParas
std::unique_ptr< SwAccessibleSelectedParas_Impl > BuildSelectedParas()
method to build up a new data structure of the accessible paragraphs, which have a selection
std::unique_ptr< SwAccessibleContextMap_Impl > mpFrameMap
std::unique_ptr< SwAccessibleEventMap_Impl > mpEventMap
mutable::osl::Mutex maMutex
void UpdatePreview(const std::vector< std::unique_ptr< PreviewPage > > &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
void InvalidateParaTextSelection(const SwTextFrame &_rTextFrame)
invalidation of text selection of a paragraph
void InvalidateCursorPosition(const css::uno::Reference< css::accessibility::XAccessible > &rAcc)
void InvalidatePreviewSelection(sal_uInt16 nSelPage)
void InvalidateRelationSet_(const SwFrame *pFrame, bool bFrom)
void FireEvent(const SwAccessibleEvent_Impl &rEvent)
::osl::Mutex maEventMutex
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessibleCaption(const css::uno::Reference< css::drawing::XShape > &xShape) override
bool Contains(const SwFrame *pFrame) const
void InvalidateEditableStates(const SwFrame *_pFrame)
o3tl::sorted_vector< SwAccessibleParagraph * > m_setParaRemove
SwAccessibleMap(SwViewShell *pSh)
void SetCursorContext(const ::rtl::Reference< SwAccessibleContext > &rCursorContext)
void GetMapMode(const Point &_rPoint, MapMode &_orMapMode) const
get mapping mode for LogicToPixel and PixelToLogic conversions
SwShapeList_Impl mvShapes
css::uno::WeakReference< css::accessibility::XAccessible > mxCursorContext
virtual bool ReplaceChild(::accessibility::AccessibleShape *pCurrentChild, const css::uno::Reference< css::drawing::XShape > &_rxShape, const tools::Long _nIndex, const ::accessibility::AccessibleShapeTreeInfo &_rShapeTreeInfo) override
static bool IsInSameLevel(const SdrObject *pObj, const SwFEShell *pFESh)
void A11yDispose(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, bool bRecursive=false, bool bCanSkipInvisible=true)
void RemoveGroupContext(const SdrObject *pParentObj)
virtual bool IsDocumentSelAll() override
void InvalidateAttr(const SwTextFrame &rTextFrame)
virtual ~SwAccessibleMap() override
std::unique_ptr< SwAccPreviewData > mpPreview
for page preview: store preview data, VisArea, and mapping of preview-to-display coordinates
std::unique_ptr< SwAccessibleEventList_Impl > mpEvents
sal_Int32 GetChildIndex(const SwFrame &rParentFrame, vcl::Window &rChild) const
css::uno::Reference< css::accessibility::XAccessible > GetDocumentView_(bool bPagePreview)
void InvalidateContent(const SwFrame *pFrame)
Size GetPreviewPageSize(sal_uInt16 _nPreviewPageNum) const
get size of a dedicated preview page
css::uno::Reference< css::accessibility::XAccessible > GetDocumentPreview(const std::vector< std::unique_ptr< PreviewPage > > &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
Point PixelToCore(const Point &rPoint) const
void InvalidateShapeSelection()
css::uno::Reference< css::accessibility::XAccessible > GetDocumentView()
void DoInvalidateShapeSelection(bool bInvalidateFocusMode=false)
::rtl::Reference< SwAccessibleContext > GetContextImpl(const SwFrame *pFrame, bool bCreate=true)
virtual ::accessibility::AccessibleControlShape * GetAccControlShapeFromModel(css::beans::XPropertySet *pSet) override
void AppendEvent(const SwAccessibleEvent_Impl &rEvent)
void InvalidateParaFlowRelation(const SwTextFrame &_rTextFrame, const bool _bFrom)
invalidation CONTENT_FLOWS_FROM/_TO relation of a paragraph
const SwRect & GetVisArea() const
void RemoveContext(const SwFrame *pFrame)
void InvalidateTextSelectionOfAllParas()
invalidation of text selection of all paragraphs
bool IsPageSelected(const SwPageFrame *pPageFrame) const
std::unique_ptr< SwAccessibleContextMap_Impl > mpSelectedFrameMap
css::uno::Reference< css::accessibility::XAccessible > GetContext(const SwFrame *pFrame, bool bCreate=true)
void AddGroupContext(const SdrObject *pParentObj, css::uno::Reference< css::accessibility::XAccessible > const &xAccParent)
virtual Point LogicToPixel(const Point &rPoint) const override
SwViewShell * GetShell() const
accessibility implementation for the page (SwPageFrame) The page is only visible in the page preview.
accessibility implementation for the page preview.
std::map< key_type, mapped_type, key_compare >::const_iterator const_iterator
std::map< key_type, mapped_type, key_compare > maMap
std::pair< iterator, bool > emplace(Args &&... args)
std::map< key_type, mapped_type, key_compare >::iterator iterator
SwXAccWeakRefComp key_compare
uno::WeakReference< XAccessible > key_type
iterator erase(const_iterator const &pos)
SwAccessibleParaSelection mapped_type
iterator find(const key_type &key)
std::pair< const key_type, mapped_type > value_type
uno::WeakReference< XAccessible > mapped_type
const_iterator cend() const
const SdrObject * key_type
SwAccessibleShapeMap_Impl(SwAccessibleMap const *pMap)
const_iterator cbegin() const
std::map< key_type, mapped_type >::const_iterator const_iterator
std::unique_ptr< SwAccessibleObjShape_Impl[]> Copy(size_t &rSize, const SwFEShell *pFESh, SwAccessibleObjShape_Impl **pSelShape) const
~SwAccessibleShapeMap_Impl()
::accessibility::AccessibleShapeTreeInfo maInfo
iterator find(const key_type &key)
std::map< key_type, mapped_type > maMap
const ::accessibility::AccessibleShapeTreeInfo & GetInfo() const
std::pair< const key_type, mapped_type > value_type
iterator erase(const_iterator const &pos)
std::map< key_type, mapped_type >::iterator iterator
std::pair< iterator, bool > emplace(Args &&... args)
SwCellFrame is one table cell in the document layout.
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
bool IsPrepareSelAll() const
bool IsObjSameLevelWithMarked(const SdrObject *pObj) const
bool IsFrameSelected() const
const SdrMarkList * GetMarkList() const
size_t IsObjSelected() const
general base class for all free-flowing frames
virtual const SwFlyFrameFormat * GetFormat() const override
Base class of the Writer layout elements.
SwFlyFrame * FindFlyFrame()
SwTabFrame * FindTabFrame()
SwFrameType GetType() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
A page of the document layout.
Size GetPreviewPageSizeByPageNum(sal_uInt16 _nPageNum) const
get size of a preview page by its physical page number
Of course Writer needs its own rectangles.
SwRect & Intersection(const SwRect &rRect)
SwRect & Union(const SwRect &rRect)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void AddLeft(const tools::Long nAdd)
void AddBottom(const tools::Long nAdd)
void AddRight(const tools::Long nAdd)
void AddTop(const tools::Long nAdd)
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
The root element of a Writer document layout.
void AddAccessibleShell()
void RemoveAccessibleShell()
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTabFrame * GetFollow() const
const SwTable & GetTable() const
SwTableFormat * GetFrameFormat()
Represents the visualization of a paragraph.
sw::MergedPara * GetMergedPara()
SwTextNode * GetTextNodeFirst()
SwTextNode is a paragraph in the document model.
SwPagePreviewLayout * PagePreviewLayout()
SwRootFrame * GetLayout() const
vcl::Window * GetWin() const
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
const SwRect & VisArea() const
const css::uno::Reference< css::beans::XPropertySet > & GetControlModel() const
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
void SetSdrView(SdrView *pView)
void SetWindow(vcl::Window *pWindow)
void SetModelBroadcaster(const css::uno::Reference< css::document::XShapeEventBroadcaster > &rxModelBroadcaster)
const css::uno::Reference< css::document::XShapeEventBroadcaster > & GetModelBroadcaster() const
const css::uno::Reference< css::drawing::XShape > & GetXShape() const
virtual bool SetState(sal_Int64 aState) override
rtl::Reference< AccessibleShape > CreateAccessibleObject(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo) const
ShapeTypeId GetTypeId(const OUString &aServiceName) const
static ShapeTypeHandler & Instance()
size_type count(const Value &v) const
std::pair< const_iterator, bool > insert(Value &&x)
ring_container GetRingContainer()
const MapMode & GetMapMode() const
svx::diagram::Point & mrPoint
#define DBG_TESTSOLARMUTEX()
#define TOOLS_WARN_EXCEPTION(area, stream)
void Dispose(const T &xInterface)
constexpr auto toTwips(N number, Length from)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
bool IsInvalidateRelation() const
SwAccessibleEvent_Impl(EventType eT, const SwFrame *pParentFrame, SwAccessibleChild aFrameOrObj, const SwRect &rR)
SwAccessibleEvent_Impl(EventType eT, SwAccessibleChild aFrameOrObj)
AccessibleStates mnStates
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, SwAccessibleChild aFrameOrObj, const SwRect &rR)
const SwAccessibleChild & GetFrameOrObj() const
void SetOldBox(const SwRect &rOldBox)
AccessibleStates GetAllStates() const
bool IsNoXaccParentFrame() const
SwAccessibleChild maFrameOrObj
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, SwAccessibleChild aFrameOrObj, const AccessibleStates _nStates)
SwAccessibleEvent_Impl(EventType eT)
void SetType(EventType eT)
AccessibleStates GetStates() const
const SwRect & GetOldBox() const
bool IsInvalidateTextSelection() const
SwAccessibleEvent_Impl(EventType eT, SwAccessibleContext *pA, SwAccessibleChild aFrameOrObj)
::rtl::Reference< SwAccessibleContext > GetContext() const
uno::WeakReference< XAccessible > mxAcc
EventType GetType() const
const SwFrame * mpParentFrame
bool IsInvalidateTextAttrs() const
void SetStates(AccessibleStates _nStates)
bool IsInvalidateStates() const
bool IsUpdateCursorPos() const
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
UNDERLYING_TYPE get() const
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
constexpr sal_Int32 COMPLETE_STRING
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?