LibreOffice Module svx (master)  1
accessibletableshape.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 
21 #include <com/sun/star/table/XMergeableCell.hpp>
22 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
23 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
24 #include <com/sun/star/accessibility/AccessibleRole.hpp>
25 #include <com/sun/star/drawing/XShape.hpp>
26 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
27 
28 #include <vcl/svapp.hxx>
29 
30 #include <AccessibleTableShape.hxx>
32 #include "accessiblecell.hxx"
33 #include <cell.hxx>
34 
35 #include <algorithm>
36 #include <unordered_map>
37 
38 #include <cppuhelper/implbase.hxx>
39 #include <svx/svdotable.hxx>
40 #include <com/sun/star/view/XSelectionSupplier.hpp>
41 
42 
43 using namespace ::accessibility;
44 using namespace sdr::table;
45 using namespace ::com::sun::star::accessibility;
46 using namespace ::com::sun::star::uno;
47 using namespace ::com::sun::star::beans;
48 using namespace ::com::sun::star::util;
49 using namespace ::com::sun::star::lang;
50 using namespace ::com::sun::star::drawing;
51 using namespace ::com::sun::star::table;
52 using namespace ::com::sun::star::container;
53 
54 namespace accessibility
55 {
56 
57 typedef std::unordered_map< Reference< XCell >, rtl::Reference< AccessibleCell > > AccessibleCellMap;
58 
59 class AccessibleTableShapeImpl : public cppu::WeakImplHelper< XModifyListener >
60 {
61 public:
62  explicit AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rShapeTreeInfo );
63 
64  void init( const Reference< XAccessible>& xAccessible, const Reference< XTable >& xTable );
65  void dispose();
66 
69  Reference< XAccessible > getAccessibleChild(sal_Int32 i);
71  void getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow );
72 
73  // XModifyListener
74  virtual void SAL_CALL modified( const EventObject& aEvent ) override;
75 
76  // XEventListener
77  virtual void SAL_CALL disposing( const EventObject& Source ) override;
78 
80  Reference< XTable > mxTable;
81  AccessibleCellMap maChildMap;
82  Reference< XAccessible> mxAccessible;
83  sal_Int32 mRowCount, mColCount;
84  //get the cached AccessibleCell from XCell
85  rtl::Reference< AccessibleCell > getAccessibleCell (const Reference< XCell >& xCell);
88  rtl::Reference< AccessibleCell > getAccessibleCell (sal_Int32 nRow, sal_Int32 nColumn);
89 };
90 
91 
92 AccessibleTableShapeImpl::AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rShapeTreeInfo )
93 : mrShapeTreeInfo( rShapeTreeInfo )
94 , mRowCount(0)
95 , mColCount(0)
96 {
97 }
98 
99 
100 void AccessibleTableShapeImpl::init( const Reference< XAccessible>& xAccessible, const Reference< XTable >& xTable )
101 {
102  mxAccessible = xAccessible;
103  mxTable = xTable;
104 
105  if( mxTable.is() )
106  {
107  Reference< XModifyListener > xListener( this );
108  mxTable->addModifyListener( xListener );
109  //register the listener with table model
110  Reference< css::view::XSelectionSupplier > xSelSupplier(xTable, UNO_QUERY);
111  Reference< css::view::XSelectionChangeListener > xSelListener( xAccessible, UNO_QUERY );
112  if (xSelSupplier.is())
113  xSelSupplier->addSelectionChangeListener(xSelListener);
114  mRowCount = mxTable->getRowCount();
115  mColCount = mxTable->getColumnCount();
116  }
117 }
118 
119 
121 {
122  if( mxTable.is() )
123  {
124  //remove all the cell's acc object in table's dispose.
125  for( auto& rEntry : maChildMap )
126  {
127  rEntry.second->dispose();
128  }
129  maChildMap.clear();
130  Reference< XModifyListener > xListener( this );
131  mxTable->removeModifyListener( xListener );
132  mxTable.clear();
133  }
134  mxAccessible.clear();
135 }
136 
137 
138 //get the cached AccessibleCell from XCell
140 {
141  AccessibleCellMap::iterator iter( maChildMap.find( xCell ) );
142 
143  if( iter != maChildMap.end() )
144  {
145  rtl::Reference< AccessibleCell > xChild( (*iter).second.get() );
146  return xChild;
147  }
149 }
150 
152 {
153  Reference< XCell > xCell( mxTable->getCellByPosition( nColumn, nRow ) );
155 
156  if( !xChild.is() && mxTable.is() )
157  {
158  sal_Int32 nChildIndex = mxTable->getColumnCount() * nRow + nColumn;
159  CellRef xCellRef( dynamic_cast< Cell* >( xCell.get() ) );
160 
161  rtl::Reference< AccessibleCell > xAccessibleCell( new AccessibleCell( mxAccessible, xCellRef, nChildIndex, mrShapeTreeInfo ) );
162 
163  xAccessibleCell->Init();
164  maChildMap[xCell] = xAccessibleCell;
165 
166  xChild = rtl::Reference< AccessibleCell >( xAccessibleCell.get() );
167  }
168  return xChild;
169 }
170 
171 
172 Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int32 nChildIndex)
173 {
174  sal_Int32 nColumn = 0, nRow = 0;
175  getColumnAndRow( nChildIndex, nColumn, nRow );
176 
177  Reference< XCell > xCell( mxTable->getCellByPosition( nColumn, nRow ) );
178  AccessibleCellMap::iterator iter( maChildMap.find( xCell ) );
179 
180  if( iter != maChildMap.end() )
181  {
182  Reference< XAccessible > xChild( (*iter).second.get() );
183  return xChild;
184  }
185  else
186  {
187  CellRef xCellRef( dynamic_cast< Cell* >( xCell.get() ) );
188 
189  rtl::Reference< AccessibleCell > xAccessibleCell( new AccessibleCell( mxAccessible, xCellRef, nChildIndex, mrShapeTreeInfo ) );
190 
191  xAccessibleCell->Init();
192  maChildMap[xCell] = xAccessibleCell;
193 
194  Reference< XAccessible > xChild( xAccessibleCell.get() );
195  return xChild;
196  }
197 }
198 
199 
200 void AccessibleTableShapeImpl::getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow )
201 {
202  rnRow = 0;
203  rnColumn = nChildIndex;
204 
205  if( mxTable.is() )
206  {
207  const sal_Int32 nColumnCount = mxTable->getColumnCount();
208  while( rnColumn >= nColumnCount )
209  {
210  rnRow++;
211  rnColumn -= nColumnCount;
212  }
213 
214  if( rnRow < mxTable->getRowCount() )
215  return;
216  }
217 
218  throw IndexOutOfBoundsException();
219 }
220 
221 // XModifyListener
222 void SAL_CALL AccessibleTableShapeImpl::modified( const EventObject& /*aEvent*/ )
223 {
224  if( mxTable.is() ) try
225  {
226  // structural changes may have happened to the table, validate all accessible cell instances
227  AccessibleCellMap aTempChildMap;
228  aTempChildMap.swap( maChildMap );
229 
230  // first move all still existing cells to maChildMap again and update their index
231 
232  const sal_Int32 nRowCount = mxTable->getRowCount();
233  const sal_Int32 nColCount = mxTable->getColumnCount();
234 
235  bool bRowOrColumnChanged = false;
236  if (mRowCount != nRowCount || mColCount != nColCount )
237  {
238  bRowOrColumnChanged = true;
239  mRowCount = nRowCount;
241  }
242  sal_Int32 nChildIndex = 0;
243 
244  for( sal_Int32 nRow = 0; nRow < nRowCount; ++nRow )
245  {
246  for( sal_Int32 nCol = 0; nCol < nColCount; ++nCol )
247  {
248  Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) );
249  AccessibleCellMap::iterator iter( aTempChildMap.find( xCell ) );
250 
251  if( iter != aTempChildMap.end() )
252  {
253  rtl::Reference< AccessibleCell > xAccessibleCell( (*iter).second );
254  xAccessibleCell->setIndexInParent( nChildIndex );
255  xAccessibleCell->UpdateChildren();
256  // If row or column count is changed, there is split or merge, so all cell's acc name should be updated
257  if (bRowOrColumnChanged)
258  {
259  xAccessibleCell->SetAccessibleName(xAccessibleCell->getAccessibleName(), AccessibleContextBase::ManuallySet);
260  }
261  // For merged cell, add invisible & disabled state.
262  Reference< XMergeableCell > xMergedCell( mxTable->getCellByPosition( nCol, nRow ), UNO_QUERY );
263  if (xMergedCell.is() && xMergedCell->isMerged())
264  {
265  xAccessibleCell->ResetState(AccessibleStateType::VISIBLE);
266  xAccessibleCell->ResetState(AccessibleStateType::ENABLED);
267  // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
268  // xAccessibleCell->SetState(AccessibleStateType::OFFSCREEN);
269  xAccessibleCell->ResetState(AccessibleStateType::SHOWING);
270  }
271  else
272  {
273  xAccessibleCell->SetState(AccessibleStateType::VISIBLE);
274  xAccessibleCell->SetState(AccessibleStateType::ENABLED);
275  // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
276  // xAccessibleCell->ResetState(AccessibleStateType::OFFSCREEN);
277  xAccessibleCell->SetState(AccessibleStateType::SHOWING);
278  }
279 
280  // move still existing cell from temporary child map to our child map
281  maChildMap[xCell] = xAccessibleCell;
282  aTempChildMap.erase( iter );
283  }
284  else
285  {
286  CellRef xCellRef( dynamic_cast< Cell* >( xCell.get() ) );
287 
288  rtl::Reference< AccessibleCell > xAccessibleCell( new AccessibleCell( mxAccessible, xCellRef, nChildIndex, mrShapeTreeInfo ) );
289 
290  xAccessibleCell->Init();
291  maChildMap[xCell] = xAccessibleCell;
292  }
293 
294  ++nChildIndex;
295  }
296  }
297 
298  // all accessible cell instances still left in aTempChildMap must be disposed
299  // as they are no longer part of the table
300 
301  for( auto& rEntry : aTempChildMap )
302  {
303  rEntry.second->dispose();
304  }
305  //notify bridge to update the acc cache.
306  AccessibleTableShape *pAccTable = dynamic_cast <AccessibleTableShape *> (mxAccessible.get());
307  if (pAccTable)
308  pAccTable->CommitChange(AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any());
309  }
310  catch( const Exception& )
311  {
312  OSL_FAIL("svx::AccessibleTableShape::modified(), exception caught!");
313  }
314 }
315 
316 // XEventListener
317 void SAL_CALL AccessibleTableShapeImpl::disposing( const EventObject& /*Source*/ )
318 {
319 }
320 
322 : AccessibleTableShape_Base(rShapeInfo, rShapeTreeInfo)
323 , mnPreviousSelectionCount(0)
324 , mxImpl( new AccessibleTableShapeImpl( maShapeTreeInfo ) )
325 {
326 }
327 
328 
330 {
331 }
332 
333 
335 {
336  try
337  {
338  Reference< XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
339  Reference< XTable > xTable( xSet->getPropertyValue("Model"), UNO_QUERY_THROW );
340 
341  mxImpl->init( this, xTable );
342  }
343  catch( Exception& )
344  {
345  OSL_FAIL("AccessibleTableShape::init(), exception caught?");
346  }
347 
348  AccessibleTableShape_Base::Init();
349 }
350 
351 
353 {
354  SdrView* pView = maShapeTreeInfo.GetSdrView ();
355  if( pView )
356  return dynamic_cast< SvxTableController* >( pView->getSelectionController().get() );
357  else
358  return nullptr;
359 }
360 
361 
362 // XInterface
363 
364 
366 {
368  {
369  Reference<XAccessibleTableSelection> xThis( this );
370  Any aRet;
371  aRet <<= xThis;
372  return aRet;
373  }
374  else
375  return AccessibleTableShape_Base::queryInterface( aType );
376 }
377 
378 
379 void SAL_CALL AccessibleTableShape::acquire( ) throw ()
380 {
381  AccessibleTableShape_Base::acquire();
382 }
383 
384 
385 void SAL_CALL AccessibleTableShape::release( ) throw ()
386 {
387  AccessibleTableShape_Base::release();
388 }
389 
390 
391 // XAccessible
392 
393 
395 {
396  return "com.sun.star.comp.accessibility.AccessibleTableShape";
397 }
398 
399 
401 {
402  return "TableShape";
403 }
404 
405 
407 {
408  SolarMutexGuard aSolarGuard;
409  return mxImpl->mxTable.is() ? mxImpl->mxTable->getRowCount() * mxImpl->mxTable->getColumnCount() : 0;
410 }
411 
412 
413 Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleChild( sal_Int32 i )
414 {
415  SolarMutexGuard aSolarGuard;
416  ThrowIfDisposed();
417 
418  return mxImpl->getAccessibleChild( i );
419 }
420 
421 
423 {
424  return AccessibleRole::TABLE;
425 }
426 
427 
429 {
430  mxImpl->dispose();
431 
432  // let the base do its stuff
434 }
435 
436 
437 // XAccessibleTable
438 
439 
441 {
442  SolarMutexGuard aSolarGuard;
443  return mxImpl->mxTable.is() ? mxImpl->mxTable->getRowCount() : 0;
444 }
445 
446 
448 {
449  SolarMutexGuard aSolarGuard;
450  return mxImpl->mxTable.is() ? mxImpl->mxTable->getColumnCount() : 0;
451 }
452 
453 
454 OUString SAL_CALL AccessibleTableShape::getAccessibleRowDescription( sal_Int32 nRow )
455 {
456  checkCellPosition( 0, nRow );
457  return OUString();
458 }
459 
460 
461 OUString SAL_CALL AccessibleTableShape::getAccessibleColumnDescription( sal_Int32 nColumn )
462 {
463  SolarMutexGuard aSolarGuard;
464  checkCellPosition( nColumn, 0 );
465  return OUString();
466 }
467 
468 
469 sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
470 {
471  SolarMutexGuard aSolarGuard;
472  checkCellPosition( nColumn, nRow );
473  if( mxImpl->mxTable.is() )
474  {
475  Reference< XMergeableCell > xCell( mxImpl->mxTable->getCellByPosition( nColumn, nRow ), UNO_QUERY );
476  if( xCell.is() )
477  return xCell->getRowSpan();
478  }
479  return 1;
480 }
481 
482 
483 sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
484 {
485  SolarMutexGuard aSolarGuard;
486  checkCellPosition( nColumn, nRow );
487  if( mxImpl->mxTable.is() )
488  {
489  Reference< XMergeableCell > xCell( mxImpl->mxTable->getCellByPosition( nColumn, nRow ), UNO_QUERY );
490  if( xCell.is() )
491  return xCell->getColumnSpan();
492  }
493  return 1;
494 }
495 
496 
497 Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleRowHeaders( )
498 {
499  Reference< XAccessibleTable > xRet;
500  SvxTableController* pController = getTableController();
501  if( pController )
502  {
503  if( pController->isRowHeader() )
504  {
505  AccessibleTableHeaderShape* pTableHeader = new AccessibleTableHeaderShape( this, true );
506  xRet.set( pTableHeader );
507  }
508  }
509  return xRet;
510 }
511 
512 
513 Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleColumnHeaders( )
514 {
515  Reference< XAccessibleTable > xRet;
516  SvxTableController* pController = getTableController();
517  if( pController )
518  {
519  if( pController->isColumnHeader() )
520  {
521  AccessibleTableHeaderShape* pTableHeader = new AccessibleTableHeaderShape( this, false );
522  xRet.set( pTableHeader );
523  }
524  }
525  return xRet;
526 }
527 
528 
529 Sequence< sal_Int32 > SAL_CALL AccessibleTableShape::getSelectedAccessibleRows( )
530 {
531  sal_Int32 nRow = getAccessibleRowCount();
532  ::std::vector<bool> aSelected( nRow, true );
533  sal_Int32 nCount = nRow;
534  for( sal_Int32 i = 0; i < nRow; i++ )
535  {
536  try
537  {
538  aSelected[i] = isAccessibleRowSelected( i );
539  }
540  catch( ... )
541  {
542  return Sequence< sal_Int32 >();
543  }
544 
545  if( !aSelected[i] )
546  nCount--;
547  }
548  Sequence < sal_Int32 > aRet( nCount );
549  sal_Int32 *pRet = aRet.getArray();
550  sal_Int32 nPos = 0;
551  size_t nSize = aSelected.size();
552  for( size_t i=0; i < nSize && nPos < nCount; i++ )
553  {
554  if( aSelected[i] )
555  {
556  *pRet++ = i;
557  nPos++;
558  }
559  }
560 
561  return aRet;
562 }
563 
564 
565 Sequence< sal_Int32 > SAL_CALL AccessibleTableShape::getSelectedAccessibleColumns( )
566 {
567  sal_Int32 nColumn = getAccessibleColumnCount();
568  ::std::vector<bool> aSelected( nColumn, true );
569  sal_Int32 nCount = nColumn;
570  for( sal_Int32 i = 0; i < nColumn; i++ )
571  {
572  try
573  {
574  aSelected[i] = isAccessibleColumnSelected( i );
575  }
576  catch( ... )
577  {
578  return Sequence< sal_Int32 >();
579  }
580 
581  if( !aSelected[i] )
582  nCount--;
583  }
584  Sequence < sal_Int32 > aRet( nCount );
585  sal_Int32 *pRet = aRet.getArray();
586  sal_Int32 nPos = 0;
587  size_t nSize = aSelected.size();
588  for( size_t i=0; i < nSize && nPos < nCount; i++ )
589  {
590  if( aSelected[i] )
591  {
592  *pRet++ = i;
593  nPos++;
594  }
595  }
596 
597  return aRet;
598 }
599 
600 
602 {
603  SolarMutexGuard aSolarGuard;
604  checkCellPosition( 0, nRow );
605  SvxTableController* pController = getTableController();
606  if( pController )
607  {
608  return pController->isRowSelected( nRow );
609  }
610  return false;
611 }
612 
613 
615 {
616  SolarMutexGuard aSolarGuard;
617  checkCellPosition( nColumn, 0 );
618  SvxTableController* pController = getTableController();
619  if( pController )
620  {
621  return pController->isColumnSelected( nColumn );
622  }
623  return false;
624 }
625 
626 
627 Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
628 {
629  SolarMutexGuard aSolarGuard;
630  checkCellPosition( nColumn, nRow );
631 
632  sal_Int32 nChildIndex = 0;
633  if( mxImpl->mxTable.is() )
634  nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn;
635 
636  return getAccessibleChild( nChildIndex );
637 }
638 
639 
640 Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCaption( )
641 {
642  Reference< XAccessible > xRet;
643  return xRet;
644 }
645 
646 
647 Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleSummary( )
648 {
649  Reference< XAccessible > xRet;
650  return xRet;
651 }
652 
653 
654 sal_Bool SAL_CALL AccessibleTableShape::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
655 {
656  SolarMutexGuard aSolarGuard;
657  checkCellPosition( nColumn, nRow );
658 
659  SvxTableController* pController = getTableController();
660  if( pController && pController->hasSelectedCells() )
661  {
662  CellPos aFirstPos, aLastPos;
663  pController->getSelectedCells( aFirstPos, aLastPos );
664  if( (aFirstPos.mnRow <= nRow) && (aFirstPos.mnCol <= nColumn) && (nRow <= aLastPos.mnRow) && (nColumn <= aLastPos.mnCol) )
665  return true;
666  }
667 
668  return false;
669 }
670 
671 
672 sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
673 {
674  SolarMutexGuard aSolarGuard;
675  checkCellPosition( nColumn, nRow );
676  return mxImpl->mxTable.is() ? (nRow * mxImpl->mxTable->getColumnCount() + nColumn) : 0;
677 }
678 
679 
680 sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleRow( sal_Int32 nChildIndex )
681 {
682  SolarMutexGuard aSolarGuard;
683  sal_Int32 nColumn = 0, nRow = 0;
684  mxImpl->getColumnAndRow( nChildIndex, nColumn, nRow );
685  return nRow;
686 }
687 
688 
689 sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumn( sal_Int32 nChildIndex )
690 {
691  SolarMutexGuard aSolarGuard;
692  sal_Int32 nColumn = 0, nRow = 0;
693  mxImpl->getColumnAndRow( nChildIndex, nColumn, nRow );
694  return nColumn;
695 }
696 
697 
698 // XAccessibleSelection
699 
700 
701 void SAL_CALL AccessibleTableShape::selectAccessibleChild( sal_Int32 nChildIndex )
702 {
703  SolarMutexGuard aSolarGuard;
704  CellPos aPos;
705  mxImpl->getColumnAndRow( nChildIndex, aPos.mnCol, aPos.mnRow );
706 
707  // todo, select table shape?!?
708  SvxTableController* pController = getTableController();
709  if( pController )
710  {
711  CellPos aFirstPos( aPos ), aLastPos( aPos );
712  if( pController->hasSelectedCells() )
713  {
714  pController->getSelectedCells( aFirstPos, aLastPos );
715 
716  aFirstPos.mnRow = std::min( aFirstPos.mnRow, aPos.mnRow );
717  aFirstPos.mnCol = std::min( aFirstPos.mnCol, aPos.mnCol );
718  aLastPos.mnRow = std::max( aLastPos.mnRow, aPos.mnRow );
719  aLastPos.mnCol = std::max( aLastPos.mnCol, aPos.mnCol );
720  }
721  pController->setSelectedCells( aFirstPos, aLastPos );
722  }
723 }
724 
725 
727 {
728  SolarMutexGuard aSolarGuard;
729  CellPos aPos;
730  mxImpl->getColumnAndRow( nChildIndex, aPos.mnCol, aPos.mnRow );
731 
732  return isAccessibleSelected(aPos.mnRow, aPos.mnCol);
733 }
734 
735 
737 {
738  SolarMutexGuard aSolarGuard;
739 
740  SvxTableController* pController = getTableController();
741  if( pController )
742  pController->clearSelection();
743 }
744 
745 
747 {
748  SolarMutexGuard aSolarGuard;
749 
750  // todo: force selection of shape?
751  SvxTableController* pController = getTableController();
752  if( pController )
753  pController->selectAll();
754 }
755 
756 
758 {
759  SolarMutexGuard aSolarGuard;
760 
761  SvxTableController* pController = getTableController();
762  if( pController && pController->hasSelectedCells() )
763  {
764  CellPos aFirstPos, aLastPos;
765  pController->getSelectedCells( aFirstPos, aLastPos );
766 
767  const sal_Int32 nSelectedColumns = std::max( sal_Int32(0), aLastPos.mnCol - aFirstPos.mnCol ) + 1;
768  const sal_Int32 nSelectedRows = std::max( sal_Int32(0), aLastPos.mnRow - aFirstPos.mnRow ) + 1;
769  return nSelectedRows * nSelectedColumns;
770  }
771 
772  return 0;
773 }
774 
775 
776 Reference< XAccessible > SAL_CALL AccessibleTableShape::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
777 {
778  SolarMutexGuard aSolarGuard;
779 
780  if( nSelectedChildIndex < 0 )
781  throw IndexOutOfBoundsException();
782 
783  sal_Int32 nChildIndex = GetIndexOfSelectedChild( nSelectedChildIndex );
784 
785  if( nChildIndex < 0 )
786  throw IndexOutOfBoundsException();
787 
788  if ( nChildIndex >= getAccessibleChildCount() )
789  {
790  throw IndexOutOfBoundsException();
791  }
792 
793  return getAccessibleChild( nChildIndex );
794 }
795 
796 
797 void SAL_CALL AccessibleTableShape::deselectAccessibleChild( sal_Int32 nChildIndex )
798 {
799  SolarMutexGuard aSolarGuard;
800  CellPos aPos;
801  mxImpl->getColumnAndRow( nChildIndex, aPos.mnCol, aPos.mnRow );
802 
803  // todo, select table shape?!?
804  SvxTableController* pController = getTableController();
805  if( pController && pController->hasSelectedCells() )
806  {
807  CellPos aFirstPos, aLastPos;
808  pController->getSelectedCells( aFirstPos, aLastPos );
809 
810  // create a selection where aPos is not part of anymore
811  aFirstPos.mnRow = std::min( aFirstPos.mnRow, aPos.mnRow+1 );
812  aFirstPos.mnCol = std::min( aFirstPos.mnCol, aPos.mnCol+1 );
813  aLastPos.mnRow = std::max( aLastPos.mnRow, aPos.mnRow-1 );
814  aLastPos.mnCol = std::max( aLastPos.mnCol, aPos.mnCol-1 );
815 
816  // new selection may be invalid (child to deselect is not at a border of the selection but in between)
817  if( (aFirstPos.mnRow > aLastPos.mnRow) || (aFirstPos.mnCol > aLastPos.mnCol) )
818  pController->clearSelection(); // if selection is invalid, clear all
819  else
820  pController->setSelectedCells( aFirstPos, aLastPos );
821  }
822 }
823 
824 // XAccessibleTableSelection
825 sal_Bool SAL_CALL AccessibleTableShape::selectRow( sal_Int32 row )
826 {
827  SolarMutexGuard aSolarGuard;
828  SvxTableController* pController = getTableController();
829  if( !pController )
830  return false;
831  return pController->selectRow( row );
832 }
833 
834 sal_Bool SAL_CALL AccessibleTableShape::selectColumn( sal_Int32 column )
835 {
836  SolarMutexGuard aSolarGuard;
837  SvxTableController* pController = getTableController();
838  if( !pController )
839  return false;
840  return pController->selectColumn( column );
841 }
842 
844 {
845  SolarMutexGuard aSolarGuard;
846  SvxTableController* pController = getTableController();
847  if( !pController )
848  return false;
849  return pController->deselectRow( row );
850 }
851 
852 sal_Bool SAL_CALL AccessibleTableShape::unselectColumn( sal_Int32 column )
853 {
854  SolarMutexGuard aSolarGuard;
855  SvxTableController* pController = getTableController();
856  if( !pController )
857  return false;
858  return pController->deselectColumn( column );
859 }
860 
862  sal_Int32 nSelectedChildIndex ) const
863 {
864  sal_Int32 nChildren = const_cast<AccessibleTableShape*>(this)->getAccessibleChildCount();
865 
866  if( nSelectedChildIndex >= nChildren )
867  return -1;
868 
869  sal_Int32 n = 0;
870  while( n < nChildren )
871  {
872  if( const_cast<AccessibleTableShape*>(this)->isAccessibleChildSelected( n ) )
873  {
874  if( 0 == nSelectedChildIndex )
875  break;
876  else
877  --nSelectedChildIndex;
878  }
879  ++n;
880  }
881 
882  return n < nChildren ? n : -1;
883 }
884 void AccessibleTableShape::getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow )
885 {
886  mxImpl->getColumnAndRow(nChildIndex, rnColumn, rnRow);
887 }
888 
889 // XSelectionChangeListener
890 void SAL_CALL
891  AccessibleTableShape::disposing (const EventObject& aEvent)
892 {
894 }
895 void SAL_CALL AccessibleTableShape::selectionChanged (const EventObject& rEvent)
896 {
897  //sdr::table::CellRef xCellRef = static_cast< sdr::table::CellRef > (rEvent.Source);
898  Reference< XCell > xCell(rEvent.Source, UNO_QUERY);
899  if (xCell.is())
900  {
901  rtl::Reference< AccessibleCell > xAccCell = mxImpl->getAccessibleCell( xCell );
902  if (xAccCell.is())
903  {
904  sal_Int32 nIndex = xAccCell->getAccessibleIndexInParent(),
906  bool bSelected = isAccessibleChildSelected(nIndex);
907  if (mnPreviousSelectionCount == 0 && nCount > 0 && bSelected)
908  {
909  xAccCell->SetState(AccessibleStateType::SELECTED);
910  xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED, Any(), Any());
911  }
912  else if (bSelected)
913  {
914  xAccCell->SetState(AccessibleStateType::SELECTED);
915  xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED_ADD, Any(), Any());
916  }
917  else
918  {
919  xAccCell->ResetState(AccessibleStateType::SELECTED);
920  xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE, Any(), Any());
921  }
923  }
924  }
925 }
926 // Get the currently active cell which is text editing
928 {
930  AccessibleCell* pAccCell = nullptr;
931  SvxTableController* pController = getTableController();
932  if (pController)
933  {
934  sdr::table::SdrTableObj* pTableObj = pController->GetTableObj();
935  if ( pTableObj )
936  {
937  const sdr::table::CellRef& xCellRef (pTableObj->getActiveCell());
938  if ( xCellRef.is() )
939  {
940  try
941  {
942  CellPos rPos;
943  pTableObj->getActiveCellPos( rPos );
944  xAccCell = mxImpl->getAccessibleCell( rPos.mnRow, rPos.mnCol );
945  if ( xAccCell.is() )
946  pAccCell = xAccCell.get();
947  }
948  catch ( IndexOutOfBoundsException& ) {}
949  }
950  }
951  }
952  return pAccCell;
953 }
954 
955 //If current active cell is in editing, the focus state should be set to internal text
956 bool AccessibleTableShape::SetState (sal_Int16 aState)
957 {
958  if( aState == AccessibleStateType::FOCUSED )
959  {
960  AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell();
961  if( pActiveAccessibleCell != nullptr )
962  return pActiveAccessibleCell->SetState(aState);
963  }
964 
965  return AccessibleShape::SetState (aState);
966 }
967 
968 //If current active cell is in editing, the focus state should be reset to internal text
969 bool AccessibleTableShape::ResetState (sal_Int16 aState)
970 {
971  if( aState == AccessibleStateType::FOCUSED )
972  {
973  AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell();
974  if( pActiveAccessibleCell != nullptr )
975  return pActiveAccessibleCell->ResetState(aState);
976  }
977 
978  return AccessibleShape::ResetState (aState);
979 }
980 
982 {
983  return AccessibleContextBase::SetState (aState);
984 }
985 
987 {
988  return AccessibleContextBase::ResetState (aState);
989 }
990 
991 void AccessibleTableShape::checkCellPosition( sal_Int32 nCol, sal_Int32 nRow )
992 {
993  if( (nCol >= 0) && (nRow >= 0) && mxImpl->mxTable.is() && (nCol < mxImpl->mxTable->getColumnCount()) && (nRow < mxImpl->mxTable->getRowCount()) )
994  return;
995 
996  throw IndexOutOfBoundsException();
997 }
998 
1000 {
1001  mpTable = pTable;
1002  mbRow = bRow;
1003 }
1004 
1006 {
1007  mpTable = nullptr;
1008 }
1009 
1010 // XAccessible
1011 Reference< XAccessibleContext > SAL_CALL AccessibleTableHeaderShape::getAccessibleContext()
1012 {
1013  return this;
1014 }
1015 
1016 // XAccessibleContext
1018 {
1020 }
1021 
1022 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleChild( sal_Int32 i )
1023 {
1024  return mpTable->getAccessibleChild( i );
1025 }
1026 
1027 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleParent()
1028 {
1029  Reference< XAccessible > XParent;
1030  return XParent;
1031 }
1032 
1034 {
1035  return -1;
1036 }
1037 
1039 {
1040  return mpTable->getAccessibleRole();
1041 }
1042 
1044 {
1045  return mpTable->getAccessibleDescription();
1046 }
1047 
1049 {
1050  return mpTable->getAccessibleName();
1051 }
1052 
1053 Reference< XAccessibleStateSet > SAL_CALL AccessibleTableHeaderShape::getAccessibleStateSet()
1054 {
1055  return mpTable->getAccessibleStateSet();
1056 }
1057 
1058 Reference< XAccessibleRelationSet > SAL_CALL AccessibleTableHeaderShape::getAccessibleRelationSet()
1059 {
1060  return mpTable->getAccessibleRelationSet();
1061 }
1062 
1064 {
1065  return mpTable->getLocale();
1066 }
1067 
1068 //XAccessibleComponent
1069 sal_Bool SAL_CALL AccessibleTableHeaderShape::containsPoint ( const css::awt::Point& aPoint )
1070 {
1071  return mpTable->containsPoint( aPoint );
1072 }
1073 
1074 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleAtPoint ( const css::awt::Point& aPoint)
1075 {
1076  return mpTable->getAccessibleAtPoint( aPoint );
1077 }
1078 
1079 css::awt::Rectangle SAL_CALL AccessibleTableHeaderShape::getBounds()
1080 {
1081  return mpTable->getBounds();
1082 }
1083 
1085 {
1086  return mpTable->getLocation();
1087 }
1088 
1090 {
1091  return mpTable->getLocationOnScreen();
1092 }
1093 
1094 css::awt::Size SAL_CALL AccessibleTableHeaderShape::getSize()
1095 {
1096  return mpTable->getSize();
1097 }
1098 
1100 {
1101  return mpTable->getForeground();
1102 }
1103 
1105 {
1106  return mpTable->getBackground();
1107 }
1108 
1110 {
1111  mpTable->grabFocus();
1112 }
1113 // XAccessibleTable
1115 {
1116  return mbRow ? 1 : mpTable->getAccessibleRowCount();
1117 }
1118 
1120 {
1121  return !mbRow ? 1 : mpTable->getAccessibleColumnCount();
1122 }
1123 
1125 {
1126  return mpTable->getAccessibleRowDescription( nRow );
1127 }
1128 
1130 {
1131  return mpTable->getAccessibleColumnDescription( nColumn );
1132 }
1133 
1134 sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
1135 {
1136  return mpTable->getAccessibleRowExtentAt( nRow, nColumn );
1137 }
1138 
1139 sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
1140 {
1141  return mpTable->getAccessibleColumnExtentAt( nRow, nColumn );
1142 }
1143 
1144 Reference< XAccessibleTable > SAL_CALL AccessibleTableHeaderShape::getAccessibleRowHeaders( )
1145 {
1146  Reference< XAccessibleTable > xRet;
1147  return xRet;
1148 }
1149 
1150 Reference< XAccessibleTable > SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnHeaders( )
1151 {
1152  Reference< XAccessibleTable > xRet;
1153  return xRet;
1154 }
1155 
1157 {
1158  sal_Int32 nRow = getAccessibleRowCount();
1159  ::std::vector<bool> aSelected( nRow, true );
1160  sal_Int32 nCount = nRow;
1161  for( sal_Int32 i = 0; i < nRow; i++ )
1162  {
1163  try
1164  {
1165  aSelected[i] = isAccessibleRowSelected( i );
1166  }
1167  catch( ... )
1168  {
1169  return Sequence< sal_Int32 >();
1170  }
1171 
1172  if( !aSelected[i] )
1173  nCount--;
1174  }
1175  Sequence < sal_Int32 > aRet( nCount );
1176  sal_Int32 *pRet = aRet.getArray();
1177  sal_Int32 nPos = 0;
1178  size_t nSize = aSelected.size();
1179  for( size_t i=0; i < nSize && nPos < nCount; i++ )
1180  {
1181  if( aSelected[i] )
1182  {
1183  *pRet++ = i;
1184  nPos++;
1185  }
1186  }
1187 
1188  return aRet;
1189 }
1190 
1192 {
1193  sal_Int32 nColumn = getAccessibleColumnCount();
1194  ::std::vector<bool> aSelected( nColumn, true );
1195  sal_Int32 nCount = nColumn;
1196  for( sal_Int32 i = 0; i < nColumn; i++ )
1197  {
1198  try
1199  {
1200  aSelected[i] = isAccessibleColumnSelected( i );
1201  }
1202  catch( ... )
1203  {
1204  return Sequence< sal_Int32 >();
1205  }
1206 
1207  if( !aSelected[i] )
1208  nCount--;
1209  }
1210  Sequence < sal_Int32 > aRet( nCount );
1211  sal_Int32 *pRet = aRet.getArray();
1212  sal_Int32 nPos = 0;
1213  size_t nSize = aSelected.size();
1214  for( size_t i=0; i < nSize && nPos < nCount; i++ )
1215  {
1216  if( aSelected[i] )
1217  {
1218  *pRet++ = i;
1219  nPos++;
1220  }
1221  }
1222 
1223  return aRet;
1224 }
1225 
1227 {
1228  return mpTable->isAccessibleRowSelected( nRow );
1229 }
1230 
1232 {
1233  return mpTable->isAccessibleColumnSelected( nColumn );
1234 }
1235 
1236 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
1237 {
1238  return mpTable->getAccessibleCellAt( nRow, nColumn );
1239 }
1240 
1241 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleCaption( )
1242 {
1243  return mpTable->getAccessibleCaption();
1244 }
1245 
1246 Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleSummary( )
1247 {
1248  return mpTable->getAccessibleSummary();
1249 }
1250 
1251 sal_Bool SAL_CALL AccessibleTableHeaderShape::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
1252 {
1253  return mpTable->isAccessibleSelected( nRow, nColumn );
1254 }
1255 
1256 sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
1257 {
1258  return mpTable->getAccessibleIndex( nRow, nColumn );
1259 }
1260 
1261 sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRow( sal_Int32 nChildIndex )
1262 {
1263  return mpTable->getAccessibleRow( nChildIndex );
1264 }
1265 
1266 sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumn( sal_Int32 nChildIndex )
1267 {
1268  return mpTable->getAccessibleColumn( nChildIndex );
1269 }
1270 
1271 // XAccessibleTableSelection
1273 {
1274  if( mbRow )
1275  return mpTable->selectRow( row );
1276  else
1277  {
1278  mpTable->clearAccessibleSelection();
1279  sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 );
1280  mpTable->selectAccessibleChild( nIndex );
1281  return true;
1282  }
1283 }
1284 
1286 {
1287  if( !mbRow )
1288  return mpTable->selectColumn( column );
1289  else
1290  {
1291  mpTable->clearAccessibleSelection();
1292  sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column );
1293  mpTable->selectAccessibleChild( nIndex );
1294  return true;
1295  }
1296 }
1297 
1299 {
1300  if( mbRow )
1301  return mpTable->unselectRow( row );
1302  else
1303  {
1304  sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 );
1305  mpTable->deselectAccessibleChild( nIndex );
1306  return true;
1307  }
1308 }
1309 
1311 {
1312  if( !mbRow )
1313  return mpTable->unselectColumn( column );
1314  else
1315  {
1316  sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column );
1317  mpTable->deselectAccessibleChild( nIndex );
1318  return true;
1319  }
1320 }
1321 }
1322 
1323 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL unselectColumn(sal_Int32 column) override
virtual void SAL_CALL selectAllAccessibleChildren() override
const int nColCount
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Type
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
sal_Int32 nIndex
virtual bool SetState(sal_Int16 aState) override
virtual void SAL_CALL disposing() override
This method is called from the component helper base class while disposing.
virtual sal_Bool SAL_CALL selectRow(sal_Int32 row) override
virtual css::lang::Locale SAL_CALL getLocale() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL clearAccessibleSelection() override
virtual void SAL_CALL acquire() override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
virtual sal_Bool SAL_CALL unselectRow(sal_Int32 row) override
virtual css::awt::Size SAL_CALL getSize() override
sal_Int64 n
virtual OUString SAL_CALL getAccessibleDescription() override
virtual void SAL_CALL modified(const EventObject &aEvent) override
void checkCellPosition(sal_Int32 nCol, sal_Int32 nRow)
AccessibleTableShape(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo)
virtual SVX_DLLPRIVATE bool hasSelectedCells() const override
This is a table object, and one or more of its cells are selected.
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
virtual sal_Bool SAL_CALL unselectColumn(sal_Int32 column) override
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
virtual sal_Bool SAL_CALL unselectRow(sal_Int32 row) override
sal_Int32 GetIndexOfSelectedChild(sal_Int32 nSelectedChildIndex) const
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual bool ResetState(sal_Int16 aState) override
bool deselectColumn(sal_Int32 column)
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
uno::Reference< drawing::XShape > const mxShape
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
sdr::table::SvxTableController * getTableController()
sdr::table::SdrTableObj * GetTableObj()
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
virtual bool SetState(sal_Int16 aState) override
virtual bool ResetState(sal_Int16 aState) override
int nCount
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
void getActiveCellPos(sdr::table::CellPos &rPos) const
Definition: svdotable.cxx:1601
virtual css::awt::Point SAL_CALL getLocation() override
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
bool selectColumn(sal_Int32 column)
virtual sal_Bool SAL_CALL selectRow(sal_Int32 row) override
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
int i
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
rtl::Reference< AccessibleTableShape > mpTable
bool isRowSelected(sal_Int32 nRow)
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
void setSelectedCells(const CellPos &rFirstPos, const CellPos &rLastPos)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
unsigned char sal_Bool
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Reference< XAccessible > getAccessibleChild(sal_Int32 i)
const rtl::Reference< sdr::SelectionController > & getSelectionController() const
Definition: svdedxv.hxx:276
void init(const Reference< XAccessible > &xAccessible, const Reference< XTable > &xTable)
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
void getColumnAndRow(sal_Int32 nChildIndex, sal_Int32 &rnColumn, sal_Int32 &rnRow)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
virtual sal_Bool SAL_CALL selectColumn(sal_Int32 column) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
virtual sal_Bool SAL_CALL selectColumn(sal_Int32 column) override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual void SAL_CALL disposing() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
std::unordered_map< Reference< XCell >, rtl::Reference< AccessibleCell > > AccessibleCellMap
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &rEvent) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
virtual OUString CreateAccessibleBaseName() override
rtl::Reference< AccessibleCell > getAccessibleCell(const Reference< XCell > &xCell)
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
FILE * init(int, char **)
virtual bool ResetState(sal_Int16 aState) override
Reset the specified state.
rtl::Reference< AccessibleTableShapeImpl > mxImpl
::cppu::ImplInheritanceHelper< AccessibleShape, css::accessibility::XAccessibleTable, css::view::XSelectionChangeListener > AccessibleTableShape_Base
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
virtual bool SetState(sal_Int16 aState) override
Set the specified state.
virtual bool SetState(sal_Int16 aState)
void getSelectedCells(CellPos &rFirstPos, CellPos &rLastPos) override
This class is a container for the information specific for a single shape that is passed to the const...
bool isColumnSelected(sal_Int32 nColumn)
virtual bool ResetState(sal_Int16 aState)
void dispose()
AccessibleTableHeaderShape(AccessibleTableShape *pTable, bool bRow)
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
virtual void SAL_CALL grabFocus() override
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual OUString SAL_CALL getAccessibleName() override
void getColumnAndRow(sal_Int32 nChildIndex, sal_Int32 &rnColumn, sal_Int32 &rnRow)
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
AnyEventRef aEvent
const sdr::table::CellRef & getActiveCell() const
The active table has the focus or is currently edited.
Definition: svdotable.cxx:1542
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
sal_uInt16 nPos
virtual void SAL_CALL disposing(const EventObject &Source) override
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual void SAL_CALL release() override