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
|
|
|
|
|
|
|
#include "svtools/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;
|
2011-01-11 13:26:40 +01:00
|
|
|
//......................................................................................................................
|
2009-08-26 13:11:27 +00:00
|
|
|
namespace svt { namespace table
|
|
|
|
{
|
2011-01-11 13:26:40 +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;
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//==================================================================================================================
|
2009-08-26 13:11:27 +00:00
|
|
|
//= TableControl
|
2011-01-11 13:26:40 +01:00
|
|
|
//==================================================================================================================
|
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
TableControl::TableControl( Window* _pParent, WinBits _nStyle )
|
|
|
|
: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
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
TableControl::~TableControl()
|
|
|
|
{
|
2010-03-22 11:17:10 +01:00
|
|
|
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
|
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();
|
2009-08-26 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::GetFocus()
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) )
|
|
|
|
Control::GetFocus();
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::LoseFocus()
|
|
|
|
{
|
|
|
|
if ( !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) )
|
|
|
|
Control::LoseFocus();
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
|
|
|
|
|
2011-01-11 13:26:40 +01: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 )
|
|
|
|
{
|
2012-08-20 21:21:22 -05:00
|
|
|
case STATE_CHANGE_CONTROL_FOCUS:
|
|
|
|
m_pImpl->invalidateSelectedRows();
|
|
|
|
break;
|
|
|
|
|
2010-05-05 10:46:06 +02:00
|
|
|
case STATE_CHANGE_CONTROLBACKGROUND:
|
|
|
|
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;
|
|
|
|
|
|
|
|
case STATE_CHANGE_CONTROLFOREGROUND:
|
|
|
|
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;
|
|
|
|
|
|
|
|
case STATE_CHANGE_CONTROLFONT:
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::Resize()
|
|
|
|
{
|
|
|
|
Control::Resize();
|
|
|
|
m_pImpl->onResize();
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
void TableControl::SetModel( PTableModel _pModel )
|
|
|
|
{
|
|
|
|
m_pImpl->setModel( _pModel );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
PTableModel TableControl::GetModel() const
|
|
|
|
{
|
|
|
|
return m_pImpl->getModel();
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
}
|
|
|
|
|
2012-09-03 19:05:27 -05:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
|
|
|
bool TableControl::GoTo( ColPos _nColumn, RowPos _nRow )
|
|
|
|
{
|
|
|
|
return m_pImpl->goTo( _nColumn, _nRow );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-10-30 12:37:25 +00:00
|
|
|
sal_Bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos)
|
|
|
|
{
|
|
|
|
return m_pImpl->goTo( _nColPos, _nRowPos );
|
|
|
|
}
|
2011-01-11 13:26:40 +01:00
|
|
|
|
2011-01-14 11:04:24 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Int32 TableControl::GetSelectedRowCount() const
|
|
|
|
{
|
|
|
|
return sal_Int32( m_pImpl->getSelectedRowCount() );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-08-26 13:11:27 +00:00
|
|
|
SelectionEngine* TableControl::getSelEngine()
|
|
|
|
{
|
|
|
|
return m_pImpl->getSelEngine();
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2011-01-14 11:44:35 +01:00
|
|
|
Window& TableControl::getDataWindow()
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
|
|
|
return m_pImpl->getDataWindow();
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-10-30 12:37:25 +00:00
|
|
|
Reference< XAccessible > TableControl::CreateAccessible()
|
|
|
|
{
|
|
|
|
Window* pParent = GetAccessibleParentWindow();
|
2011-01-13 15:07:42 +01:00
|
|
|
ENSURE_OR_RETURN( pParent, "TableControl::CreateAccessible - parent not found", NULL );
|
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
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------------------------------------------
|
2009-10-30 12:37:25 +00:00
|
|
|
Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex )
|
|
|
|
{
|
|
|
|
(void)_nIndex;
|
2014-01-28 19:57:30 +01:00
|
|
|
DBG_ASSERT( false, "TableControl::CreateAccessibleControl: to be overwritten!" );
|
2009-10-30 12:37:25 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2011-01-13 15:07:42 +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:
|
2013-11-15 11:05:19 +02:00
|
|
|
aRetText = "Grid conrol";
|
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:
|
2012-08-31 00:46:39 -05:00
|
|
|
//the name of the cell constists 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(_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;
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) 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
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
(void)_nRow;
|
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
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
(void)_nColumn;
|
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
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos ) const
|
|
|
|
{
|
|
|
|
Any aCellContent;
|
|
|
|
GetModel()->getCellContent( _nColPos, _nRowPos, aCellContent );
|
|
|
|
return aCellContent;
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +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
|
|
|
|
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
|
|
|
|
|
|
|
if ( m_pImpl->getSelEngine()->GetSelectionMode() == MULTIPLE_SELECTION )
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
|
|
|
|
{
|
|
|
|
return Control::GetWindowExtentsRelative( pRelativeWindow );
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
void TableControl::GrabFocus()
|
|
|
|
{
|
|
|
|
Control::GrabFocus();
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2011-02-14 23:00:48 +01:00
|
|
|
Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate )
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
return Control::GetAccessible( bCreate );
|
|
|
|
}
|
2009-10-30 12:37:25 +00:00
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Window* TableControl::GetAccessibleParentWindow() const
|
|
|
|
{
|
|
|
|
return Control::GetAccessibleParentWindow();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Window* TableControl::GetWindowInstance()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Bool TableControl::HasRowHeader()
|
|
|
|
{
|
|
|
|
return GetModel()->hasRowHeaders();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Bool TableControl::HasColHeader()
|
|
|
|
{
|
|
|
|
return GetModel()->hasColumnHeaders();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
|
|
|
|
{
|
|
|
|
sal_Int32 nRow = m_pImpl->getRowAtPoint( _rPoint );
|
|
|
|
sal_Int32 nCol = m_pImpl->getColAtPoint( _rPoint );
|
|
|
|
_rnIndex = nRow * GetColumnCount() + nCol;
|
|
|
|
return nRow >= 0 ? sal_True : sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
long TableControl::GetRowCount() const
|
|
|
|
{
|
|
|
|
return GetModel()->getRowCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
long TableControl::GetColumnCount() const
|
|
|
|
{
|
|
|
|
return GetModel()->getColumnCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Bool TableControl::HasRowHeader() const
|
|
|
|
{
|
|
|
|
return GetModel()->hasRowHeaders();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
|
|
|
|
{
|
|
|
|
_rnRow = m_pImpl->getRowAtPoint( _rPoint );
|
|
|
|
_rnColPos = m_pImpl->getColAtPoint( _rPoint );
|
|
|
|
return _rnRow >= 0 ? sal_True : sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
|
|
|
|
{
|
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 );
|
|
|
|
|
|
|
|
(void)_nColumnPos;
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
|
|
|
|
{
|
|
|
|
(void)_nRow;
|
|
|
|
(void)_nColumnPos;
|
|
|
|
return GetCharacterBounds(nIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
|
|
|
|
{
|
|
|
|
(void)_nRow;
|
|
|
|
(void)_nColumnPos;
|
|
|
|
return GetIndexForPoint(_rPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2011-02-14 23:00:48 +01:00
|
|
|
Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
(void)_bOnScreen;
|
2011-01-19 11:11:29 +01:00
|
|
|
return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true );
|
2011-01-11 13:26:40 +01:00
|
|
|
}
|
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Rectangle TableControl::calcHeaderCellRect( sal_Bool _bIsColumnBar, sal_Int32 nPos )
|
|
|
|
{
|
|
|
|
return m_pImpl->calcHeaderCellRect( _bIsColumnBar, nPos );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2011-02-14 23:00:48 +01:00
|
|
|
Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
(void)_bOnScreen;
|
|
|
|
return m_pImpl->calcTableRect();
|
|
|
|
}
|
|
|
|
|
2012-08-31 00:46:39 -05:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
Rectangle TableControl::calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos )
|
|
|
|
{
|
|
|
|
return m_pImpl->calcCellRect( _nRowPos, _nColPos );
|
|
|
|
}
|
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(TableControl, ImplSelectHdl)
|
2011-01-11 13:26:40 +01:00
|
|
|
{
|
|
|
|
Select();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
void TableControl::Select()
|
|
|
|
{
|
2011-01-13 15:07:42 +01:00
|
|
|
ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this );
|
2012-08-31 00:46:39 -05:00
|
|
|
|
|
|
|
if ( m_pImpl->isAccessibleAlive() )
|
|
|
|
{
|
|
|
|
m_pImpl->commitAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
|
|
|
|
|
|
|
|
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
|
|
|
|
2011-01-11 13:26:40 +01:00
|
|
|
//......................................................................................................................
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|