]> cloud.milkyroute.net Git - dolphin.git/blob - src/kitemviews/accessibility/kitemlistcontaineraccessible.h
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / kitemviews / accessibility / kitemlistcontaineraccessible.h
1 /*
2 * SPDX-FileCopyrightText: 2012 Amandeep Singh <aman.dedman@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef KITEMLISTCONTAINERACCESSIBLE_H
8 #define KITEMLISTCONTAINERACCESSIBLE_H
9
10 #include "dolphin_export.h"
11
12 #include <QAccessibleWidget>
13
14 class KItemListContainer;
15 class KItemListViewAccessible;
16
17 /**
18 * The accessible interface for KItemListContainer.
19 *
20 * Truthfully, there is absolutely no reason for screen reader users to interact with this interface.
21 * It is only there to bridge the gap between custom accessible interfaces and the automatically by Qt and QWidgets provided accessible interfaces.
22 * Really, the main issue is that KItemListContainer itself is the last proper QWidget in the hierarchy while the actual main view is completely custom using
23 * QGraphicsView instead, so focus usually officially goes to KItemListContainer which messes with the custom accessibility hierarchy.
24 */
25 class DOLPHIN_EXPORT KItemListContainerAccessible : public QAccessibleWidget
26 {
27 public:
28 explicit KItemListContainerAccessible(KItemListContainer *container);
29 ~KItemListContainerAccessible() override;
30
31 QString text(QAccessible::Text t) const override;
32
33 QAccessibleInterface *child(int index) const override;
34 QAccessibleInterface *focusChild() const override;
35 int childCount() const override;
36 int indexOfChild(const QAccessibleInterface *child) const override;
37
38 QAccessible::State state() const override;
39 void doAction(const QString &actionName) override;
40
41 /** @returns the object() of this interface cast to its actual class. */
42 const KItemListContainer *container() const;
43 };
44
45 #endif // KITEMLISTCONTAINERACCESSIBLE_H