/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
usingnamespace com::sun::star::accessibility; usingnamespace com::sun::star::uno; /** * Gets accessible table cell. * * @param row the row of the specified cell. * @param column the column of the specified cell. * @param accessible the accessible object of the cell.
*/
SysFreeString(*description);
*description = sal::systools::BStr::newBSTR(ouStr); if (*description==nullptr) return E_FAIL; return S_OK;
} catch(...) { return E_FAIL; }
}
/** * Gets number of columns spanned by table cell. * * @param row the row of the specified cell. * @param column the column of the specified cell. * @param spanColumns the column span of the specified cell.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnExtentAt(long row, long column, long * nColumnsSpanned)
{
SolarMutexGuard g;
/** * Gets total number of columns in table. * * @param columnCount the number of columns in table.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nColumns(long * columnCount)
{
SolarMutexGuard g;
/** * Gets total number of rows in table. * * @param rowCount the number of rows in table.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nRows(long * rowCount)
{
SolarMutexGuard g;
/** * Gets total number of selected columns. * * @param columnCount the number of selected columns.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnCount)
{
SolarMutexGuard g;
/** * Gets total number of selected rows. * * @param rowCount the number of selected rows.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount)
{
SolarMutexGuard g;
SysFreeString(*description);
*description = sal::systools::BStr::newBSTR(ouStr); if (*description==nullptr) return E_FAIL; return S_OK;
} catch(...) { return E_FAIL; }
}
/** * Gets number of rows spanned by a table cell. * * @param row the row of the specified cell. * @param column the column of the specified cell. * @param spanRows the row span of the specified cell.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowExtentAt(long row, long column, long * nRowsSpanned)
{
SolarMutexGuard g;
/** * Gets list of row indexes currently selected (0-based). * * @param accessible the accessible object array of the selected rows. * @param nRows the actual size of the accessible object array.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedRows(long** rows, long* nRows)
{
SolarMutexGuard g;
/** * Gets list of row indexes currently selected (0-based). * * @param maxRows This parameter is ignored. * @param accessible the accessible object array of the selected rows. * @param nRows the actual size of the accessible object array.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedRows(long, long ** rows, long* nRows)
{ return get_selectedRows(rows, nRows);
}
/** * Gets list of column indexes currently selected (0-based). * * @param accessible the accessible object array of the selected columns. * @param numColumns the actual size of accessible object array.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedColumns(long ** columns, long * numColumns)
{
SolarMutexGuard g;
/** * Gets list of column indexes currently selected (0-based). * * @param maxColumns This parameter is ignored * @param accessible the accessible object array of the selected columns. * @param numColumns the actual size of accessible object array.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedColumns(long, long ** columns, long * numColumns)
{ return get_selectedColumns(columns, numColumns);
}
/** * Gets accessible table summary. * * @param accessible the accessible object of the summary.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
{
SolarMutexGuard g;
/** * Gets childIndex of childIndex. * * @param childIndex childIndex
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_childIndex(long RowIndex , long columnIndex, long * childIndex )
{
SolarMutexGuard g;
try {
if(childIndex == nullptr) return E_INVALIDARG;
if(!pRXTable.is()) return E_FAIL;
sal_Int64 nIndex = pRXTable->getAccessibleIndex(RowIndex, columnIndex); if (nIndex > std::numeric_limits<long>::max())
{ // use -2 when the child index is too large to fit into 32 bit to neither use the // valid index of another child nor -1, which is more commonly used to indicate that // a child is no more inside of a parent or invalid otherwise
SAL_WARN("vcl.qt", "CAccTable::get_childIndex: Child index exceeds maximum long value, " "returning -2.");
nIndex = -2;
}
*childIndex = nIndex; return S_OK;
} catch(...) { return E_FAIL; }
}
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowColumnExtentsAtIndex(long, long *, long *, long *, long *,
boolean *)
{ return E_NOTIMPL;
}
// @brief Returns the total number of selected children // @param [out] childCount // Number of children currently selected
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCount)
{
SolarMutexGuard g;
// @brief Returns a list of child indexes currently selected (0-based). // @param [in] maxChildren // Max children requested (possibly from IAccessibleTable::nSelectedChildren) // @param [out] children // array of indexes of selected children (each index is 0-based) // @param [out] nChildren // Length of array (not more than maxChildren)
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedChildren(long, long **children, long *nChildren)
{
SolarMutexGuard g;
sal_Int64 nChildIndex = pRContext->getAccessibleIndexInParent(); if (nChildIndex > std::numeric_limits<long>::max())
{
SAL_WARN("iacc2", "CAccTable::get_selectedChildren: Child index exceeds maximum long value, " "using max long.");
nChildIndex = std::numeric_limits<long>::max();
}
(*children)[i] = nChildIndex;
}
}
return S_OK;
} catch(...) { return E_FAIL; }
}
/** * @brief Returns a list of accessibles currently selected. * @param cells Pointer to an array of references to selected accessibles. * The array is allocated by the server with CoTaskMemAlloc and * freed by the client with CoTaskMemFree. * @param nSelectedCells The number of accessibles returned; the size of the returned array. * @return S_FALSE if there are none, [out] values are NULL and 0 respectively, otherwise S_OK
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedCells(IUnknown * * * cells, long *nSelectedCells)
{
SolarMutexGuard g;
try {
if (cells == nullptr || nSelectedCells == nullptr) return E_INVALIDARG;
if (!pRXTable.is()) return E_FAIL;
Reference<XAccessibleSelection> xSelection(pRXTable, UNO_QUERY); if (!xSelection.is()) return E_FAIL;
sal_Int64 nSelected = xSelection->getSelectedAccessibleChildCount(); if (nSelected > std::numeric_limits<long>::max())
{
SAL_WARN("iacc2", "CAccTable::get_selectedCells: Selected cell count exceeds maximum long value, " "using max long.");
nSelected = std::numeric_limits<long>::max();
}
*nSelectedCells = nSelected;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.