summaryrefslogtreecommitdiffstats
path: root/src/core/browser_accessibility_manager_qt.h
blob: 188d9f81b2ef2545509514ca4658f53b9962a226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef BROWSER_ACCESSIBILITY_MANAGER_QT_H
#define BROWSER_ACCESSIBILITY_MANAGER_QT_H

#include "content/browser/accessibility/browser_accessibility_manager.h"

#include <QtCore/qobject.h>
#include <QtGui/qtgui-config.h>

#if QT_CONFIG(accessibility)

QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)

namespace QtWebEngineCore {
class WebContentsAccessibilityQt;
}

namespace content {

class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
{
public:
    BrowserAccessibilityManagerQt(QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
                                  const ui::AXTreeUpdate &initialTree,
                                  BrowserAccessibilityDelegate *delegate);
    ~BrowserAccessibilityManagerQt() override;
    void FireBlinkEvent(ax::mojom::Event event_type,
                        BrowserAccessibility* node) override;
    void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
                            BrowserAccessibility* node) override;

    QAccessibleInterface *rootParentAccessible();
    bool isValid() const { return m_valid; }

private:
    Q_DISABLE_COPY(BrowserAccessibilityManagerQt)
    QtWebEngineCore::WebContentsAccessibilityQt *m_webContentsAccessibility;
    bool m_valid = false;
};

}

#endif // QT_CONFIG(accessibility)
#endif