2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-27 13:52:10 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2009-10-30 13:21:18 +00:00
|
|
|
|
|
|
|
#include "accessibility/extended/AccessibleGridControlTable.hxx"
|
|
|
|
#include "accessibility/extended/AccessibleGridControlTableCell.hxx"
|
|
|
|
#include <svtools/accessibletable.hxx>
|
|
|
|
|
2014-02-25 16:37:07 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::uno::Sequence;
|
|
|
|
using ::com::sun::star::uno::Any;
|
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::accessibility;
|
|
|
|
using namespace ::svt;
|
|
|
|
using namespace ::svt::table;
|
2014-02-25 16:37:07 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
|
|
|
|
namespace accessibility {
|
|
|
|
|
2014-02-25 16:37:07 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
|
|
|
|
AccessibleGridControlTable::AccessibleGridControlTable(
|
|
|
|
const Reference< XAccessible >& rxParent,
|
|
|
|
IAccessibleTable& rTable,
|
|
|
|
AccessibleTableControlObjType _eType) :
|
|
|
|
AccessibleGridControlTableBase( rxParent, rTable, _eType )
|
2012-08-31 00:46:39 -05:00
|
|
|
,m_pCellVector( )
|
|
|
|
,m_pAccessCellVector( )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
AccessibleGridControlTable::~AccessibleGridControlTable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// XAccessibleContext ---------------------------------------------------------
|
|
|
|
|
|
|
|
Reference< XAccessible > SAL_CALL
|
|
|
|
AccessibleGridControlTable::getAccessibleChild( sal_Int32 nChildIndex )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidIndex( nChildIndex );
|
2012-08-31 00:46:39 -05:00
|
|
|
sal_Int32 nCount = getAccessibleChildCount();
|
|
|
|
if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount)
|
|
|
|
{
|
|
|
|
m_pAccessCellVector.resize(nCount);
|
|
|
|
m_pCellVector.resize(nCount);
|
|
|
|
}
|
|
|
|
if(!m_pAccessCellVector[nChildIndex].is())
|
|
|
|
{
|
|
|
|
AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL);
|
|
|
|
m_pCellVector[nChildIndex] = pCell;
|
|
|
|
m_pAccessCellVector[nChildIndex] = pCell;
|
|
|
|
}
|
|
|
|
return m_pAccessCellVector[nChildIndex];
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
|
|
|
ensureIsAlive();
|
|
|
|
if(m_aTable.HasRowHeader() && m_aTable.HasColHeader())
|
|
|
|
return 0;
|
|
|
|
else if((!m_aTable.HasRowHeader() && m_aTable.HasColHeader()) || (m_aTable.HasRowHeader() && !m_aTable.HasColHeader()) )
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// XAccessibleComponent -------------------------------------------------------
|
|
|
|
|
|
|
|
Reference< XAccessible > SAL_CALL
|
|
|
|
AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
|
|
|
|
Reference< XAccessible > xChild;
|
|
|
|
sal_Int32 nRow = 0;
|
|
|
|
sal_Int32 nColumnPos = 0;
|
|
|
|
if( m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) )
|
|
|
|
xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos, TCTYPE_TABLECELL);
|
|
|
|
return xChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL AccessibleGridControlTable::grabFocus()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
m_aTable.GrabFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
// XAccessibleTable -----------------------------------------------------------
|
|
|
|
|
|
|
|
OUString SAL_CALL AccessibleGridControlTable::getAccessibleRowDescription( sal_Int32 nRow )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidRow( nRow );
|
|
|
|
return m_aTable.GetRowDescription( nRow );
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL AccessibleGridControlTable::getAccessibleColumnDescription( sal_Int32 nColumn )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidColumn( nColumn );
|
|
|
|
return m_aTable.GetColumnDescription( (sal_uInt16)nColumn );
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XAccessibleTable > SAL_CALL AccessibleGridControlTable::getAccessibleRowHeaders()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2013-12-16 15:35:59 +01:00
|
|
|
SolarMutexGuard g;
|
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
if(m_aTable.HasColHeader())
|
|
|
|
return implGetHeaderBar( 1 );
|
|
|
|
else
|
|
|
|
return implGetHeaderBar( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XAccessibleTable > SAL_CALL AccessibleGridControlTable::getAccessibleColumnHeaders()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2013-12-16 15:35:59 +01:00
|
|
|
SolarMutexGuard g;
|
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
return implGetHeaderBar( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleRows()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
Sequence< sal_Int32 > aSelSeq;
|
|
|
|
implGetSelectedRows( aSelSeq );
|
|
|
|
return aSelSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
//columns aren't selectable
|
|
|
|
Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleColumns()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-03-22 11:17:10 +01:00
|
|
|
Sequence< sal_Int32 > aSelSeq(0);
|
|
|
|
return aSelSeq;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 nRow )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2010-03-22 11:17:10 +01:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidRow( nRow );
|
2014-04-14 16:38:33 +02:00
|
|
|
bool bSelected = false;
|
2010-03-22 11:17:10 +01:00
|
|
|
Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
|
|
|
|
for(int i=0; i<selectedRows.getLength(); i++)
|
|
|
|
{
|
|
|
|
if(nRow == selectedRows[i])
|
|
|
|
{
|
2014-04-14 16:38:33 +02:00
|
|
|
bSelected = true;
|
2010-03-22 11:17:10 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bSelected;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//columns aren't selectable
|
|
|
|
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleColumnSelected( sal_Int32 nColumn )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
|
|
|
(void) nColumn;
|
2014-09-15 17:24:50 +02:00
|
|
|
return false;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getAccessibleCellAt(
|
|
|
|
sal_Int32 nRow, sal_Int32 nColumn )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidAddress( nRow, nColumn );
|
2012-08-31 00:46:39 -05:00
|
|
|
sal_Int32 nCount = getAccessibleChildCount();
|
|
|
|
sal_Int32 nChildIndex = nRow*m_aTable.GetColumnCount() + nColumn;
|
|
|
|
if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount)
|
|
|
|
{
|
|
|
|
m_pAccessCellVector.resize(nCount);
|
|
|
|
m_pCellVector.resize(nCount);
|
|
|
|
}
|
|
|
|
if(!m_pAccessCellVector[nChildIndex].is())
|
|
|
|
{
|
|
|
|
AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL);
|
|
|
|
m_pCellVector[nChildIndex] = pCell;
|
|
|
|
m_pAccessCellVector[nChildIndex] = pCell;
|
|
|
|
}
|
|
|
|
return m_pAccessCellVector[nChildIndex];
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected(
|
|
|
|
sal_Int32 nRow, sal_Int32 nColumn )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidAddress( nRow, nColumn );
|
|
|
|
(void) nColumn;
|
2010-03-22 11:17:10 +01:00
|
|
|
//selection of single cells not possible, so if row is selected, the cell will be selected too
|
|
|
|
return isAccessibleRowSelected(nRow);
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidIndex( nChildIndex );
|
2010-03-22 11:17:10 +01:00
|
|
|
sal_Int32 nColumns = m_aTable.GetColumnCount();
|
|
|
|
sal_Int32 nRow = (nChildIndex / nColumns);
|
2014-01-28 20:03:11 +01:00
|
|
|
m_aTable.SelectRow( nRow, true );
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2010-03-22 11:17:10 +01:00
|
|
|
ensureIsAlive();
|
|
|
|
ensureIsValidIndex( nChildIndex );
|
|
|
|
sal_Int32 nColumns = m_aTable.GetColumnCount();
|
|
|
|
sal_Int32 nRow = (nChildIndex / nColumns);
|
|
|
|
return isAccessibleRowSelected(nRow);
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
2011-01-17 09:11:08 +01:00
|
|
|
m_aTable.SelectAllRows( false );
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
2010-03-22 11:17:10 +01:00
|
|
|
Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
|
|
|
|
for(int i=0;i<m_aTable.GetRowCount();i++)
|
|
|
|
selectedRows[i]=i;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
2010-03-22 11:17:10 +01:00
|
|
|
Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
|
|
|
|
sal_Int32 nColumns = m_aTable.GetColumnCount();
|
|
|
|
return selectedRows.getLength()*nColumns;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
Reference< XAccessible > SAL_CALL
|
|
|
|
AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
2010-03-22 11:17:10 +01:00
|
|
|
if(isAccessibleChildSelected(nSelectedChildIndex))
|
|
|
|
return getAccessibleChild(nSelectedChildIndex);
|
|
|
|
else
|
|
|
|
return NULL;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
2010-03-22 11:17:10 +01:00
|
|
|
//not implemented yet, because only row selection possible
|
2009-10-30 13:21:18 +00:00
|
|
|
void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild(
|
|
|
|
sal_Int32 nSelectedChildIndex )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2010-10-14 08:35:22 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2013-12-16 15:35:59 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
ensureIsAlive();
|
|
|
|
(void)nSelectedChildIndex;
|
|
|
|
}
|
|
|
|
// XInterface -----------------------------------------------------------------
|
|
|
|
|
|
|
|
Any SAL_CALL AccessibleGridControlTable::queryInterface( const uno::Type& rType )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
|
|
|
Any aAny( AccessibleGridControlTableBase::queryInterface( rType ) );
|
|
|
|
return aAny.hasValue() ?
|
|
|
|
aAny : AccessibleGridControlTableImplHelper1::queryInterface( rType );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL AccessibleGridControlTable::acquire() throw ()
|
|
|
|
{
|
|
|
|
AccessibleGridControlTableBase::acquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL AccessibleGridControlTable::release() throw ()
|
|
|
|
{
|
|
|
|
AccessibleGridControlTableBase::release();
|
|
|
|
}
|
|
|
|
// XServiceInfo ---------------------------------------------------------------
|
|
|
|
|
|
|
|
OUString SAL_CALL AccessibleGridControlTable::getImplementationName()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2012-09-07 03:36:42 -03:00
|
|
|
return OUString( "com.sun.star.accessibility.AccessibleGridControlTable" );
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// internal virtual methods ---------------------------------------------------
|
|
|
|
|
|
|
|
Rectangle AccessibleGridControlTable::implGetBoundingBox()
|
|
|
|
{
|
2012-08-31 00:46:39 -05:00
|
|
|
Window* pParent = m_aTable.GetAccessibleParentWindow();
|
|
|
|
DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" );
|
|
|
|
Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ));
|
|
|
|
Rectangle aTableRect( m_aTable.calcTableRect() );
|
|
|
|
long nX = aGridRect.Left() + aTableRect.Left();
|
|
|
|
long nY = aGridRect.Top() + aTableRect.Top();
|
|
|
|
long nWidth = aGridRect.GetSize().Width()-aTableRect.Left();
|
|
|
|
long nHeight = aGridRect.GetSize().Height()-aTableRect.Top();
|
|
|
|
Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight ));
|
|
|
|
return aTable;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen()
|
|
|
|
{
|
2012-08-31 00:46:39 -05:00
|
|
|
Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ));
|
|
|
|
Rectangle aTableRect( m_aTable.calcTableRect() );
|
|
|
|
long nX = aGridRect.Left() + aTableRect.Left();
|
|
|
|
long nY = aGridRect.Top() + aTableRect.Top();
|
|
|
|
long nWidth = aGridRect.GetSize().Width()-aTableRect.Left();
|
|
|
|
long nHeight = aGridRect.GetSize().Height()-aTableRect.Top();
|
|
|
|
Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight ));
|
|
|
|
return aTable;
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
// internal helper methods ----------------------------------------------------
|
|
|
|
Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar(
|
|
|
|
sal_Int32 nChildIndex )
|
|
|
|
throw ( uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XAccessible > xRet;
|
|
|
|
Reference< XAccessibleContext > xContext( m_xParent, uno::UNO_QUERY );
|
|
|
|
if( xContext.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
xRet = xContext->getAccessibleChild( nChildIndex );
|
|
|
|
}
|
2011-07-28 23:26:49 +01:00
|
|
|
catch (const lang::IndexOutOfBoundsException&)
|
2009-10-30 13:21:18 +00:00
|
|
|
{
|
2011-03-01 17:55:09 +01:00
|
|
|
OSL_FAIL( "implGetHeaderBar - wrong child index" );
|
2009-10-30 13:21:18 +00:00
|
|
|
}
|
|
|
|
// RuntimeException goes to caller
|
|
|
|
}
|
|
|
|
return Reference< XAccessibleTable >( xRet, uno::UNO_QUERY );
|
|
|
|
}
|
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2014-02-25 16:37:07 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
|
|
|
|
} // namespace accessibility
|
|
|
|
|
2014-02-25 16:37:07 +01:00
|
|
|
|
2009-10-30 13:21:18 +00:00
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|