31#include <com/sun/star/accessibility/XAccessible.hpp>
34#include <com/sun/star/accessibility/XAccessibleTableSelection.hpp>
53 if(accessible ==
nullptr)
63 *accessible =
nullptr;
67 IAccessible* pRet =
nullptr;
92 }
catch(...) {
return E_FAIL; }
123 if(description ==
nullptr)
130 const OUString& ouStr =
pRXTable->getAccessibleColumnDescription(column);
133 SysFreeString(*description);
134 *description = SysAllocString(o3tl::toW(ouStr.getStr()));
135 if (*description==
nullptr)
139 }
catch(...) {
return E_FAIL; }
156 if(nColumnsSpanned ==
nullptr)
162 *nColumnsSpanned =
pRXTable->getAccessibleColumnExtentAt(row, column);
165 }
catch(...) {
return E_FAIL; }
181 if(accessibleTable ==
nullptr || startingRowIndex ==
nullptr)
189 if(!pRColumnHeaderTable.is())
191 *accessibleTable =
nullptr;
197 if(!pRXColumnHeader.is())
199 *accessibleTable =
nullptr;
202 *startingRowIndex = 0 ;
205 HRESULT
hr = createInstance<CMAccessible>(IID_IMAccessible, &pIMacc);
211 reinterpret_cast<hyper
>(pRXColumnHeader.get()));
212 pIMacc->QueryInterface(IID_IAccessibleTable,
reinterpret_cast<void **
>(accessibleTable));
216 }
catch(...) {
return E_FAIL; }
231 if(columnCount ==
nullptr)
238 *columnCount =
pRXTable->getAccessibleColumnCount();
241 }
catch(...) {
return E_FAIL; }
256 if(rowCount ==
nullptr)
263 *rowCount =
pRXTable->getAccessibleRowCount();
266 }
catch(...) {
return E_FAIL; }
281 if(columnCount ==
nullptr)
289 *columnCount = pSelected.getLength();
292 }
catch(...) {
return E_FAIL; }
307 if(rowCount ==
nullptr)
315 *rowCount = pSelected.getLength();
318 }
catch(...) {
return E_FAIL; }
334 if(description ==
nullptr)
341 const OUString& ouStr =
pRXTable->getAccessibleRowDescription(row);
344 SysFreeString(*description);
345 *description = SysAllocString(o3tl::toW(ouStr.getStr()));
346 if (*description==
nullptr)
350 }
catch(...) {
return E_FAIL; }
367 if(nRowsSpanned ==
nullptr)
373 *nRowsSpanned=
pRXTable->getAccessibleRowExtentAt(row, column);
377 }
catch(...) {
return E_FAIL; }
393 if(accessibleTable ==
nullptr || startingColumnIndex ==
nullptr)
401 if(!pRRowHeaderTable.is())
403 *accessibleTable =
nullptr;
409 if(!pRXRowHeader.is())
411 *accessibleTable =
nullptr;
414 *startingColumnIndex = 0 ;
417 HRESULT
hr = createInstance<CMAccessible>(IID_IMAccessible, &pIMacc);
423 reinterpret_cast<hyper
>(pRXRowHeader.get()));
424 pIMacc->QueryInterface(IID_IAccessibleTable,
reinterpret_cast<void **
>(accessibleTable));
428 }
catch(...) {
return E_FAIL; }
444 if(rows ==
nullptr ||
nRows ==
nullptr)
452 long count = pSelected.getLength() ;
455 *rows =
static_cast<long*
>(CoTaskMemAlloc(
count *
sizeof(
long)));
462 (*rows)[
i] = pSelected[
i];
466 }
catch(...) {
return E_FAIL; }
494 if(columns ==
nullptr || numColumns ==
nullptr)
502 long count = pSelected.getLength() ;
505 *columns =
static_cast<long*
>(CoTaskMemAlloc(
count *
sizeof(
long)));
507 if(*columns ==
nullptr)
512 (*columns)[
i] = pSelected[
i];
516 }
catch(...) {
return E_FAIL; }
543 if(accessible ==
nullptr)
552 IAccessible* pRet =
nullptr;
564 }
catch(...) {
return E_FAIL; }
590 }
catch(...) {
return E_FAIL; }
616 }
catch(...) {
return E_FAIL; }
643 }
catch(...) {
return E_FAIL; }
663 if(pRTableExtent.is())
665 pRTableExtent->selectRow(row);
672 if(!pRSelection.is())
676 long lCol, lColumnCount;
677 lColumnCount =
pRXTable->getAccessibleColumnCount();
678 for(lCol = 0; lCol < lColumnCount; lCol ++)
680 sal_Int64 nChildIndex =
pRXTable->getAccessibleIndex(row, lCol);
681 pRSelection->selectAccessibleChild(nChildIndex);
687 }
catch(...) {
return E_FAIL; }
707 if(pRTableExtent.is())
709 pRTableExtent->selectColumn(column);
716 if(!pRSelection.is())
720 long lRow, lRowCount;
721 lRowCount =
pRXTable->getAccessibleRowCount();
722 for(lRow = 0; lRow < lRowCount; lRow ++)
724 sal_Int64 nChildIndex =
pRXTable->getAccessibleIndex(lRow, column);
725 pRSelection->selectAccessibleChild(nChildIndex);
732 }
catch(...) {
return E_FAIL; }
752 if(pRTableExtent.is())
754 if(pRTableExtent->unselectRow(row))
763 if(!pRSelection.is())
767 long lColumn, lColumnCount;
768 lColumnCount =
pRXTable->getAccessibleColumnCount();
769 for(lColumn = 0; lColumn < lColumnCount; lColumn ++)
771 sal_Int64 nChildIndex =
pRXTable->getAccessibleIndex(row, lColumn);
772 pRSelection->deselectAccessibleChild(nChildIndex);
779 }
catch(...) {
return E_FAIL; }
799 if(pRTableExtent.is())
801 if(pRTableExtent->unselectColumn(column))
810 if(!pRSelection.is())
814 long lRow, lRowCount;
815 lRowCount =
pRXTable->getAccessibleRowCount();
817 for(lRow = 0; lRow < lRowCount; lRow ++)
819 sal_Int64 nChildIndex =
pRXTable->getAccessibleIndex(lRow, column);
820 pRSelection->deselectAccessibleChild(nChildIndex);
825 }
catch(...) {
return E_FAIL; }
845 if( !pRContext.is() )
855 }
catch(...) {
return E_FAIL; }
881 }
catch(...) {
return E_FAIL; }
905 }
catch(...) {
return E_FAIL; }
928 if (
nIndex > std::numeric_limits<long>::max())
933 SAL_WARN(
"vcl.qt",
"CAccTable::get_childIndex: Child index exceeds maximum long value, "
940 }
catch(...) {
return E_FAIL; }
968 if(childCount ==
nullptr)
976 if(!pRSelection.is())
979 sal_Int64 nSelected = pRSelection->getSelectedAccessibleChildCount();
980 if (nSelected > std::numeric_limits<long>::max())
982 SAL_WARN(
"iacc2",
"CAccTable::get_nSelectedChildren: Selected item count exceeds maximum long value, "
984 nSelected = std::numeric_limits<long>::max();
986 *childCount = nSelected;
989 }
catch(...) {
return E_FAIL; }
1013 if(children ==
nullptr || nChildren ==
nullptr)
1014 return E_INVALIDARG;
1021 if(!pRSelection.is())
1024 sal_Int64 nChildCount = pRSelection->getSelectedAccessibleChildCount();
1025 if (nChildCount > std::numeric_limits<long>::max())
1027 SAL_WARN(
"iacc2",
"CAccTable::get_selectedChildren: Selected child count exceeds maximum long value, "
1029 nChildCount = std::numeric_limits<long>::max();
1032 *nChildren = nChildCount;
1033 *children =
static_cast<long*
>(CoTaskMemAlloc(nChildCount *
sizeof(
long)));
1035 for( sal_Int64
i = 0;
i< nChildCount;
i++)
1041 if( !pRContext.is() )
1045 sal_Int64 nChildIndex = pRContext->getAccessibleIndexInParent();
1046 if (nChildIndex > std::numeric_limits<long>::max())
1048 SAL_WARN(
"iacc2",
"CAccTable::get_selectedChildren: Child index exceeds maximum long value, "
1050 nChildIndex = std::numeric_limits<long>::max();
1052 (*children)[
i] = nChildIndex;
1058 }
catch(...) {
return E_FAIL; }
1077 return E_INVALIDARG;
1083 if (!xSelection.is())
1086 sal_Int64 nSelected = xSelection->getSelectedAccessibleChildCount();
1087 if (nSelected > std::numeric_limits<long>::max())
1089 SAL_WARN(
"iacc2",
"CAccTable::get_selectedCells: Selected cell count exceeds maximum long value, "
1091 nSelected = std::numeric_limits<long>::max();
1095 *cells =
static_cast<IUnknown**
>(CoTaskMemAlloc(nSelected *
sizeof(IUnknown*)));
1097 for (sal_Int64
i = 0;
i < nSelected;
i++)
1102 IAccessible* pIAccessible;
1112 assert(bOK &&
"Couldn't retrieve IAccessible object");
1114 pIAccessible->AddRef();
1115 (*cells)[
i] = pIAccessible;
1120 }
catch(...) {
return E_FAIL; }
virtual bool InsertAccObj(css::accessibility::XAccessible *pXAcc, css::accessibility::XAccessible *pParentXAcc, HWND hWnd=nullptr)
When a new UNO XAccessible object is found by listener, we create a corresponding com object and inse...
STDMETHOD() get_caption(IUnknown **accessible) override
Gets accessible table caption.
STDMETHOD() get_rowColumnExtentsAtIndex(long index, long *row, long *column, long *rowExtents, long *columnExtents, boolean *isSelected) override
STDMETHOD() get_summary(IUnknown **accessible) override
Gets accessible table summary.
STDMETHOD() selectColumn(long column) override
Selects a column and unselect all previously selected columns.
STDMETHOD() unselectColumn(long column) override
Unselects one column, leaving other selected columns selected (if any).
STDMETHOD() put_XInterface(hyper pXInterface) override
Override of IUNOXWrapper.
STDMETHOD() get_selectedChildren(long maxChildren, long **children, long *nChildren) override
STDMETHOD() get_selectedColumns(long **columns, long *numColumns) override
Gets list of column indexes currently selected (0-based).
STDMETHOD() get_columnHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex) override
Gets accessible column header.
STDMETHOD() get_cellAt(long row, long column, IUnknown **cell) override
STDMETHOD() get_selectedRows(long **rows, long *nRows) override
Gets list of row indexes currently selected (0-based).
STDMETHOD() get_nColumns(long *columnCount) override
Gets total number of columns in table.
STDMETHOD() get_isColumnSelected(long column, boolean *isSelected) override
Determines if table column is selected.
STDMETHOD() get_selectedCells(IUnknown ***cells, long *nSelectedCells) override
Returns a list of accessibles currently selected.
STDMETHOD() selectRow(long row) override
Selects a row and unselect all previously selected rows.
css::uno::Reference< css::accessibility::XAccessibleTable > pRXTable
STDMETHOD() get_nSelectedCells(long *childCount) override
STDMETHOD() get_columnDescription(long column, BSTR *description) override
Gets accessible column description (as string).
STDMETHOD() get_columnIndex(long childIndex, long *columnIndex) override
Gets columnIndex of childIndex.
STDMETHOD() get_rowHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex) override
Gets accessible row header.
STDMETHOD() get_rowExtentAt(long row, long column, long *nRowsSpanned) override
Gets number of rows spanned by a table cell.
STDMETHOD() unselectRow(long row) override
Unselects one row, leaving other selected rows selected (if any).
STDMETHOD() get_childIndex(long rowIndex, long columnIndex, long *childIndex) override
Gets childIndex of childIndex.
STDMETHOD() get_modelChange(IA2TableModelChange *modelChange) override
STDMETHOD() get_rowDescription(long row, BSTR *description) override
Gets accessible row description (as string).
STDMETHOD() get_nSelectedChildren(long *childCount) override
STDMETHOD() get_accessibleAt(long row, long column, IUnknown **accessible) override
Gets accessible table cell.
STDMETHOD() get_columnExtentAt(long row, long column, long *nColumnsSpanned) override
Gets number of columns spanned by table cell.
STDMETHOD() get_nRows(long *rowCount) override
Gets total number of rows in table.
STDMETHOD() get_nSelectedRows(long *rowCount) override
Gets total number of selected rows.
STDMETHOD() get_isSelected(long row, long column, boolean *isSelected) override
Determines if table cell is selected.
STDMETHOD() get_rowIndex(long childIndex, long *rowIndex) override
Gets rowIndex of childIndex.
STDMETHOD() get_isRowSelected(long row, boolean *isSelected) override
Determines if table row is selected.
STDMETHOD() get_nSelectedColumns(long *columnCount) override
Gets total number of selected columns.
static bool get_IAccessibleFromXAccessible(css::accessibility::XAccessible *pXAcc, IAccessible **ppIA)
static AccObjectManagerAgent * g_pAgent
STDMETHOD() put_XInterface(hyper pXInterface) override
css::accessibility::XAccessible * pUNOInterface
long nSelectedCells
Returns the total number of selected cells.
This interface gives access to a two-dimensional table.
long childIndex([in] long rowIndex,[in] long columnIndex)
Translates the given row and column indexes into the corresponding cell index.
long rowIndex([in] long cellIndex)
Translates the given cell index into a row index.
long columnIndex([in] long cellIndex)
Translates the given cell index into the corresponding column index.
long nRows
Returns the total number of rows in table.
boolean isSelected([in] long row,[in] long column)
Returns a boolean value indicating whether the specified cell is selected.
HRESULT SetXAccessible(hyper XAccessible)
#define SAL_WARN(area, stream)
A structure defining the type of and extents of changes made to a table.