2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
2010-02-12 15:01:35 +01:00
|
|
|
*
|
2012-11-15 17:28:16 +00:00
|
|
|
* 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/.
|
2010-02-12 15:01:35 +01:00
|
|
|
*
|
2012-11-15 17:28:16 +00:00
|
|
|
* This file incorporates work covered by the following license notice:
|
2010-02-12 15:01:35 +01:00
|
|
|
*
|
2012-11-15 17:28:16 +00:00
|
|
|
* 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-08-26 13:11:27 +00:00
|
|
|
|
2014-05-06 15:29:12 +03:00
|
|
|
#include "table/tablecontrol.hxx"
|
2011-01-14 11:44:35 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
#include "tablegeometry.hxx"
|
|
|
|
#include "tablecontrol_impl.hxx"
|
2011-01-14 11:44:35 +01:00
|
|
|
#include "tabledatawindow.hxx"
|
2011-01-11 13:26:40 +01:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
|
|
|
|
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
2012-08-31 00:46:39 -05:00
|
|
|
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
#include <tools/diagnose_ex.h>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2011-01-11 13:26:40 +01:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using ::com::sun::star::accessibility::XAccessible;
|
|
|
|
using namespace ::com::sun::star::accessibility;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace utl;
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
namespace svt { namespace table
|
|
|
|
{
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId;
|
|
|
|
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
//= TableControl
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
TableControl::TableControl( vcl::Window* _pParent, WinBits _nStyle )
|
2009-08-26 13:11:27 +00:00
|
|
|
:Control( _pParent, _nStyle )
|
|
|
|
,m_pImpl( new TableControl_Impl( *this ) )
|
|
|
|
{
|
2011-01-13 15:07:42 +01:00
|
|
|
TableDataWindow& rDataWindow = m_pImpl->getDataWindow();
|
|
|
|
rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
|
2010-05-05 10:46:06 +02:00
|
|
|
|
|
|
|
// by default, use the background as determined by the style settings
|
|
|
|
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
|
|
|
|
SetBackground( Wallpaper( aWindowColor ) );
|
|
|
|
SetFillColor( aWindowColor );
|
2012-09-03 16:25:42 -05:00
|
|
|
|
|
|
|
SetCompoundControl( true );
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
TableControl::~TableControl()
|
2015-01-12 15:16:05 +02:00
|
|
|
{
|
2015-03-10 09:07:06 +02:00
|
|
|
disposeOnce();
|
2015-01-12 15:16:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void TableControl::dispose()
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners( VclEventId::ObjectDying );
|
2010-12-17 13:38:24 +01:00
|
|
|
|
|
|
|
m_pImpl->setModel( PTableModel() );
|
2011-01-13 15:07:42 +01:00
|
|
|
m_pImpl->disposeAccessible();
|
2010-12-17 13:38:24 +01:00
|
|
|
m_pImpl.reset();
|
2015-01-12 15:16:05 +02:00
|
|
|
Control::dispose();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::GetFocus()
|
|
|
|
{
|
2015-05-01 16:33:01 +02:00
|
|
|
if ( !m_pImpl || !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) )
|
2009-08-26 13:11:27 +00:00
|
|
|
Control::GetFocus();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::LoseFocus()
|
|
|
|
{
|
2015-05-01 16:33:01 +02:00
|
|
|
if ( !m_pImpl || !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) )
|
2009-08-26 13:11:27 +00:00
|
|
|
Control::LoseFocus();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::KeyInput( const KeyEvent& rKEvt )
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->getInputHandler()->KeyInput( *m_pImpl, rKEvt ) )
|
|
|
|
Control::KeyInput( rKEvt );
|
2012-08-31 00:46:39 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( m_pImpl->isAccessibleAlive() )
|
|
|
|
{
|
|
|
|
m_pImpl->commitCellEvent( AccessibleEventId::STATE_CHANGED,
|
|
|
|
makeAny( AccessibleStateType::FOCUSED ),
|
|
|
|
Any()
|
|
|
|
);
|
|
|
|
// Huh? What the heck? Why do we unconditionally notify a STATE_CHANGE/FOCUSED after each and every
|
|
|
|
// (handled) key stroke?
|
|
|
|
|
|
|
|
m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
|
|
|
|
Any(),
|
|
|
|
Any()
|
|
|
|
);
|
|
|
|
// ditto: Why do we notify this unconditionally? We should find the right place to notify the
|
|
|
|
// ACTIVE_DESCENDANT_CHANGED event.
|
|
|
|
// Also, we should check if STATE_CHANGED/FOCUSED is really necessary: finally, the children are
|
|
|
|
// transient, aren't they?
|
|
|
|
}
|
|
|
|
}
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
2010-05-05 10:46:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
void TableControl::StateChanged( StateChangedType i_nStateChange )
|
|
|
|
{
|
|
|
|
Control::StateChanged( i_nStateChange );
|
|
|
|
|
|
|
|
// forward certain settings to the data window
|
|
|
|
switch ( i_nStateChange )
|
|
|
|
{
|
2015-05-05 13:46:44 +02:00
|
|
|
case StateChangedType::ControlFocus:
|
2012-08-20 21:21:22 -05:00
|
|
|
m_pImpl->invalidateSelectedRows();
|
|
|
|
break;
|
|
|
|
|
2015-05-05 13:46:44 +02:00
|
|
|
case StateChangedType::ControlBackground:
|
2010-05-05 10:46:06 +02:00
|
|
|
if ( IsControlBackground() )
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlBackground( GetControlBackground() );
|
2010-05-05 10:46:06 +02:00
|
|
|
else
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlBackground();
|
2010-05-05 10:46:06 +02:00
|
|
|
break;
|
|
|
|
|
2015-05-05 13:46:44 +02:00
|
|
|
case StateChangedType::ControlForeground:
|
2010-05-05 10:46:06 +02:00
|
|
|
if ( IsControlForeground() )
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlForeground( GetControlForeground() );
|
2010-05-05 10:46:06 +02:00
|
|
|
else
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlForeground();
|
2010-05-05 10:46:06 +02:00
|
|
|
break;
|
|
|
|
|
2015-05-05 13:46:44 +02:00
|
|
|
case StateChangedType::ControlFont:
|
2010-05-05 10:46:06 +02:00
|
|
|
if ( IsControlFont() )
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlFont( GetControlFont() );
|
2010-05-05 10:46:06 +02:00
|
|
|
else
|
2011-01-13 15:07:42 +01:00
|
|
|
getDataWindow().SetControlFont();
|
2010-05-05 10:46:06 +02:00
|
|
|
break;
|
2014-10-07 16:08:25 +02:00
|
|
|
default:;
|
2010-05-05 10:46:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::Resize()
|
|
|
|
{
|
|
|
|
Control::Resize();
|
|
|
|
m_pImpl->onResize();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-04-11 13:26:19 +02:00
|
|
|
void TableControl::SetModel( const PTableModel& _pModel )
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
|
|
|
m_pImpl->setModel( _pModel );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
PTableModel TableControl::GetModel() const
|
|
|
|
{
|
|
|
|
return m_pImpl->getModel();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
sal_Int32 TableControl::GetCurrentRow() const
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
2011-01-11 14:00:09 +01:00
|
|
|
return m_pImpl->getCurrentRow();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
sal_Int32 TableControl::GetCurrentColumn() const
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
2011-01-11 14:00:09 +01:00
|
|
|
return m_pImpl->getCurrentColumn();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-01-13 15:06:42 +02:00
|
|
|
void TableControl::GoTo( ColPos _nColumn, RowPos _nRow )
|
2012-09-03 19:05:27 -05:00
|
|
|
{
|
2016-01-13 15:06:42 +02:00
|
|
|
m_pImpl->goTo( _nColumn, _nRow );
|
2012-09-03 19:05:27 -05:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-01-13 09:58:40 +02:00
|
|
|
void TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos)
|
2009-10-30 12:37:25 +00:00
|
|
|
{
|
2016-01-13 09:58:40 +02:00
|
|
|
m_pImpl->goTo( _nColPos, _nRowPos );
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
2011-01-11 13:26:40 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-14 11:04:24 +01:00
|
|
|
sal_Int32 TableControl::GetSelectedRowCount() const
|
|
|
|
{
|
|
|
|
return sal_Int32( m_pImpl->getSelectedRowCount() );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-14 11:04:24 +01:00
|
|
|
sal_Int32 TableControl::GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const
|
2010-03-18 08:21:26 +01:00
|
|
|
{
|
2011-01-14 11:04:24 +01:00
|
|
|
return sal_Int32( m_pImpl->getSelectedRowIndex( i_selectionIndex ) );
|
2010-03-18 08:21:26 +01:00
|
|
|
}
|
2011-01-14 11:04:24 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-14 11:04:24 +01:00
|
|
|
bool TableControl::IsRowSelected( sal_Int32 const i_rowIndex ) const
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
2011-01-14 11:04:24 +01:00
|
|
|
return m_pImpl->isRowSelected( i_rowIndex );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
void TableControl::SelectRow( RowPos const i_rowIndex, bool const i_select )
|
2010-03-18 08:21:26 +01:00
|
|
|
{
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
ENSURE_OR_RETURN_VOID( ( i_rowIndex >= 0 ) && ( i_rowIndex < m_pImpl->getModel()->getRowCount() ),
|
2011-03-04 11:56:45 +01:00
|
|
|
"TableControl::SelectRow: invalid row index!" );
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
|
|
|
|
if ( i_select )
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->markRowAsSelected( i_rowIndex ) )
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
}
|
2009-08-26 13:11:27 +00:00
|
|
|
else
|
2010-03-22 11:17:10 +01:00
|
|
|
{
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
m_pImpl->markRowAsDeselected( i_rowIndex );
|
2010-03-22 11:17:10 +01:00
|
|
|
}
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
|
2011-01-13 16:28:06 +01:00
|
|
|
m_pImpl->invalidateRowRange( i_rowIndex, i_rowIndex );
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
Select();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-14 11:04:24 +01:00
|
|
|
void TableControl::SelectAllRows( bool const i_select )
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
2011-01-13 14:08:36 +01:00
|
|
|
if ( i_select )
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->markAllRowsAsSelected() )
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->markAllRowsAsDeselected() )
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Invalidate();
|
|
|
|
// TODO: can't we do better than this, and invalidate only the rows which changed?
|
|
|
|
Select();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
ITableControl& TableControl::getTableControlInterface()
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
2011-01-11 10:58:26 +01:00
|
|
|
return *m_pImpl;
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
SelectionEngine* TableControl::getSelEngine()
|
|
|
|
{
|
|
|
|
return m_pImpl->getSelEngine();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window& TableControl::getDataWindow()
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
|
|
|
return m_pImpl->getDataWindow();
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
Reference< XAccessible > TableControl::CreateAccessible()
|
|
|
|
{
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pParent = GetAccessibleParentWindow();
|
2015-11-10 10:25:17 +01:00
|
|
|
ENSURE_OR_RETURN( pParent, "TableControl::CreateAccessible - parent not found", nullptr );
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-13 15:07:42 +01:00
|
|
|
return m_pImpl->getAccessible( *pParent );
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
2011-01-13 15:07:42 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 )
|
2009-10-30 12:37:25 +00:00
|
|
|
{
|
2016-06-12 14:42:51 +02:00
|
|
|
SAL_WARN( "svtools", "TableControl::CreateAccessibleControl: to be overwritten!" );
|
2015-11-10 10:25:17 +01:00
|
|
|
return nullptr;
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
2011-01-13 15:07:42 +01:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const
|
2009-10-30 12:37:25 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aRetText;
|
2010-02-12 17:08:15 +01:00
|
|
|
//Window* pWin;
|
2009-10-30 12:37:25 +00:00
|
|
|
switch( eObjType )
|
|
|
|
{
|
|
|
|
case TCTYPE_GRIDCONTROL:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "Grid control";
|
2009-10-30 12:37:25 +00:00
|
|
|
break;
|
|
|
|
case TCTYPE_TABLE:
|
2015-07-07 23:14:45 +02:00
|
|
|
aRetText = "Grid control";
|
2009-10-30 12:37:25 +00:00
|
|
|
break;
|
|
|
|
case TCTYPE_ROWHEADERBAR:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "RowHeaderBar";
|
2009-10-30 12:37:25 +00:00
|
|
|
break;
|
|
|
|
case TCTYPE_COLUMNHEADERBAR:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "ColumnHeaderBar";
|
2009-10-30 12:37:25 +00:00
|
|
|
break;
|
|
|
|
case TCTYPE_TABLECELL:
|
2016-01-09 22:55:28 +01:00
|
|
|
//the name of the cell consists of column name and row name if defined
|
2012-08-31 00:46:39 -05:00
|
|
|
//if the name is equal to cell content, it'll be read twice
|
|
|
|
if(GetModel()->hasColumnHeaders())
|
|
|
|
{
|
2013-06-29 14:42:54 +02:00
|
|
|
aRetText = GetColumnName(_nCol) + " , ";
|
2012-08-31 00:46:39 -05:00
|
|
|
}
|
|
|
|
if(GetModel()->hasRowHeaders())
|
|
|
|
{
|
2013-06-29 14:42:54 +02:00
|
|
|
aRetText += GetRowName(_nRow) + " , ";
|
2012-08-31 00:46:39 -05:00
|
|
|
}
|
|
|
|
//aRetText = GetAccessibleCellText(_nRow, _nCol);
|
2009-10-30 12:37:25 +00:00
|
|
|
break;
|
|
|
|
case TCTYPE_ROWHEADERCELL:
|
|
|
|
aRetText = GetRowName(_nRow);
|
|
|
|
break;
|
|
|
|
case TCTYPE_COLUMNHEADERCELL:
|
|
|
|
aRetText = GetColumnName(_nCol);
|
|
|
|
break;
|
|
|
|
default:
|
2011-03-12 12:08:50 +01:00
|
|
|
OSL_FAIL("GridControl::GetAccessibleName: invalid enum!");
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
|
|
|
return aRetText;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-03-01 08:30:03 +02:00
|
|
|
OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType ) const
|
2009-10-30 12:37:25 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aRetText;
|
2011-01-11 13:26:40 +01:00
|
|
|
switch( eObjType )
|
|
|
|
{
|
|
|
|
case TCTYPE_GRIDCONTROL:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "Grid control description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_TABLE:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "TABLE description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_ROWHEADERBAR:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "ROWHEADERBAR description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_COLUMNHEADERBAR:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "COLUMNHEADERBAR description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_TABLECELL:
|
2012-08-31 00:46:39 -05:00
|
|
|
// the description of the cell consists of column name and row name if defined
|
|
|
|
// if the name is equal to cell content, it'll be read twice
|
|
|
|
if ( GetModel()->hasColumnHeaders() )
|
|
|
|
{
|
2013-06-29 14:42:54 +02:00
|
|
|
aRetText = GetColumnName( GetCurrentColumn() ) + " , ";
|
2012-08-31 00:46:39 -05:00
|
|
|
}
|
|
|
|
if ( GetModel()->hasRowHeaders() )
|
|
|
|
{
|
|
|
|
aRetText += GetRowName( GetCurrentRow() );
|
|
|
|
}
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_ROWHEADERCELL:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "ROWHEADERCELL description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
case TCTYPE_COLUMNHEADERCELL:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "COLUMNHEADERCELL description";
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return aRetText;
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
OUString TableControl::GetRowDescription( sal_Int32) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return OUString( "row description" );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetRowName( sal_Int32 _nIndex) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sRowName;
|
2011-01-16 22:18:58 +01:00
|
|
|
GetModel()->getRowHeading( _nIndex ) >>= sRowName;
|
|
|
|
return sRowName;
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
OUString TableControl::GetColumnDescription( sal_uInt16) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return OUString( "col description" );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return GetModel()->getColumnModel(_nIndex)->getName();
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return m_pImpl->getCellContentAsString( _nRowPos, _nColPos );
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
void TableControl::FillAccessibleStateSet(
|
|
|
|
::utl::AccessibleStateSetHelper& rStateSet,
|
|
|
|
AccessibleTableControlObjType eObjType ) const
|
|
|
|
{
|
|
|
|
switch( eObjType )
|
|
|
|
{
|
|
|
|
case TCTYPE_GRIDCONTROL:
|
|
|
|
case TCTYPE_TABLE:
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2016-05-29 17:12:52 +02:00
|
|
|
if ( m_pImpl->getSelEngine()->GetSelectionMode() == SelectionMode::Multiple )
|
2012-08-31 00:46:39 -05:00
|
|
|
rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
|
|
|
|
|
|
|
|
if ( HasChildPathFocus() )
|
2011-01-11 13:26:40 +01:00
|
|
|
rStateSet.AddState( AccessibleStateType::FOCUSED );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
if ( IsActive() )
|
|
|
|
rStateSet.AddState( AccessibleStateType::ACTIVE );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
|
|
|
if ( m_pImpl->getDataWindow().IsEnabled() )
|
|
|
|
{
|
2011-01-11 13:26:40 +01:00
|
|
|
rStateSet.AddState( AccessibleStateType::ENABLED );
|
2012-08-31 00:46:39 -05:00
|
|
|
rStateSet.AddState( AccessibleStateType::SENSITIVE );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
if ( IsReallyVisible() )
|
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
2010-03-22 11:17:10 +01:00
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
if ( eObjType == TCTYPE_TABLE )
|
|
|
|
rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
case TCTYPE_ROWHEADERBAR:
|
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
|
|
|
|
break;
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
case TCTYPE_COLUMNHEADERBAR:
|
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
|
|
|
|
break;
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
case TCTYPE_TABLECELL:
|
|
|
|
{
|
2012-08-31 00:46:39 -05:00
|
|
|
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
|
|
|
|
if ( HasChildPathFocus() )
|
|
|
|
rStateSet.AddState( AccessibleStateType::FOCUSED );
|
|
|
|
rStateSet.AddState( AccessibleStateType::ACTIVE );
|
2011-01-11 13:26:40 +01:00
|
|
|
rStateSet.AddState( AccessibleStateType::TRANSIENT );
|
|
|
|
rStateSet.AddState( AccessibleStateType::SELECTABLE);
|
2012-08-31 00:46:39 -05:00
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
rStateSet.AddState( AccessibleStateType::SHOWING );
|
|
|
|
if ( IsRowSelected( GetCurrentRow() ) )
|
|
|
|
// Hmm? Wouldn't we expect the affected row to be a parameter to this function?
|
|
|
|
rStateSet.AddState( AccessibleStateType::SELECTED );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
break;
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
case TCTYPE_ROWHEADERCELL:
|
2009-10-30 12:37:25 +00:00
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
rStateSet.AddState( AccessibleStateType::TRANSIENT );
|
2011-01-11 13:26:40 +01:00
|
|
|
break;
|
2012-08-31 00:46:39 -05:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
case TCTYPE_COLUMNHEADERCELL:
|
|
|
|
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
break;
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
void TableControl::commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue )
|
|
|
|
{
|
|
|
|
if ( m_pImpl->isAccessibleAlive() )
|
|
|
|
m_pImpl->commitCellEvent( i_eventID, i_newValue, i_oldValue );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
void TableControl::commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue )
|
|
|
|
{
|
|
|
|
if ( m_pImpl->isAccessibleAlive() )
|
|
|
|
m_pImpl->commitTableEvent( i_eventID, i_newValue, i_oldValue );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TableControl::GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return Control::GetWindowExtentsRelative( pRelativeWindow );
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
void TableControl::GrabFocus()
|
|
|
|
{
|
|
|
|
Control::GrabFocus();
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-03-01 08:30:03 +02:00
|
|
|
Reference< XAccessible > TableControl::GetAccessible()
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2016-03-01 08:30:03 +02:00
|
|
|
return Control::GetAccessible();
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* TableControl::GetAccessibleParentWindow() const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return Control::GetAccessibleParentWindow();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* TableControl::GetWindowInstance()
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-03-19 12:54:33 +02:00
|
|
|
bool TableControl::HasRowHeader()
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return GetModel()->hasRowHeaders();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-03-19 12:54:33 +02:00
|
|
|
bool TableControl::HasColHeader()
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return GetModel()->hasColumnHeaders();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
sal_Int32 TableControl::GetAccessibleControlCount() const
|
|
|
|
{
|
2012-08-31 00:46:39 -05:00
|
|
|
// TC_TABLE is always defined, no matter whether empty or not
|
|
|
|
sal_Int32 count = 1;
|
|
|
|
if ( GetModel()->hasRowHeaders() )
|
|
|
|
++count;
|
|
|
|
if ( GetModel()->hasColumnHeaders() )
|
|
|
|
++count;
|
2011-01-11 13:26:40 +01:00
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-03-19 12:54:33 +02:00
|
|
|
bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
sal_Int32 nRow = m_pImpl->getRowAtPoint( _rPoint );
|
|
|
|
sal_Int32 nCol = m_pImpl->getColAtPoint( _rPoint );
|
|
|
|
_rnIndex = nRow * GetColumnCount() + nCol;
|
2014-03-19 12:54:33 +02:00
|
|
|
return nRow >= 0;
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
long TableControl::GetRowCount() const
|
|
|
|
{
|
|
|
|
return GetModel()->getRowCount();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
long TableControl::GetColumnCount() const
|
|
|
|
{
|
|
|
|
return GetModel()->getColumnCount();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-03-19 12:54:33 +02:00
|
|
|
bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
_rnRow = m_pImpl->getRowAtPoint( _rPoint );
|
|
|
|
_rnColPos = m_pImpl->getColAtPoint( _rPoint );
|
2014-03-19 12:54:33 +02:00
|
|
|
return _rnRow >= 0;
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 ) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2012-08-31 00:46:39 -05:00
|
|
|
if ( IsRowSelected( _nRow ) )
|
|
|
|
_rStateSet.AddState( AccessibleStateType::SELECTED );
|
|
|
|
if ( HasChildPathFocus() )
|
2011-01-11 13:26:40 +01:00
|
|
|
_rStateSet.AddState( AccessibleStateType::FOCUSED );
|
|
|
|
else // only transient when column is not focused
|
|
|
|
_rStateSet.AddState( AccessibleStateType::TRANSIENT );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
|
|
|
_rStateSet.AddState( AccessibleStateType::VISIBLE );
|
|
|
|
_rStateSet.AddState( AccessibleStateType::SHOWING );
|
|
|
|
_rStateSet.AddState( AccessibleStateType::ENABLED );
|
|
|
|
_rStateSet.AddState( AccessibleStateType::SENSITIVE );
|
|
|
|
_rStateSet.AddState( AccessibleStateType::ACTIVE );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
tools::Rectangle TableControl::GetFieldCharacterBounds(sal_Int32,sal_Int32,sal_Int32 nIndex)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return GetCharacterBounds(nIndex);
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-07-02 22:29:22 +02:00
|
|
|
sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32,sal_Int32,const Point& _rPoint)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return GetIndexForPoint(_rPoint);
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TableControl::calcHeaderRect(bool _bIsColumnBar )
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
2015-04-24 12:33:43 +02:00
|
|
|
return m_pImpl->calcHeaderRect( !_bIsColumnBar );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TableControl::calcHeaderCellRect( bool _bIsColumnBar, sal_Int32 nPos )
|
2012-08-31 00:46:39 -05:00
|
|
|
{
|
|
|
|
return m_pImpl->calcHeaderCellRect( _bIsColumnBar, nPos );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TableControl::calcTableRect()
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return m_pImpl->calcTableRect();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TableControl::calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos )
|
2012-08-31 00:46:39 -05:00
|
|
|
{
|
|
|
|
return m_pImpl->calcCellRect( _nRowPos, _nColPos );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK_NOARG(TableControl, ImplSelectHdl, LinkParamNone*, void)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
Select();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
void TableControl::Select()
|
|
|
|
{
|
2016-12-06 13:26:09 +02:00
|
|
|
ImplCallEventListenersAndHandler( VclEventId::TableRowSelect, nullptr );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
|
|
|
if ( m_pImpl->isAccessibleAlive() )
|
|
|
|
{
|
2017-05-05 13:03:43 +02:00
|
|
|
m_pImpl->commitAccessibleEvent( AccessibleEventId::SELECTION_CHANGED );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
|
|
|
m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), Any() );
|
|
|
|
// TODO: why do we notify this when the *selection* changed? Shouldn't we find a better place for this,
|
|
|
|
// actually, when the active descendant, i.e. the current cell, *really* changed?
|
|
|
|
}
|
2011-01-13 15:07:42 +01:00
|
|
|
}
|
2010-10-14 08:27:31 +02:00
|
|
|
|
2009-10-30 12:37:25 +00:00
|
|
|
}} // namespace svt::table
|
2010-10-14 08:27:31 +02:00
|
|
|
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|