25#include <com/sun/star/accessibility/AccessibleStateType.hpp>
26#include <com/sun/star/accessibility/AccessibleEventId.hpp>
34using ::com::sun::star::accessibility::XAccessible;
42 namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId;
56 const Color aWindowColor(
GetSettings().GetStyleSettings().GetFieldColor() );
100 if (
m_pImpl->isAccessibleAlive() )
102 m_pImpl->commitCellEvent( AccessibleEventId::STATE_CHANGED,
103 Any( AccessibleStateType::FOCUSED ),
109 m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
127 switch ( i_nStateChange )
129 case StateChangedType::ControlFocus:
130 m_pImpl->invalidateSelectedRows();
133 case StateChangedType::ControlBackground:
140 case StateChangedType::ControlForeground:
147 case StateChangedType::ControlFont:
179 return m_pImpl->getCurrentRow();
185 return m_pImpl->getCurrentColumn();
191 m_pImpl->goTo( _nColumn, _nRow );
197 m_pImpl->goTo( _nColPos, _nRowPos );
203 return sal_Int32(
m_pImpl->getSelectedRowCount() );
209 return m_pImpl->getSelectedRowIndex( i_selectionIndex );
215 return m_pImpl->isRowSelected( i_rowIndex );
222 "TableControl::SelectRow: invalid row index!" );
226 if ( !
m_pImpl->markRowAsSelected( i_rowIndex ) )
232 m_pImpl->markRowAsDeselected( i_rowIndex );
235 m_pImpl->invalidateRowRange( i_rowIndex, i_rowIndex );
244 if ( !
m_pImpl->markAllRowsAsSelected() )
250 if ( !
m_pImpl->markAllRowsAsDeselected() )
270 return m_pImpl->getSelEngine();
276 return m_pImpl->getDataWindow();
283 ENSURE_OR_RETURN( pParent,
"TableControl::CreateAccessible - parent not found",
nullptr );
285 return m_pImpl->getAccessible( *pParent );
291 SAL_WARN(
"svtools",
"TableControl::CreateAccessibleControl: to be overwritten!" );
303 aRetText =
"Grid control";
306 aRetText =
"Grid control";
309 aRetText =
"RowHeaderBar";
312 aRetText =
"ColumnHeaderBar";
334 OSL_FAIL(
"GridControl::GetAccessibleName: invalid enum!");
346 aRetText =
"Grid control description";
349 aRetText =
"TABLE description";
352 aRetText =
"ROWHEADERBAR description";
355 aRetText =
"COLUMNHEADERBAR description";
360 if (
GetModel()->hasColumnHeaders() )
370 aRetText =
"ROWHEADERCELL description";
373 aRetText =
"COLUMNHEADERCELL description";
383 GetModel()->getRowHeading( _nIndex ) >>= sRowName;
390 return GetModel()->getColumnModel(_nIndex)->getName();
396 return m_pImpl->getCellContentAsString( _nRowPos, _nColPos );
401 sal_Int64& rStateSet,
409 rStateSet |= AccessibleStateType::FOCUSABLE;
411 if (
m_pImpl->getSelEngine()->GetSelectionMode() == SelectionMode::Multiple )
412 rStateSet |= AccessibleStateType::MULTI_SELECTABLE;
415 rStateSet |= AccessibleStateType::FOCUSED;
418 rStateSet |= AccessibleStateType::ACTIVE;
420 if (
m_pImpl->getDataWindow().IsEnabled() )
422 rStateSet |= AccessibleStateType::ENABLED;
423 rStateSet |= AccessibleStateType::SENSITIVE;
427 rStateSet |= AccessibleStateType::VISIBLE;
430 rStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
434 rStateSet |= AccessibleStateType::VISIBLE;
435 rStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
439 rStateSet |= AccessibleStateType::VISIBLE;
440 rStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
445 rStateSet |= AccessibleStateType::FOCUSABLE;
447 rStateSet |= AccessibleStateType::FOCUSED;
448 rStateSet |= AccessibleStateType::ACTIVE;
449 rStateSet |= AccessibleStateType::TRANSIENT;
450 rStateSet |= AccessibleStateType::SELECTABLE;
451 rStateSet |= AccessibleStateType::VISIBLE;
452 rStateSet |= AccessibleStateType::SHOWING;
455 rStateSet |= AccessibleStateType::SELECTED;
460 rStateSet |= AccessibleStateType::VISIBLE;
461 rStateSet |= AccessibleStateType::TRANSIENT;
465 rStateSet |= AccessibleStateType::VISIBLE;
472 if (
m_pImpl->isAccessibleAlive() )
473 m_pImpl->commitCellEvent( i_eventID, i_newValue, i_oldValue );
478 if (
m_pImpl->isAccessibleAlive() )
479 m_pImpl->commitTableEvent( i_eventID, i_newValue, i_oldValue );
521 return GetModel()->hasColumnHeaders();
531 if (
GetModel()->hasColumnHeaders() )
539 sal_Int32 nRow =
m_pImpl->getRowAtPoint( _rPoint );
540 sal_Int32 nCol =
m_pImpl->getColAtPoint( _rPoint );
554 return GetModel()->getColumnCount();
560 _rnRow =
m_pImpl->getRowAtPoint( _rPoint );
561 _rnColPos =
m_pImpl->getColAtPoint( _rPoint );
569 _rStateSet |= AccessibleStateType::SELECTED;
571 _rStateSet |= AccessibleStateType::FOCUSED;
573 _rStateSet |= AccessibleStateType::TRANSIENT;
575 _rStateSet |= AccessibleStateType::VISIBLE;
576 _rStateSet |= AccessibleStateType::SHOWING;
577 _rStateSet |= AccessibleStateType::ENABLED;
578 _rStateSet |= AccessibleStateType::SENSITIVE;
579 _rStateSet |= AccessibleStateType::ACTIVE;
597 return m_pImpl->calcHeaderRect( !_bIsColumnBar );
603 return m_pImpl->calcHeaderCellRect( _bIsColumnBar,
nPos );
609 return m_pImpl->calcTableRect();
615 return m_pImpl->calcCellRect( _nRowPos, _nColPos );
629 if (
m_pImpl->isAccessibleAlive() )
631 m_pImpl->commitAccessibleEvent( AccessibleEventId::SELECTION_CHANGED );
633 m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
Any(),
Any() );
tools::Long GetIndexForPoint(const Point &rPoint) const
bool ImplCallEventListenersAndHandler(VclEventId nEvent, std::function< void()> const &callHandler)
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
tools::Rectangle GetCharacterBounds(tools::Long nIndex) const
virtual void dispose() override
defines a callback interface to be implemented by a concrete table control
a basic control which manages table-like data, i.e.
void SetModel(const PTableModel &_pModel)
sets a new table model
virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow, sal_Int32 _nColumnPos, const Point &_rPoint) override
virtual sal_Int32 GetSelectedRowCount() const override
virtual OUString GetAccessibleObjectName(vcl::table::AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const override
virtual bool HasColHeader() override
virtual sal_Int32 GetAccessibleControlCount() const override
virtual vcl::Window * GetAccessibleParentWindow() const override
sal_Int32 GetCurrentRow() const override
retrieves the current row
virtual void SelectAllRows(bool const i_select) override
sal_Int32 GetCurrentColumn() const override
retrieves the current column
virtual bool HasRowHeader() override
virtual tools::Rectangle calcHeaderRect(bool _bIsColumnBar) override
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 _nIndex) override
virtual bool IsRowSelected(sal_Int32 const i_rowIndex) const override
virtual tools::Rectangle calcHeaderCellRect(bool _bIsColumnBar, sal_Int32 nPos) override
virtual tools::Rectangle calcCellRect(sal_Int32 _nRowPos, sal_Int32 _nColPos) override
virtual void FillAccessibleStateSet(sal_Int64 &rStateSet, vcl::table::AccessibleTableControlObjType eObjType) const override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Creates and returns the accessible object of the whole GridControl.
virtual sal_Int32 GetColumnCount() const override
virtual OUString GetAccessibleObjectDescription(vcl::table::AccessibleTableControlObjType eObjType) const override
virtual sal_Int32 GetSelectedRowIndex(sal_Int32 const i_selectionIndex) const override
virtual sal_Int32 GetRowCount() const override
virtual OUString GetRowName(sal_Int32 _nIndex) const override
virtual void GoToCell(sal_Int32 _nColumnPos, sal_Int32 _nRow) override
virtual void FillAccessibleStateSetForCell(sal_Int64 &_rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos) const override
virtual vcl::Window * GetWindowInstance() override
virtual tools::Rectangle GetWindowExtentsAbsolute() const override
virtual void SelectRow(sal_Int32 const i_rowIndex, bool const i_select) override
virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow, sal_Int32 _nColumnPos, sal_Int32 nIndex) override
virtual void LoseFocus() override
PTableModel GetModel() const
retrieves the current table model
virtual void KeyInput(const KeyEvent &rKEvt) override
virtual tools::Rectangle calcTableRect() override
virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const override
virtual bool ConvertPointToControlIndex(sal_Int32 &_rnIndex, const Point &_rPoint) override
ITableControl & getTableControlInterface()
virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const override
SelectionEngine * getSelEngine()
after removing a row, updates the vector which contains the selected rows if the row,...
vcl::Window & getDataWindow()
virtual ~TableControl() override
void GoTo(ColPos _nColumnPos, RowPos _nRow)
activates the cell at the given position
void commitTableEventIfAccessibleAlive(sal_Int16 const i_eventID, const css::uno::Any &i_newValue, const css::uno::Any &i_oldValue)
virtual void Resize() override
virtual void GetFocus() override
virtual void dispose() override
virtual void GrabFocus() override
std::shared_ptr< TableControl_Impl > m_pImpl
void commitCellEventIfAccessibleAlive(sal_Int16 const i_eventID, const css::uno::Any &i_newValue, const css::uno::Any &i_oldValue)
virtual void StateChanged(StateChangedType i_nStateChange) override
virtual OUString GetColumnName(sal_Int32 _nIndex) const override
TableControl(vcl::Window *_pParent, WinBits _nStyle)
virtual bool ConvertPointToCellAddress(sal_Int32 &_rnRow, sal_Int32 &_rnColPos, const Point &_rPoint) override
the window containing the content area (including headers) of a table control
void SetSelectHdl(const Link< LinkParamNone *, void > &rLink)
tools::Rectangle GetWindowExtentsAbsolute() const
bool IsReallyVisible() const
void SetControlForeground()
bool HasChildPathFocus(bool bSystemWindow=false) const
bool IsControlFont() const
const Color & GetControlForeground() const
void SetControlBackground()
vcl::Window * GetAccessibleParentWindow() const
bool IsControlForeground() const
const AllSettings & GetSettings() const
virtual void KeyInput(const KeyEvent &rKEvt)
vcl::Font GetControlFont() const
::OutputDevice const * GetOutDev() const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
bool IsControlBackground() const
const Color & GetControlBackground() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
void SetCompoundControl(bool bCompound)
#define ENSURE_OR_RETURN(c, m, r)
#define ENSURE_OR_RETURN_VOID(c, m)
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
std::shared_ptr< T > make_shared(Args &&... args)
IMPL_LINK_NOARG(TableControl, ImplSelectHdl, LinkParamNone *, void)
sal_Int32 RowPos
a value denoting a row position within a table
std::shared_ptr< ITableModel > PTableModel
sal_Int32 ColPos
a value denoting a column position within a table
AccessibleTableControlObjType