┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistviewaccessible.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2024-10-28 13:25:10 +0000
committerFelix Ernst <[email protected]>2024-10-28 13:25:10 +0000
commitf208acd5f68c8516b9f6a920cc229803637e23e9 (patch)
treef748d6386ed579c494497998097bdc92a432e704 /src/kitemviews/kitemlistviewaccessible.h
parent4d5cab6a5fcaa8edeb18cbacd2061cc098054882 (diff)
Overhaul main view accessibility
This commit brings the main view of Dolphin into a usable state accessibility-wise. Users of screen readers should have a way better experience while browsing files and folders and navigating along the file system hierarchy. This commit fixes most of the remaining already-identified accessibility issues listed in https://invent.kde.org/teams/accessibility/collaboration/-/issues/28, but not all. Namely, these should now be fixed: 1. Orca should read the element type in dolphin (file, folder, device, link to folder, link to file) 2. Orca should read complete label in icon and compact view mode, currently it only speaks the name, but there could be additional information like the number of elements or the file size. 3. Orca is not able to announce Selecting / Unselecting files in Dolphin. It also never announces how many items are selected in total. (Announcing the total selection can be done by reading out the view element or by pressing the Tab key to get to the status bar with the relevant information.) 4. Dolphin opens on the home directory, but Orca doesn't tell you so. Consider enclosing the area in a frame/panel which updates its accessible name each time you modify the current path by entering or leaving a directory. 5. I don't know what the folder presentation widget is, but it should be presented as a grid view. Currently, we have a terrible experience because the entire row of folders is read at once, with no indication that we can move left and right with the arrows to go between the elements of a row. When I found that out, however, I discovered that when you're on the last icon of the first row and press right arrow, you get to the first icon of the next row, but that's not announced, instead, the whole row is announced at once 6. Orca should announce the current elements instead of "layered pane" when the Folder / File view gets the focus in dolphin 7. Orca reads only name in Table View only of Dolphin 8. Items are sometimes confusingly announced as "collapsed" in contexts in which there is no concept of collapsing/expanding e.g. in icon view mode. A lot of code was moved around and renamed. The three accessibility classes, which all used to be in the same file, are moved into separate files. *Acknowledgement* Thanks to Christian Hempfling and bgt lover for testing as well as originally identifying a lot of the pain points being addressed here. This work is part of a my project funded through the NGI0 Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology. https://kde.org/announcements/2024_ngi_openletter/
Diffstat (limited to 'src/kitemviews/kitemlistviewaccessible.h')
-rw-r--r--src/kitemviews/kitemlistviewaccessible.h144
1 files changed, 0 insertions, 144 deletions
diff --git a/src/kitemviews/kitemlistviewaccessible.h b/src/kitemviews/kitemlistviewaccessible.h
deleted file mode 100644
index 41aacf367..000000000
--- a/src/kitemviews/kitemlistviewaccessible.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2012 Amandeep Singh <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#ifndef KITEMLISTVIEWACCESSIBLE_H
-#define KITEMLISTVIEWACCESSIBLE_H
-
-#ifndef QT_NO_ACCESSIBILITY
-
-#include "dolphin_export.h"
-
-#include <QAccessible>
-#include <QAccessibleObject>
-#include <QAccessibleWidget>
-#include <QPointer>
-
-class KItemListView;
-class KItemListContainer;
-class KItemListContainerAccessible;
-
-class DOLPHIN_EXPORT KItemListViewAccessible : public QAccessibleObject, public QAccessibleTableInterface
-{
-public:
- explicit KItemListViewAccessible(KItemListView *view, KItemListContainerAccessible *parent);
- ~KItemListViewAccessible() override;
-
- void *interface_cast(QAccessible::InterfaceType type) override;
-
- QAccessible::Role role() const override;
- QAccessible::State state() const override;
- QString text(QAccessible::Text t) const override;
- QRect rect() const override;
-
- QAccessibleInterface *child(int index) const override;
- int childCount() const override;
- int indexOfChild(const QAccessibleInterface *) const override;
- QAccessibleInterface *childAt(int x, int y) const override;
- QAccessibleInterface *parent() const override;
-
- // Table interface
- QAccessibleInterface *cellAt(int row, int column) const override;
- QAccessibleInterface *caption() const override;
- QAccessibleInterface *summary() const override;
- QString columnDescription(int column) const override;
- QString rowDescription(int row) const override;
- int columnCount() const override;
- int rowCount() const override;
-
- // Selection
- int selectedCellCount() const override;
- int selectedColumnCount() const override;
- int selectedRowCount() const override;
- QList<QAccessibleInterface *> selectedCells() const override;
- QList<int> selectedColumns() const override;
- QList<int> selectedRows() const override;
- bool isColumnSelected(int column) const override;
- bool isRowSelected(int row) const override;
- bool selectRow(int row) override;
- bool selectColumn(int column) override;
- bool unselectRow(int row) override;
- bool unselectColumn(int column) override;
- void modelChange(QAccessibleTableModelChangeEvent *) override;
-
- KItemListView *view() const;
-
-protected:
- virtual void modelReset();
- /**
- * Create an QAccessibleTableCellInterface representing the table
- * cell at the @index. Index is 0-based.
- */
- inline QAccessibleInterface *cell(int index) const;
-
-private:
- class AccessibleIdWrapper
- {
- public:
- AccessibleIdWrapper();
- bool isValid;
- QAccessible::Id id;
- };
- mutable QVector<AccessibleIdWrapper> m_cells;
-
- KItemListContainerAccessible *m_parent;
-};
-
-class DOLPHIN_EXPORT KItemListAccessibleCell : public QAccessibleInterface, public QAccessibleTableCellInterface
-{
-public:
- KItemListAccessibleCell(KItemListView *view, int m_index);
-
- void *interface_cast(QAccessible::InterfaceType type) override;
- QObject *object() const override;
- bool isValid() const override;
- QAccessible::Role role() const override;
- QAccessible::State state() const override;
- QRect rect() const override;
- QString text(QAccessible::Text t) const override;
- void setText(QAccessible::Text t, const QString &text) override;
-
- QAccessibleInterface *child(int index) const override;
- int childCount() const override;
- QAccessibleInterface *childAt(int x, int y) const override;
- int indexOfChild(const QAccessibleInterface *) const override;
-
- QAccessibleInterface *parent() const override;
- bool isExpandable() const;
-
- // Cell Interface
- int columnExtent() const override;
- QList<QAccessibleInterface *> columnHeaderCells() const override;
- int columnIndex() const override;
- int rowExtent() const override;
- QList<QAccessibleInterface *> rowHeaderCells() const override;
- int rowIndex() const override;
- bool isSelected() const override;
- QAccessibleInterface *table() const override;
-
- inline int index() const;
-
-private:
- QPointer<KItemListView> m_view;
- int m_index;
-};
-
-class DOLPHIN_EXPORT KItemListContainerAccessible : public QAccessibleWidget
-{
-public:
- explicit KItemListContainerAccessible(KItemListContainer *container);
- ~KItemListContainerAccessible() override;
-
- QAccessibleInterface *child(int index) const override;
- int childCount() const override;
- int indexOfChild(const QAccessibleInterface *child) const override;
-
-private:
- const KItemListContainer *container() const;
-};
-
-#endif // QT_NO_ACCESSIBILITY
-
-#endif