2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-10-11 09:04:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef SCREENREADER_H
|
|
|
|
#define SCREENREADER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QAccessible>
|
|
|
|
#include <QAccessibleBridge>
|
|
|
|
|
|
|
|
/*
|
|
|
|
A Simple screen reader for touch-based user interfaces.
|
|
|
|
|
2012-01-17 19:02:18 +00:00
|
|
|
Requires a text-to-speach backend. Currently implemented
|
|
|
|
using festival on unix.
|
2011-10-11 09:04:59 +00:00
|
|
|
*/
|
|
|
|
class OptionsWidget;
|
|
|
|
class ScreenReader : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
explicit ScreenReader(QObject *parent = nullptr);
|
2011-10-11 09:04:59 +00:00
|
|
|
~ScreenReader();
|
|
|
|
|
|
|
|
void setRootObject(QObject *rootObject);
|
|
|
|
void setOptionsWidget(OptionsWidget *optionsWidget);
|
|
|
|
public slots:
|
|
|
|
void touchPoint(const QPoint &point);
|
|
|
|
void activate();
|
|
|
|
protected slots:
|
|
|
|
void processTouchPoint();
|
|
|
|
signals:
|
|
|
|
void selected(QObject *object);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void speak(const QString &text, const QString &voice = QString());
|
|
|
|
private:
|
|
|
|
QAccessibleInterface *m_selectedInterface;
|
|
|
|
QAccessibleInterface *m_rootInterface;
|
|
|
|
OptionsWidget *m_optionsWidget;
|
|
|
|
QPoint m_currentTouchPoint;
|
|
|
|
bool m_activateCalled;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SCREENREADER_H
|