summaryrefslogtreecommitdiff
path: root/toolkit/inc
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/inc')
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControl.hxx128
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlBase.hxx206
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlHeader.hxx153
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx62
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlTable.hxx158
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlTableBase.hxx157
-rw-r--r--toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx127
-rw-r--r--toolkit/inc/controls/table/defaultinputhandler.hxx23
-rw-r--r--toolkit/inc/controls/table/tablecontrol.hxx99
-rw-r--r--toolkit/inc/controls/table/tablecontrolinterface.hxx14
-rw-r--r--toolkit/inc/controls/table/tableinputhandler.hxx63
-rw-r--r--toolkit/inc/controls/table/tablemodel.hxx2
-rw-r--r--toolkit/inc/helper/btndlg.hxx2
13 files changed, 1058 insertions, 136 deletions
diff --git a/toolkit/inc/controls/table/AccessibleGridControl.hxx b/toolkit/inc/controls/table/AccessibleGridControl.hxx
new file mode 100644
index 000000000000..47bbd611e0f0
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControl.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include "AccessibleGridControlBase.hxx"
+#include "AccessibleGridControlTable.hxx"
+#include "tablecontrol.hxx"
+
+#include <cppuhelper/weakref.hxx>
+#include <rtl/ref.hxx>
+
+namespace accessibility {
+
+ class AccessibleGridControlHeader;
+
+
+/** This class represents the complete accessible Grid Control object. */
+ class AccessibleGridControl final : public AccessibleGridControlBase
+{
+ virtual ~AccessibleGridControl() override = default;
+
+ /** Cleans up members. */
+ using AccessibleGridControlBase::disposing;
+ virtual void SAL_CALL disposing() override;
+
+ // XAccessibleContext -----------------------------------------------------
+
+ /** @return The count of visible children. */
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
+
+ /** @return The XAccessible interface of the specified child. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** @return The role of this object (a table). */
+ virtual sal_Int16 SAL_CALL getAccessibleRole() override;
+
+ // XAccessibleComponent ---------------------------------------------------
+
+ /** @return
+ The accessible child rendered under the given point.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
+
+ /** Grabs the focus to the Grid Control. */
+ virtual void SAL_CALL grabFocus() override;
+
+ // XServiceInfo -----------------------------------------------------------
+
+ /** @return
+ The name of this class.
+ */
+ virtual OUString SAL_CALL getImplementationName() override;
+
+public:
+ AccessibleGridControl(
+ const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
+ svt::table::TableControl& _rTable);
+
+ // helper functions
+
+ /** commitCellEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitCellEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
+
+ /** commitTableEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitTableEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
+
+private:
+ // internal virtual methods -----------------------------------------------
+
+ /** @attention This method requires locked mutex's and a living object.
+ @return The bounding box (VCL rect.) in screen coordinates. */
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
+
+ // internal helper methods ------------------------------------------------
+
+ /** The data table child. */
+ rtl::Reference<AccessibleGridControlTable> m_xTable;
+
+ /** The header bar for rows. */
+ rtl::Reference<AccessibleGridControlHeader> m_xRowHeaderBar;
+
+ /** The header bar for columns (first row of the table). */
+ rtl::Reference<AccessibleGridControlHeader> m_xColumnHeaderBar;
+
+ /** @return The count of visible children. */
+ inline sal_Int64 implGetAccessibleChildCount();
+};
+
+} // namespace accessibility
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlBase.hxx b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx
new file mode 100644
index 000000000000..f2f7a2785f84
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx
@@ -0,0 +1,206 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#pragma once
+
+#include <controls/table/tablecontrol.hxx>
+
+#include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
+#include <tools/gen.hxx>
+#include <cppuhelper/compbase.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <comphelper/accessibleeventnotifier.hxx>
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <comphelper/uno3.hxx>
+
+
+namespace vcl { class Window; }
+
+
+namespace accessibility {
+
+/** The GridControl accessible objects inherit from this base class. It
+ implements basic functionality. */
+class AccessibleGridControlBase
+ : public cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,
+ css::accessibility::XAccessible, css::lang::XServiceInfo>
+{
+public:
+ /** Constructor.
+ @param rxParent XAccessible interface of the parent object.
+ @param rTable The Table control.
+ @param eObjType Type of accessible table control. */
+ AccessibleGridControlBase(
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
+ svt::table::TableControl& rTable,
+ AccessibleTableControlObjType eObjType);
+
+protected:
+ virtual ~AccessibleGridControlBase() = default;
+ virtual void SAL_CALL disposing() override;
+
+public:
+ // XAccessible
+ /** @return The XAccessibleContext interface of this object. */
+ virtual css::uno::Reference<css::accessibility::XAccessibleContext> SAL_CALL
+ getAccessibleContext() override;
+
+ // XAccessibleContext
+
+ /** @return A reference to the parent accessible object. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleParent() override;
+
+ /** @return
+ The description of this object.
+ */
+ virtual OUString SAL_CALL getAccessibleDescription() override;
+
+ /** @return
+ The name of this object.
+ */
+ virtual OUString SAL_CALL getAccessibleName() override;
+
+ /** @return
+ The relation set (the GridControl does not have one).
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL
+ getAccessibleRelationSet() override;
+
+ /** @return The set of current states. */
+ virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
+
+ /** @return The parent's locale. */
+ virtual css::lang::Locale SAL_CALL getLocale() override;
+
+ /** @return
+ The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported.
+ */
+ virtual sal_Int16 SAL_CALL getAccessibleRole() override;
+
+ /* Derived classes have to implement:
+ - getAccessibleChildCount,
+ - getAccessibleChild,
+ - getAccessibleRole.
+ Derived classes may overwrite getAccessibleIndexInParent to increase
+ performance. */
+
+ // XAccessibleComponent
+ virtual sal_Int32 SAL_CALL getForeground( ) override;
+ virtual sal_Int32 SAL_CALL getBackground( ) override;
+
+
+ /* Derived classes have to implement:
+ - getAccessibleAt,
+ - grabFocus. */
+
+ /** @return
+ The accessible child rendered under the given point.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
+
+ // XTypeProvider
+
+ /** @return a unique implementation ID. */
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+
+ // XServiceInfo
+
+ /** @return Whether the specified service is supported by this class. */
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
+
+ /** @return a list of all supported services. */
+ virtual css::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames() override;
+
+ /* Derived classes have to implement:
+ - getImplementationName. */
+
+ // helper methods
+
+ /** @return The GridControl object type. */
+ inline AccessibleTableControlObjType getType() const;
+
+ /** Commits an event to all listeners. */
+ virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
+
+protected:
+ virtual css::awt::Rectangle implGetBounds() override;
+
+ // internal virtual methods
+
+ /** Determines whether the Grid control is really showing inside of
+ its parent accessible window. Derived classes may implement different
+ behaviour.
+ @attention This method requires locked mutex's and a living object.
+ @return TRUE, if the object is really showing. */
+ bool implIsShowing();
+
+ /** Return the bounding box relative to the parent.
+ @attention This method requires locked mutex's and a living object.
+ @return The bounding box (VCL rect.) relative to the parent. */
+ tools::Rectangle implGetBoundingBox();
+
+ ///** Derived classes return the bounding box in screen coordinates.
+ // @attention This method requires locked mutex's and a living object.
+ // @return The bounding box (VCL rect.) in screen coordinates. */
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() = 0;
+
+ /** Creates a bitset of states of the
+ current object. This method calls FillStateSet at the GridControl which
+ fills it with more states depending on the object type. Derived classes
+ may overwrite this method and add more states.
+ @attention This method requires locked mutex's.
+ */
+ virtual sal_Int64 implCreateStateSet();
+
+protected:
+ // members
+
+ /** The parent accessible object. */
+ css::uno::Reference< css::accessibility::XAccessible > m_xParent;
+ /** The SVT Table control. */
+ svt::table::TableControl& m_aTable;
+ /** The type of this object (for names, descriptions, state sets, ...). */
+ AccessibleTableControlObjType m_eObjType;
+};
+
+// inlines
+
+inline AccessibleTableControlObjType AccessibleGridControlBase::getType() const
+{
+ return m_eObjType;
+}
+
+
+} // namespace accessibility
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx b/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx
new file mode 100644
index 000000000000..f4fa9c20fe37
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#pragma once
+
+#include <controls/table/AccessibleGridControlTableBase.hxx>
+#include <controls/table/tablecontrol.hxx>
+
+namespace accessibility {
+
+/** This class represents the accessible object of a header bar of a Grid Control
+ (row or column header bar). This object supports the
+ XAccessibleSelection interface. Selecting a child of this object selects
+ complete rows or columns of the data table. */
+class AccessibleGridControlHeader final : public AccessibleGridControlTableBase
+{
+public:
+ /** @param rxParent accessible parent control
+ @param rTable accessible table
+ @param eObjType One of the two allowed types AccessibleTableControlObjType::ROWHEADERBAR or
+ AccessibleTableControlObjType::COLUMNHEADERBAR. */
+ AccessibleGridControlHeader(
+ const css::uno::Reference<
+ css::accessibility::XAccessible >& rxParent,
+ svt::table::TableControl& rTable,
+ AccessibleTableControlObjType eObjType);
+
+private:
+ virtual ~AccessibleGridControlHeader() override = default;
+
+public:
+ // XAccessibleContext
+
+ /** @return
+ The XAccessible interface of the specified child.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** @return The index of this object among the parent's children. */
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
+
+ // XAccessibleComponent
+
+ /** @return The accessible child rendered under the given point. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
+
+ /** Grabs the focus to (the current cell of) the data table. */
+ virtual void SAL_CALL grabFocus() override;
+
+ // XAccessibleTable
+
+ /** @return The description text of the specified row. */
+ virtual OUString SAL_CALL
+ getAccessibleRowDescription( sal_Int32 nRow ) override;
+
+ /** @return The description text of the specified column. */
+ virtual OUString SAL_CALL
+ getAccessibleColumnDescription( sal_Int32 nColumn ) override;
+
+ /** @return The XAccessibleTable interface of the row header bar. */
+ virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
+ getAccessibleRowHeaders() override;
+
+ /** @return The XAccessibleTable interface of the column header bar. */
+ virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
+ getAccessibleColumnHeaders() override;
+
+ /** @return An index list of completely selected rows. */
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL
+ getSelectedAccessibleRows() override;
+
+ /** @return An index list of completely selected columns. */
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL
+ getSelectedAccessibleColumns() override;
+
+ /** @return TRUE, if the specified row is completely selected. */
+ virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
+
+ /** @return TRUE, if the specified column is completely selected. */
+ virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
+
+ /** @return The XAccessible interface of the cell object at the specified
+ cell position. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ /** @return TRUE, if the specified cell is selected. */
+ virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ // XServiceInfo
+
+ /** @return The name of this class. */
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ /** @return a unique implementation ID. */
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+
+private:
+ /** Returns the specified row or column. Uses one of the parameters,
+ depending on object type.
+ @attention This method requires locked mutex's and a living object.
+ @return The XAccessible interface of the specified column/row. */
+ css::uno::Reference< css::accessibility::XAccessible >
+ implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos );
+ /** @attention This method requires locked mutex's and a living object.
+ @return The bounding box (VCL rect.) in screen coordinates. */
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
+
+ // internal helper methods
+
+ /** @return TRUE, if the objects is a header bar for rows. */
+ inline bool isRowBar() const;
+ /** @return TRUE, if the objects is a header bar for columns. */
+ inline bool isColumnBar() const;
+};
+
+// inlines
+
+inline bool AccessibleGridControlHeader::isRowBar() const
+{
+ return getType() == AccessibleTableControlObjType::ROWHEADERBAR;
+}
+
+inline bool AccessibleGridControlHeader::isColumnBar() const
+{
+ return getType() == AccessibleTableControlObjType::COLUMNHEADERBAR;
+}
+
+
+} // namespace accessibility
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx b/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx
new file mode 100644
index 000000000000..25e6c3dd06ca
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include <controls/table/AccessibleGridControlTableCell.hxx>
+#include <controls/table/tablecontrol.hxx>
+
+namespace accessibility
+{
+ class AccessibleGridControlHeaderCell final : public AccessibleGridControlCell
+ {
+ sal_Int32 m_nColumnRowId;
+ public:
+ AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId,
+ const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ svt::table::TableControl& _rTable,
+ AccessibleTableControlObjType _eObjType);
+ /** @return The count of visible children. */
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
+
+ /** @return The XAccessible interface of the specified child. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** @return The index of this object among the parent's children. */
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
+
+ /** Grabs the focus to the GridControl. */
+ virtual void SAL_CALL grabFocus() override;
+
+ /** @return
+ The name of this class.
+ */
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ /** Return a bitset of states of the current object.
+ */
+ sal_Int64 implCreateStateSet() override;
+
+ private:
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
+ };
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlTable.hxx b/toolkit/inc/controls/table/AccessibleGridControlTable.hxx
new file mode 100644
index 000000000000..e9e29fc40e89
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlTable.hxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#pragma once
+
+#include <controls/table/AccessibleGridControlTableBase.hxx>
+#include <controls/table/AccessibleGridControlTableCell.hxx>
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+
+
+namespace accessibility {
+
+/** This class represents the accessible object of the data table of a
+ Grid control. */
+class AccessibleGridControlTable final
+ : public cppu::ImplInheritanceHelper<AccessibleGridControlTableBase,
+ css::accessibility::XAccessibleSelection>
+{
+public:
+ AccessibleGridControlTable(
+ const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ svt::table::TableControl& rTable);
+
+private:
+ virtual ~AccessibleGridControlTable() override = default;
+ std::vector< rtl::Reference<AccessibleGridControlTableCell> > m_aCellVector;
+public:
+ // XAccessibleContext
+
+ /** @return The XAccessible interface of the specified child. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** @return The index of this object among the parent's children. */
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
+
+ // XAccessibleComponent
+
+ /** @return The accessible child rendered under the given point. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
+
+ /** Grabs the focus to (the current cell of) the data table. */
+ virtual void SAL_CALL grabFocus() override;
+
+ // XAccessibleTable
+
+ /** @return The description text of the specified row. */
+ virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
+
+ /** @return The description text of the specified column. */
+ virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
+
+ /** @return The XAccessibleTable interface of the row header bar. */
+ virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
+ getAccessibleRowHeaders() override;
+
+ /** @return The XAccessibleTable interface of the column header bar. */
+ virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
+ getAccessibleColumnHeaders() override;
+
+ /** @return An index list of completely selected rows. */
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL
+ getSelectedAccessibleRows() override;
+
+ /** @return An index list of completely selected columns. */
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL
+ getSelectedAccessibleColumns() override;
+
+ /** @return TRUE, if the specified row is completely selected. */
+ virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
+
+ /** @return TRUE, if the specified column is completely selected. */
+ virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
+
+ /** @return The XAccessible interface of the cell object at the specified
+ cell position. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ /** @return TRUE, if the specified cell is selected. */
+ virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ // XAccessibleSelection
+
+ /** Selects the specified child (row or column of the table). */
+ virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** @return TRUE, if the specified child (row/column) is selected. */
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
+
+ /** Clears the complete selection. */
+ virtual void SAL_CALL clearAccessibleSelection() override;
+
+ /** Selects all children or first, if multiselection is not supported. */
+ virtual void SAL_CALL selectAllAccessibleChildren() override;
+
+ /** @return The number of selected rows/columns. */
+ virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override;
+
+ /** @return The specified selected row/column. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
+
+ /** Removes the specified row/column from the selection. */
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
+
+ // XServiceInfo
+
+ /** @return The name of this class. */
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() override;
+
+ virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue) override;
+
+private:
+ // internal virtual methods
+
+ ///** @attention This method requires locked mutex's and a living object.
+ // @return The bounding box (VCL rect.) in screen coordinates. */
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
+
+ //// internal helper methods
+ ///** @attention This method requires a locked mutex.
+ // @return The XAccessibleTable interface of the specified header bar. */
+ /// @throws css::uno::RuntimeException
+ css::uno::Reference< css::accessibility::XAccessibleTable >
+ implGetHeaderBar( sal_Int32 nChildIndex );
+};
+
+
+} // namespace accessibility
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlTableBase.hxx b/toolkit/inc/controls/table/AccessibleGridControlTableBase.hxx
new file mode 100644
index 000000000000..6c12bde959e4
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlTableBase.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#pragma once
+
+#include <controls/table/AccessibleGridControlBase.hxx>
+#include <controls/table/tablecontrol.hxx>
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+
+
+namespace accessibility {
+
+typedef cppu::ImplInheritanceHelper<AccessibleGridControlBase, css::accessibility::XAccessibleTable>
+ AccessibleGridControlTableImplHelper;
+
+/** The Grid Control accessible table objects inherit from this base class. It
+ implements basic functionality for the XAccessibleTable interface.
+ Grid COntrol table objects are: the data table, the column header bar and the
+ row header bar. */
+class AccessibleGridControlTableBase :
+ public AccessibleGridControlTableImplHelper
+{
+public:
+ /** Constructor sets specified name and description.
+ @param rxParent XAccessible interface of the parent object.
+ @param rTable The Table control.
+ @param eObjType Type of table control object */
+ AccessibleGridControlTableBase(
+ const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ svt::table::TableControl& rTable,
+ AccessibleTableControlObjType eObjType);
+
+protected:
+ virtual ~AccessibleGridControlTableBase() override = default;
+
+public:
+ // XAccessibleContext
+
+ /** @return The count of visible children. */
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
+
+ /** @return The role of this object (a table). */
+ virtual sal_Int16 SAL_CALL getAccessibleRole() override;
+
+ /* Derived classes have to implement:
+ - getAccessibleChild,
+ - getAccessibleIndexInParent. */
+
+ // XAccessibleComponent
+
+ /* Derived classes have to implement:
+ - getAccessibleAt,
+ - grabFocus. */
+
+ // XAccessibleTable
+
+ /** @return The number of used rows in the table (0 = empty table). */
+ virtual sal_Int32 SAL_CALL getAccessibleRowCount() override;
+
+ /** @return The number of used columns in the table (0 = empty table). */
+ virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override;
+
+ /** @return The row extent of the specified cell (always 1). */
+ virtual sal_Int32 SAL_CALL
+ getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ /** @return The column extent of the specified cell (always 1). */
+ virtual sal_Int32 SAL_CALL
+ getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ /** @return The caption cell of the table (not supported). */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleCaption() override;
+
+ /** @return The summary object of the table (not supported). */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleSummary() override;
+
+ /** @return The child index of the specified cell. */
+ virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
+
+ /** @return The row index of the specified child cell. */
+ virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override;
+
+ /** @return The column index of the specified child cell. */
+ virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override;
+
+ /* Derived classes have to implement:
+ - getAccessibleRowDescription,
+ - getAccessibleColumnDescription,
+ - getAccessibleRowHeaders,
+ - getAccessibleColumnHeaders,
+ - getSelectedAccessibleRows,
+ - getSelectedAccessibleColumns,
+ - isAccessibleRowSelected,
+ - isAccessibleColumnSelected,
+ - getAccessibleCellAt,
+ - isAccessibleSelected. */
+
+protected:
+ // internal helper methods
+
+ /** @attention This method requires locked mutex's and a living object.
+ @return The row index of the specified cell index. */
+ sal_Int32 implGetRow( sal_Int64 nChildIndex );
+ /** @attention This method requires locked mutex's and a living object.
+ @return The column index of the specified cell index. */
+ sal_Int32 implGetColumn( sal_Int64 nChildIndex );
+
+ /** Fills a sequence with sorted indexes of completely selected rows.
+ @attention This method requires locked mutex's and a living object.
+ @param rSeq Out-parameter that takes the sorted row index list. */
+ void implGetSelectedRows( css::uno::Sequence< sal_Int32 >& rSeq );
+
+ /** @attention This method requires locked mutex's and a living object.
+ @throws <type>IndexOutOfBoundsException</type>
+ If the specified row index is invalid. */
+ void ensureIsValidRow( sal_Int32 nRow );
+ /** @attention This method requires locked mutex's and a living object.
+ @throws <type>IndexOutOfBoundsException</type>
+ If the specified column index is invalid. */
+ void ensureIsValidColumn( sal_Int32 nColumn );
+ /** @attention This method requires locked mutex's and a living object.
+ @throws <type>IndexOutOfBoundsException</type>
+ If the specified cell address is invalid. */
+ void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn );
+ /** @attention This method requires locked mutex's and a living object.
+ @throws <type>IndexOutOfBoundsException</type>
+ If the specified child index is invalid. */
+ void ensureIsValidIndex( sal_Int64 nChildIndex );
+};
+
+
+} // namespace accessibility
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx b/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx
new file mode 100644
index 000000000000..6c31f6729274
--- /dev/null
+++ b/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include <controls/table/AccessibleGridControlBase.hxx>
+#include <controls/table/tablecontrol.hxx>
+
+#include <comphelper/accessibletexthelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
+
+namespace accessibility
+{
+ class AccessibleGridControlCell : public AccessibleGridControlBase
+ {
+ private:
+ sal_Int32 m_nRowPos; // the row number of the table cell
+ sal_Int32 m_nColPos; // the column id of the table cell
+
+ protected:
+ // attribute access
+ sal_Int32 getRowPos( ) const { return m_nRowPos; }
+ sal_Int32 getColumnPos( ) const { return m_nColPos; }
+
+ // XAccessibleComponent
+ virtual void SAL_CALL grabFocus() override;
+
+ public:
+ // XAccessibleContext
+ virtual OUString SAL_CALL getAccessibleName() override;
+
+ protected:
+ AccessibleGridControlCell(
+ const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
+ svt::table::TableControl& _rTable,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos,
+ AccessibleTableControlObjType _eType
+ );
+
+ virtual ~AccessibleGridControlCell() override = default;
+
+ private:
+ AccessibleGridControlCell( const AccessibleGridControlCell& ) = delete;
+ AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ) = delete;
+ };
+
+ // implementation of a table cell of GridControl
+ class AccessibleGridControlTableCell final
+ : public cppu::ImplInheritanceHelper<AccessibleGridControlCell, css::accessibility::XAccessibleText>,
+ public ::comphelper::OCommonAccessibleText
+ {
+ private:
+ // OCommonAccessibleText
+ virtual OUString implGetText() override;
+ virtual css::lang::Locale implGetLocale() override;
+ virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final;
+ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
+
+ public:
+ AccessibleGridControlTableCell( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
+ svt::table::TableControl& _rTable,
+ sal_Int32 _nRowId,
+ sal_uInt16 _nColId);
+
+ /** @return The index of this object among the parent's children. */
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
+
+ /** @return
+ The name of this class.
+ */
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ /** @return
+ The count of visible children.
+ */
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
+
+ /** @return
+ The XAccessible interface of the specified child.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ /** Return a bitset of states of the current object.
+ */
+ sal_Int64 implCreateStateSet() override;
+
+ // XAccessibleText
+ virtual sal_Int32 SAL_CALL getCaretPosition() override;
+ virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
+ virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
+ virtual sal_Int32 SAL_CALL getCharacterCount() override;
+ virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
+ virtual OUString SAL_CALL getSelectedText() override;
+ virtual sal_Int32 SAL_CALL getSelectionStart() override;
+ virtual sal_Int32 SAL_CALL getSelectionEnd() override;
+ virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual OUString SAL_CALL getText() override;
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override;
+ };
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/defaultinputhandler.hxx b/toolkit/inc/controls/table/defaultinputhandler.hxx
index 3f3d425a69cb..40acc4a7a809 100644
--- a/toolkit/inc/controls/table/defaultinputhandler.hxx
+++ b/toolkit/inc/controls/table/defaultinputhandler.hxx
@@ -20,26 +20,30 @@
#pragma once
#include <controls/table/mousefunction.hxx>
-#include <controls/table/tableinputhandler.hxx>
#include <rtl/ref.hxx>
+#include <memory>
#include <vector>
+class KeyEvent;
+class MouseEvent;
+
namespace svt::table
{
- class DefaultInputHandler final : public ITableInputHandler
+ class DefaultInputHandler final
{
public:
DefaultInputHandler();
- virtual ~DefaultInputHandler() override;
+ ~DefaultInputHandler();
- virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
- virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
- virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
- virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) override;
- virtual bool GetFocus ( ITableControl& _rControl ) override;
- virtual bool LoseFocus ( ITableControl& _rControl ) override;
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by this class (<FALSE/>).
+ bool MouseMove(ITableControl& _rControl, const MouseEvent& rMEvt);
+ bool MouseButtonDown(ITableControl& _rControl, const MouseEvent& rMEvt);
+ bool MouseButtonUp(ITableControl& _rControl, const MouseEvent& rMEvt);
private:
bool delegateMouseEvent( ITableControl& i_control, const MouseEvent& i_event,
@@ -49,6 +53,7 @@ namespace svt::table
std::vector< rtl::Reference< MouseFunction > > aMouseFunctions;
};
+ typedef std::shared_ptr<DefaultInputHandler> PTableInputHandler;
} // namespace svt::table
diff --git a/toolkit/inc/controls/table/tablecontrol.hxx b/toolkit/inc/controls/table/tablecontrol.hxx
index 9d9f98ff11e3..af5b1e2d9d1f 100644
--- a/toolkit/inc/controls/table/tablecontrol.hxx
+++ b/toolkit/inc/controls/table/tablecontrol.hxx
@@ -19,19 +19,29 @@
#pragma once
+#include <controls/table/tablecontrolinterface.hxx>
#include <controls/table/tablemodel.hxx>
-#include <vcl/accessibletable.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/seleng.hxx>
#include <memory>
+enum class AccessibleTableControlObjType
+{
+ GRIDCONTROL, /// The GridControl itself.
+ TABLE, /// The data table.
+ ROWHEADERBAR, /// The row header bar.
+ COLUMNHEADERBAR, /// The horizontal column header bar.
+ TABLECELL, /// A cell of the data table.
+ ROWHEADERCELL, /// A cell of the row header bar.
+ COLUMNHEADERCELL, /// A cell of the column header bar.
+};
+
namespace svt::table
{
class TableControl_Impl;
-
//= TableControl
/** a basic control which manages table-like data, i.e. a number of cells
@@ -48,9 +58,8 @@ namespace svt::table
The control supports the concept of a <em>current</em> (or <em>active</em>
cell).
- The control supports accessibility, this is encapsulated in IAccessibleTable
*/
- class TableControl final : public Control, public vcl::table::IAccessibleTable
+ class TableControl final : public Control
{
private:
std::shared_ptr<TableControl_Impl> m_pImpl;
@@ -75,10 +84,7 @@ namespace svt::table
if there is no active cell, e.g. because the table does
not contain any rows or columns.
*/
- sal_Int32 GetCurrentRow() const override;
-
- ITableControl&
- getTableControlInterface();
+ sal_Int32 GetCurrentRow() const;
/** retrieves the current column
@@ -89,7 +95,7 @@ namespace svt::table
if there is no active cell, e.g. because the table does
not contain any rows or columns.
*/
- sal_Int32 GetCurrentColumn() const override;
+ sal_Int32 GetCurrentColumn() const;
/** activates the cell at the given position
*/
@@ -112,51 +118,46 @@ namespace svt::table
/** Creates and returns the accessible object of the whole GridControl. */
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
- virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) override;
- virtual OUString GetAccessibleObjectName(vcl::table::AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const override;
- virtual void GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow ) override;
- virtual OUString GetAccessibleObjectDescription(vcl::table::AccessibleTableControlObjType eObjType) const override;
- virtual void FillAccessibleStateSet( sal_Int64& rStateSet, vcl::table::AccessibleTableControlObjType eObjType ) const override;
+ OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType,
+ sal_Int32 _nRow, sal_Int32 _nCol) const;
+ void GoToCell(sal_Int32 _nColumnPos, sal_Int32 _nRow);
+ OUString
+ GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType) const;
+ void FillAccessibleStateSet(sal_Int64& rStateSet,
+ AccessibleTableControlObjType eObjType) const;
// temporary methods
// Those do not really belong into the public API - they're intended for firing A11Y-related events. However,
// firing those events should be an implementation internal to the TableControl resp. TableControl_Impl,
// instead of something triggered externally.
- void commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
- void commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
-
-
- // IAccessibleTable
- virtual AbsoluteScreenPixelRectangle GetWindowExtentsAbsolute() const override;
- virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window& rRelativeWindow) const override;
- virtual void GrabFocus() override;
- virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override;
- virtual vcl::Window* GetAccessibleParentWindow() const override;
- virtual vcl::Window* GetWindowInstance() override;
- virtual sal_Int32 GetAccessibleControlCount() const override;
- virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) override;
- virtual sal_Int32 GetRowCount() const override;
- virtual sal_Int32 GetColumnCount() const override;
- virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint ) override;
- virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) override;
- virtual tools::Rectangle calcHeaderCellRect( bool _bIsColumnBar, sal_Int32 nPos) override;
- virtual tools::Rectangle calcTableRect() override;
- virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) override;
- virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override;
- virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override;
- virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const override;
- virtual OUString GetRowName(sal_Int32 _nIndex) const override;
- virtual OUString GetColumnName( sal_Int32 _nIndex ) const override;
- virtual bool HasRowHeader() override;
- virtual bool HasColHeader() override;
- virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const override;
-
- virtual sal_Int32 GetSelectedRowCount() const override;
- virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const override;
- virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const override;
- virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) override;
- virtual void SelectAllRows( bool const i_select ) override;
-
+ void commitCellEvent(sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue);
+ void commitTableEvent(sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue);
+
+ sal_Int32 GetAccessibleControlCount() const;
+ sal_Int32 GetRowCount() const;
+ sal_Int32 GetColumnCount() const;
+ bool ConvertPointToCellAddress(sal_Int32& _rnRow, sal_Int32& _rnColPos,
+ const Point& _rPoint);
+ tools::Rectangle calcHeaderRect(bool _bIsColumnBar);
+ tools::Rectangle calcHeaderCellRect(bool _bIsColumnBar, sal_Int32 nPos);
+ tools::Rectangle calcTableRect();
+ tools::Rectangle calcCellRect(sal_Int32 _nRowPos, sal_Int32 _nColPos);
+ void FillAccessibleStateSetForCell(sal_Int64& _rStateSet, sal_Int32 _nRow,
+ sal_uInt16 _nColumnPos) const;
+ OUString GetRowName(sal_Int32 _nIndex) const;
+ OUString GetColumnName(sal_Int32 _nIndex) const;
+ bool HasRowHeader();
+ bool HasColHeader();
+ OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ sal_Int32 GetSelectedRowCount() const;
+ sal_Int32 GetSelectedRowIndex(sal_Int32 const i_selectionIndex) const;
+ bool IsRowSelected(sal_Int32 const i_rowIndex) const;
+ void SelectRow(sal_Int32 const i_rowIndex, bool const i_select);
+ void SelectAllRows(bool const i_select);
+
+ TableCell hitTest(const Point& rPoint) const;
+ void invalidate(const TableArea aArea);
private:
DECL_LINK( ImplSelectHdl, LinkParamNone*, void );
diff --git a/toolkit/inc/controls/table/tablecontrolinterface.hxx b/toolkit/inc/controls/table/tablecontrolinterface.hxx
index 8f5dca676375..e5ff0cd88303 100644
--- a/toolkit/inc/controls/table/tablecontrolinterface.hxx
+++ b/toolkit/inc/controls/table/tablecontrolinterface.hxx
@@ -29,7 +29,7 @@
namespace svt::table
{
//= TableControlAction
- enum TableControlAction
+ enum class TableControlAction
{
/// moves the cursor in the table control one row up, if possible, by keeping the current column
cursorUp,
@@ -163,18 +163,6 @@ namespace svt::table
*/
virtual void showCursor() = 0;
- /** dispatches an action to the table control
-
- @return
- <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
- failure conditions include some other instance vetoing the action, or impossibility
- to execute the action at all (for instance moving up one row when already positioned
- on the very first row).
-
- @see TableControlAction
- */
- virtual bool dispatchAction( TableControlAction _eAction ) = 0;
-
/** returns selection engine*/
virtual SelectionEngine* getSelEngine() = 0;
diff --git a/toolkit/inc/controls/table/tableinputhandler.hxx b/toolkit/inc/controls/table/tableinputhandler.hxx
deleted file mode 100644
index 9d11df38db3d..000000000000
--- a/toolkit/inc/controls/table/tableinputhandler.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <memory>
-
-class MouseEvent;
-class KeyEvent;
-
-
-namespace svt::table
-{
-
-
- class ITableControl;
-
-
- //= ITableInputHandler
-
- /** interface for components handling input in a ->TableControl
- */
- class ITableInputHandler
- {
- public:
- // all those methods have the same semantics as the equal-named methods of ->Window,
- // with the additional option to return a boolean value indicating whether
- // the event should be further processed by the ->Window implementations (<FALSE/>),
- // or whether it has been sufficiently handled by the ->ITableInputHandler instance
- // (<FALSE/>).
-
- virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
- virtual bool GetFocus ( ITableControl& _rControl ) = 0;
- virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
-
- virtual ~ITableInputHandler() { }
- };
- typedef std::shared_ptr< ITableInputHandler > PTableInputHandler;
-
-
-} // namespace svt::table
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablemodel.hxx b/toolkit/inc/controls/table/tablemodel.hxx
index 7add49629a2a..97d0c56c9ea7 100644
--- a/toolkit/inc/controls/table/tablemodel.hxx
+++ b/toolkit/inc/controls/table/tablemodel.hxx
@@ -20,9 +20,9 @@
#pragma once
#include <toolkit/dllapi.h>
+#include <controls/table/defaultinputhandler.hxx>
#include <controls/table/tabletypes.hxx>
#include <controls/table/tablerenderer.hxx>
-#include <controls/table/tableinputhandler.hxx>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/style/HorizontalAlignment.hpp>
diff --git a/toolkit/inc/helper/btndlg.hxx b/toolkit/inc/helper/btndlg.hxx
index 8894b8dec619..f865d63308bb 100644
--- a/toolkit/inc/helper/btndlg.hxx
+++ b/toolkit/inc/helper/btndlg.hxx
@@ -61,7 +61,7 @@ public:
void RemoveButton( sal_uInt16 nId );
protected:
- ButtonDialog( WindowType nType );
+ ButtonDialog( WindowType eType );
tools::Long ImplGetButtonSize();
private: